VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: elanto75 on November 25, 2019, 14:19:59 PM

Title: [Solved] Shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: elanto75 on November 25, 2019, 14:19:59 PM
Hello everyone!
when, from the user side, I place an order as administrator and then in the cart page I assign it to another customer the cart is emptied instead of updating only prices or addresses.
How can I solve it?
Thanks
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: AH on November 25, 2019, 18:14:00 PM
Assign to the Customer/Shopper BEFORE you add items
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: Milbo on November 26, 2019, 10:27:13 AM
Ah come on AH, you know better.

The reason is a hidden config, which maybe set public next release.

ChangeShopperDeleteCart is now set by default to 1. It is most time the better behaviour. You can change that using ChangeShopperDeleteCart=0 in the virtuemart.cfg (and store the vm conf one time).

The new workflow is more secure and prevents that old data of a prior customer is left in the cart.


Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: jenkinhill on November 26, 2019, 11:19:20 AM
@elanto75 hidden configuration settings are explained here:  http://docs.virtuemart.net/manual/general-concepts/206-hidden-configurations.html
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: AH on November 27, 2019, 09:19:15 AM
My solution still stands as correct -  Change shopper before adding items to cart regardless of the configuration that now exists.


Ah come on AH, you know better.

The reason is a hidden config, which maybe set public next release.



The default behaviour was NOT to empty cart for people that did not know of this feature as it was designed for a specific use case.


//behaviour on admin change shopper
if (VmConfig::get('ChangeShopperDeleteCart', 0)) {


Clearly the default behaviour has now been changed and is now the default - hence the reason for the report of changing behaviour of VM.  Which requires - either for the person to change a hidden config - or add items to the cart After a change of shopper is made.

Latest release code:

//behaviour on admin change shopper
if (VmConfig::get('ChangeShopperDeleteCart', 1)) {


Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: Milbo on November 27, 2019, 11:31:14 AM
Quote from: AH on November 27, 2019, 09:19:15 AM
The default behaviour was NOT to empty cart for people that did not know of this feature as it was designed for a specific use case.

uhm, actually Mike wrote a  feature for his customer and wanted it in the core for easier maintenance. Then he did hte maintenance for some years. Then you started to use it and noticed that the behaviour is shit, when you have a lot customers a day. It works the old way quite nice, when there is only one customer per session.

It turned out that it is a lot more secure to always delete the cart, else there could be always rests of old data. So the use case is not specific or special.

That is btw the normal evolution of our features.

Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: elanto75 on November 29, 2019, 17:42:47 PM
sorry but in my virtuemart.cfg the ChangeShopperDeleteCart parameter is not present what can I do?
thanks
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: Jörgen on November 29, 2019, 18:46:41 PM
Add it and set it to 0 of 1 depending om your needs.
Save the File and Aldo save config in VM backend to make the changes get through.
Jörgen @ kreativ fotografi
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: elanto75 on December 02, 2019, 09:33:20 AM
Quote from: Jörgen on November 29, 2019, 18:46:41 PM
Add it and set it to 0 of 1 depending om your needs.
Save the File and Aldo save config in VM backend to make the changes get through.
Jörgen @ kreativ fotografi

Thanks for your reply but can you tell me step by step how I can save the file and make the changes made active?
thanks
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: Jörgen on December 02, 2019, 09:56:55 AM
QuoteChangeShopperDeleteCart is now set by default to 1. It is most time the better behaviour. You can change that using ChangeShopperDeleteCart=0 in the virtuemart.cfg (and store the vm conf one time).

Add this to the virtuemart.cfg
## Admin user switch interaction
## ChangeShopperDeleteCart reverting to old behaviour
ChangeShopperDeleteCart=0


Save the config file.

Go into VM configuration and "Save configuration" without changing anything.

Jörgen @ Kreativ Fotografi
Title: Re: shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: elanto75 on December 02, 2019, 10:35:59 AM
Thanks, solved!
Title: Re: [Solved] Shopping cart problem after updating to VirtueMart 3.6.10 10211
Post by: Jörgen on December 02, 2019, 12:58:53 PM
Nice to hear :)

Jörgen @ Kreativ Fotografi