News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

ORDER IDs being overwritten

Started by capewellmj, September 16, 2014, 20:36:15 PM

Previous topic - Next topic

capewellmj

We have a major problem with VM 2.6.8 and 2.6.10 (it does not do this when we revert to 2.6.6.

Intermittently we get a new order come in and it overwrites a previous order ID. The order number continues to rise (we have the order number plugin) but the order ID and entire order gets overwritten in our system.

This is a huge problem and seems to be related to when a customer orders from us through paypal and doesn't complete payment and the status remains in pending.

Please help, there must be others with this problem since the update.

Martin

jjk

Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

capewellmj

Hello

It is not the order number that is the problem. It is the order IDs. My actual entire orders are being overwritten and the ORDER IDs are not going up. The order number plugin is working perfectly.

When I reinstall VM 2.6.6 it fixes the issue.

Martin


Milbo

if it is the same customer and the order is pending, that is the new behaviour. To prevent double checkouts. Why is this a probelm for you? Pending Order status is used for orders which got created, but are not confirmed by the shopper, so they are not really relevant for the system.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

capewellmj

Hello Milbo

What triggers this behaviour? Is it when someone places an order and the status is pending, the next customer order overwrites it? Most of my customers checkout as a guests, how does that affect it? Do guest orders overwrite other guest orders that are pending? I would like to know exactly what triggers virtuemart to delete an order, is it triggered by name and an order status of pending?

The problem is that we like to keep records of all order history, even pending orders and we do not like virtuemart deleting any orders automatically. We would really like to know how to switch this behaviour off. A tab that allowed us to opt out of overwriting pending orders would be really great. At least could you tell us how to switch it off manually.

Thank you for your help.

Martin

capewellmj

So I did a test where I placed 2 orders through PayPal and did not pay. Sure enough the second order deleted the first order but I now have a new problem, I cannot add any products to the cart anymore and get this error message: "Error the quantity of the product for calculation is 0, please notify the shopowner, the product id 0"

I'm re-posting this issue here because I think it is related. Luckily this happened on a test site. I have tried reinstalling an earlier virtuemart but it still is not working. Somehow this deleting of the pending order also corrupted my site somehow.

Is anyone else experiencing problems with this?

Martin

capewellmj

#6
Hello

I fixed the "Error the quantity of the product for calculation is 0, please notify the shopowner, the product id 0" by installing an older version of my yagendoo theme. The error for that lay there somewhere.

Still I would love to know how to turn off the behavior that automatically deletes orders from my site.

Thanks,

Martin

capewellmj

I hate to be a pain but I am holding off updating VM (apart from the security patch) in the hopes that someone can tell me how to bypass this behaviour of deleting pending orders.

Any help or update would be great.

Thanks,

Martin

Milbo

models/orders.php line 876 if(!$order){

just disable the whole if,... I add now a config value if(VmConfig::get('reuseorders',true) and !$order){
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

capewellmj

To clarify because I am not a programmer.

I delete all of this part:

   if(!$order){
            $jnow = JFactory::getDate();
            $jnow->sub(new DateInterval('PT1H'));
            $minushour = $jnow->toMySQL();
            $q .= ' WHERE `customer_number`= "'.$_orderData->customer_number.'" ';
            $q .= '   AND `order_status` = "P"
            AND `created_on` > "'.$minushour.'" ';
            $db->setQuery($q);
            $order = $db->loadAssoc();
            if(!$order){
               $_cart->virtuemart_order_id = null;

Then in its place I add this line:

if(VmConfig::get('reuseorders',true) and !$order){

If that is wrong can you paste what I should change it to.

Thank you,

Martin

Milbo

to delete the part only is also correct for you. For the future you need to add the variable reuseorders=0 in your virtuemart.cfg file and use the tool "renew config by file" or so. Then you must reconfigure your config (sry, better solved in vm3  already). It is maybe not too bad idea todo screenshots of your vmconfig. Maybe I add an option in the config in vm3, but not for vm2.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

capewellmj

Yes, we would love the option in VM3 to easily opt out as a lot of us need complete order histories including pending orders.

So what do I do with this line? if(VmConfig::get('reuseorders',true) and !$order){

Can I ignore that or do I put that in the orders.php too?

Martin

capewellmj

Hello

I was testing VM3 and was wondering where I can find the option to stop virtuemart overwriting pending orders when a new order is placed that is completed. We need a full order history regardless of completion.

I could not find the option.

Thanks,

Martin