Shopping Basket

 x 

Cart empty


Log In

Find Us Elsewhere

SSL

Forum Search

Keyword

Import with CSVI PRO custom field spiral_download

  • stetod
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 8 months ago #3764 by stetod
Hi,

Having to sell thousands of digital products I purchased Spiral Paid and got the automatic management of the links of products purchased with complete success!

Now I have to be able to produce thousands of products automatically by importing the necessary data from a csv file.

The best product on the market for import and export of VirtueMart is CSVI Pro.

I need to know how to be able to recognize CSVI Pro fields in which to enter the required values.

The plugin name is known, but I miss the name of the file to be downloaded and the other setting parameters.

Can you give me more information?

It would be interesting to know at least what the VM fields in order to intercept them with CSVI Pro because it is able to know if the field is available by scanning to update.

Thank you

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #3768 by boggler
This should be possible, you just have to import the data into the #__virtuemart_product_customfields table. Most of the fields should be fairly easy to understand:-

virtuemart_customfield_id is the primary key and should be unique.
virtuemart_product_id is of course the id of the product in the #__virtuemart_products table
virtuemart_custom_id corresponds to the id number of the custom field in the #__virtuemat_customs table
customfield_value should be set to spiral_download

customfield_params is where you set the parameters for the specific field, including the file media_id. The file media_id is the primary key id of the file in the #__virtuemart_medias table. Or if you are uisng the AS3 Manager extension to sell cloud files then you would set the package id instead for the "package" parameter.

The parameters are not exactly json_encoded but are a string separated by the '|' character, an example is:-
package=""|object_key=""|bucket=""|media_id="30"|number_downloads="0"|days_downloads="0"|title="Articles Count"|short_description=""|description=""|loadStylesheet="yes"|updateOrders="yes"|orderstatus=[
    "C",
    "S"
]|allowStreaming="no"|speed="100"|downloadType="attachment"|

I hope this makes things clear.

Please Log in or Create an account to join the conversation.

  • stetod
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 6 months ago #3777 by stetod
Hello,

I'll try to give it a try and I will keep you updated on the results!

By analyzing the code, it seems strange that the parameter string terms with |!
Maybe this character is also interpreted as a closure of the string! Can you give me a confirmation?

Thank you

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago - 2 years 6 months ago #3778 by boggler
I did some checking into this myself, what seems to be the case is that the individual parameters are json encoded, then glued together into a string separated by |. So far as I know the | character is not interpreted as the terminator of the string, just as the separator for the parameters, the reason why it ends the string is just to do with the way that the parameter string is created. It just means that you have to be carefully when converting the parameteres into an object or array, if you use explode then you will end up with an empty string at the end of the array.

The code that I wrote for myself to decode the parameter string is this:-
	public function decodeParams($paramsString)
	{
		  $params = explode('|', $paramsString);
		  $obj = new stdClass();
		  
		  foreach ($params as $param) {

			  $items = explode('=', $param);
			  $key = $items[0];
			  unset($items[0]);


			  $item = implode('=', $items);
			  $item = json_decode($item);
			  
			  if (!empty($key)){ 
                               // this test prevents empty piece at end of array causing a fatal error
				$obj->$key = $item; 
			  }

			  
		  }
		  
		  return $obj;
		
		
	}	

It works for my purposes and I think makes it clear how the parameters work. The actual code in Virtuemart that handles the parameters is in helpers/vmtable if you want to study it in detail, in function bindParameterable
Last edit: 2 years 6 months ago by boggler.

Please Log in or Create an account to join the conversation.

  • stetod
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 6 months ago #3789 by stetod
Hi,

I did some tests with this code csv

product_sku custom_title custom_value custom_params
parent-sku Scarica_Prodotto spiral_download Media_id = "3658" | short_description = "description-short" | description = "description-complete" | number_downloads = "10" | days_downloads = "3" | downloadType = "attachment" | allowStreaming = "no" | speed = "100"

I seem to have realized that you need to create the custom field in the VM table and then add to it the contents of the product involved.

I think it is necessary to make an update Maintenance> Available Fields before importing the contents of the field.

In the first import I used a template Import> VirtueMart> Custom Field
In the second import I used a template Import> VirtueMart> Product

I got the addition of the custom field to the product and customizing some fields, but then I discovered that the custom field Scarica_Prodotto + was corrupted, so I had to cancel it!

I need these tests:
1 - Check the use of import fields
2 - Check the contents of each field of import, especially custom_params
3 - Figure out what type of template should I use, if it is correct to use two
4 - figure out what is the correct procedure if it is correct before Custom Field and then Product

I attach images and log

Thanks for collaboration

Please Log in or Create an account to join the conversation.

  • stetod
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 6 months ago #3790 by stetod
I was not able to attach images in any way!!!

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #3793 by boggler
I am sorry, there does seem to be an issue with uploading images, we are not sure why this is at the moment.

If you can post URLs where I can see the images I will take a look.

Please Log in or Create an account to join the conversation.

  • stetod
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 years 6 months ago #3794 by stetod
Hi,

I need to automate importing my custom field "Scarica_Prodotto" created to match my files to product card using CSVI Pro.

I'm trying with the help of the media also CSVI Pro to figure out how to import it properly this field in each product.

I received directions to Dropbox but do not think they can be fine.

This made the last test:

product_sku custom_title custom_value custom_params
parent-sku Scarica_Prodotto spiral_download Media_id = "3658" | short_description = "description-short" | description = "description-complete" | number_downloads = "10" | days_downloads = "3" | downloadType = "attachment" | allowStreaming = "no" | speed = "100"

This is the recommended procedure:

1 - to add the field manually using CSVI Pro, I need to know precisely how and doce Spira Paid stores its data in which table, in what fields and what are the values ​​to use for the import for each field

2 - then I take a field upgrade with update Maintenance> Available Fields

3 - after I import Import> VirtueMart> Product related data for each product

I got a partial result, but VM has corrupted me the custom field, so there is still some mistakes on how to add data to the golf!

I need your help to precisely define the import procedure for CSVI Pro! I am sure that this need will be very useful to many of your customers and also to new ones!

You can kindly give me some help?

Thank you

I still can not attach any files!

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #3796 by boggler
As I said before, we are having some problems with uploading images, if you want to attach a screenshot please upload it on your own site and supply an url to it. Or you could put the image on dropbox.

Are you hosting the files you want to sell on Dropbox? If so you will need to use our AS3 manager extension and create a package for the file. Or are they on your server? It is not clear from what you say.

As I said before, the parameters for the spiral download plugin should look like this:-
package=""|object_key=""|bucket=""|media_id="30"|number_downloads="0"|days_downloads="0"|title="Articles Count"|short_description=""|description=""|loadStylesheet="yes"|updateOrders="yes"|orderstatus=[
    "C",
    "S"
]|allowStreaming="no"|speed="100"|downloadType="attachment"|

The ones that you quote seem to be for a different plugin:-
Media_id = "3658" | short_description = "description-short" | description = "description-complete" | number_downloads = "10" | days_downloads = "3" | downloadType = "attachment" | allowStreaming = "no" | speed = "100"

This is not the same set of parameters. That may explain why it is not working. Possibly you are importing the wrong custom field? Make sure that the virtuemart_custom_id field is the correct one for the spiral download custom field.

I need your help to precisely define the import procedure for CSVI Pro! I am sure that this need will be very useful to many of your customers and also to new ones!


I am sorry but I am not an expert on using CSVI Pro (though I have used it before). I am happy to offer suggestions but the only thing that I am an expert on is our own plugin, and as long as it is set up up using the correct parameters and the correct virtuemart_custom_id then it will work.

The only part of the parameters that needs to vary between products is

media_id (for locally hosted products)
package (for cloud hosted products)
title

if you can create a template where these values are extracted from a csv file and put into the parameters then it should be possible to automate.

Please Log in or Create an account to join the conversation.

Moderators: boggler
Time to create page: 0.382 seconds

Donate to Us

If you like our extensions, consider making a donation to say thanks.