Shopping Basket


 x 

Cart empty


Log In

Find Us Elsewhere

Forum Search

Keyword

VM Paid Download - Attach downloadables to old orders?

  • iMbroidr
  • iMbroidr's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 1 week ago #3906 by iMbroidr
iMbroidr created the topic: VM Paid Download - Attach downloadables to old orders?
My site was migrated from Woocommerce to Virtuemart by Cart2Cart by a developer but because VM doesn't offer native downloadable support, no downloadables were attached to the products or past orders.

Using VM Paid Download and CSVI, I've attached an average of 8 downloadable products to >3K products and everything appears to be working. The next step is to rebuild all the migrated orders so that customers can access their previous downloads.

Is there a way I can import that information back into the customer orders? Or somehow rebuild those old orders? I exported some new orders but I don't see where that information is stored and I'm not even sure how to manually attach them looking at individual orders.

Can you give me some pointers? I know you can't support another developer's plugin but can you tell me how/where the data is stored in the customer orders?

Thanks!

Lindee

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

More
2 months 1 week ago #3907 by boggler
boggler replied the topic: VM Paid Download - Attach downloadables to old orders?
Hello Lindee,

I think it should be possible to automate this. When a customer makes an order, any custom field information is saved to the 'product_attribute' field of the 'virtuemart_order_items' table. This table records the individual products that are part of the order. You should just need to re-create this information in the product_attribute field for the download fields to work.

The information in this field is json encoded, and will look something like this for example
{"21":{"109":false,"110":false}}

The first number (21) is the 'virtuemart_custom_id' number for the download plugin entry in the 'virtuemart_customs' table. If you only have one download custom field (which you normally would), this number will always be the same for your site, although probably will not be 21.

The remaining numbers 109, 110 are the virtuemart_customfield_id numbers in the 'virtuemart_product_customfields' table. This table records each instance of the download field attached to a product, in this example the product has two download fields.

That should be all that you need to enable the downloads for old products, you just need to figure out the correct numbers for each product (item) in the order.

One other thing to understand is how it works if the product for that order item has more than one custom field, in that case it would be encoded like this for example
{"21":{"120":false},"28":{"122":false}}

In this case 21 is the download custom field, 28 is another custom field
The following user(s) said Thank You: iMbroidr

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

  • iMbroidr
  • iMbroidr's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 1 week ago #3908 by iMbroidr
iMbroidr replied the topic: VM Paid Download - Attach downloadables to old orders?
Thanks! This will give me a start to sort it out.

In the meantime, can you tell me how to manually fix orders? When I look at old orders, I can edit the product and edit downloads.

When I edit products, I can see that the downloads are attached. When I click on edit downloads, I only see options to change the number of downloads or extend the time. I don't see how to attach them. Is there a way?

Lindee

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

More
2 months 1 week ago - 2 months 1 week ago #3909 by boggler
boggler replied the topic: VM Paid Download - Attach downloadables to old orders?
You cannot attach a new download to an order, a download can only be attached to a product, it is a limitation of the way that Virtuemart custom fields work. If you want to attach a new download to an order you need to add the product to which the download is attached.
Last Edit: 2 months 1 week ago by boggler.
The following user(s) said Thank You: iMbroidr

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

More
2 months 1 week ago #3910 by boggler
boggler replied the topic: VM Paid Download - Attach downloadables to old orders?
I tested this, it doesn't seem to be possible to add a new product manually to an order in Virtuemart, so I think you will need to do this as described above.

If you want some assistance with this we might be able to do it as a custom programming job, it should be possible to write a PHP script that can do this automatically.
The following user(s) said Thank You: iMbroidr

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

  • iMbroidr
  • iMbroidr's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
More
2 months 1 week ago - 2 months 1 week ago #3911 by iMbroidr
iMbroidr replied the topic: VM Paid Download - Attach downloadables to old orders?
I'm not trying to add in NEW products just reconnect the downloadables to OLD orders that were migrated from the old Woocommerce shop.

I can sort of fix it by adding "completed" to the order status list in the custom fields settings for the plug in. That adds a download button but it doesn't attach the downloadable files and clicking on the download button displays "no file found."

I'm attaching 2 files. The one with "Download Info: Design Details" is a migrated order that isn't connected to anything. The one with with multiple items is a new order created after the plugin was installed and the downloadable were added to the products.


Lindee
Attachments:
Last Edit: 2 months 1 week ago by iMbroidr. Reason: New info

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

More
2 months 6 days ago - 2 months 6 days ago #3913 by boggler
boggler replied the topic: VM Paid Download - Attach downloadables to old orders?

I'm not trying to add in NEW products just reconnect the downloadables to OLD orders that were migrated from the old Woocommerce shop.


Yes I understand that, that is what my recommendation above was designed to achieve.


I can sort of fix it by adding "completed" to the order status list in the custom fields settings for the plug in. That adds a download button but it doesn't attach the downloadable files and clicking on the download button displays "no file found."



This does not fix it. In order to fix it, you will need to supply the missing custom field information in the order items table, as I explained before.

I am not sure what the screenshots are designed to show me. Do none of the download buttons work? Or only those in the first screenshot?
Last Edit: 2 months 6 days ago by boggler.
The following user(s) said Thank You: iMbroidr

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

Moderators: boggler
Time to create page: 0.159 seconds