Forum Search
- Forum
- Support Questions
- Virtuemart Extensions Support Questions
- VM Paid Download - Attach downloadables to old orders?
VM Paid Download - Attach downloadables to old orders?
- iMbroidr
- Topic Author
- Offline
- Fresh Boarder
- Posts: 6
- Thank you received: 0
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.
- boggler
- Offline
- Moderator
- Posts: 1145
- Karma: 18
- Thank you received: 132
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
Please Log in or Create an account to join the conversation.
- iMbroidr
- Topic Author
- Offline
- Fresh Boarder
- Posts: 6
- Thank you received: 0
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.
- boggler
- Offline
- Moderator
- Posts: 1145
- Karma: 18
- Thank you received: 132
Please Log in or Create an account to join the conversation.
- boggler
- Offline
- Moderator
- Posts: 1145
- Karma: 18
- Thank you received: 132
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.
Please Log in or Create an account to join the conversation.
- iMbroidr
- Topic Author
- Offline
- Fresh Boarder
- Posts: 6
- Thank you received: 0
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
Please Log in or Create an account to join the conversation.
- boggler
- Offline
- Moderator
- Posts: 1145
- Karma: 18
- Thank you received: 132
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?
Please Log in or Create an account to join the conversation.
- Forum
- Support Questions
- Virtuemart Extensions Support Questions
- VM Paid Download - Attach downloadables to old orders?