VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: restodo on April 11, 2014, 03:34:18 AM

Title: Empty cart keeps shipping amount
Post by: restodo on April 11, 2014, 03:34:18 AM
Hi,

I'm on VM 2.6.0 and I'm using Standard Shipping plugin.

For example I have:

Shipment 1 cost  USD 38
Shipment 2 cost  USD 45
Shipment 3 cost  USD 100

If I remove the products from my cart and one of the shipments was selected, when the site say that my cart is empty the amount it isn't.

If I choose for example Shipment 2, USD 45 will be added to my cart.
When I remove the products in cart, the amount in cart stills USD 45.


Could you tell me where can I check to tell the code to clear Shipment Plugin?


Regards.
Title: Re: Empty cart keeps shipping amount
Post by: restodo on April 20, 2014, 01:15:06 AM
Somebody can help me?
Title: Re: Empty cart keeps shipping amount
Post by: JoomTut on April 20, 2014, 05:44:21 AM
you can try to disable cache (Joomla! cache and 3rd party extension), use other web browser,...
Title: Re: Empty cart keeps shipping amount
Post by: AH on April 20, 2014, 16:45:26 PM
it is not a cash or browser issue, it is to do with VM not clearing the session variable for shipping, when there are no products in the cart
Title: Re: Empty cart keeps shipping amount
Post by: restodo on April 21, 2014, 01:33:46 AM
Quote from: Hutson on April 20, 2014, 16:45:26 PM
it is not a cash or browser issue, it is to do with VM not clearing the session variable for shipping, when there are no products in the cart

Yes, I'm thinking on something like that but I don't know how can I solve it.

Do you know?
Title: Re: Empty cart keeps shipping amount
Post by: JoomTut on April 21, 2014, 06:18:01 AM
I don't think this is a bug of VM. But you can use this code if you want to hide the shipment cost when no product in cart:
Apply for VM 2.6
File to edit: components/com_virtuemart/views/cart/tmpl/default_pricelist.php (please creating template override)
Line 366:
<td align="right"><?php if($prow->product_name) echo $this->currencyDisplay->createPriceDiv ('salesPriceShipment'''$this->cart->pricesUnformatted['salesPriceShipment'], FALSE); ?> </td>
Line 411:
<td align="right"><div class="bold"><?php if($prow->product_name) echo $this->currencyDisplay->createPriceDiv ('billTotal'''$this->cart->pricesUnformatted['billTotal'], FALSE); ?></div></td>
Title: Re: Empty cart keeps shipping amount
Post by: AH on April 21, 2014, 11:50:13 AM
Yes Joomtut

You can create the override as you suggested but the issue is still that the variable $this->cart->pricesUnformatted['salesPriceShipment']

Is left populated when there are no products in the cart

It should be raised as a bug or "unwanted feature"
Title: Re: Empty cart keeps shipping amount
Post by: restodo on April 22, 2014, 01:41:31 AM
Quote from: Hutson on April 21, 2014, 11:50:13 AM
Yes Joomtut

You can create the override as you suggested but the issue is still that the variable $this->cart->pricesUnformatted['salesPriceShipment']

Is left populated when there are no products in the cart

It should be raised as a bug or "unwanted feature"

Yes, I think the same to you. I hope some admin o developer read this post.

Title: Re: Empty cart keeps shipping amount
Post by: JoomTut on April 24, 2014, 04:04:27 AM
Have you tried doing it? Are you doing the right thing?

As I said, you can use this code if you want to hide the shipment cost  when no product in cart.

In this code, I use IF conditions to recognize when there are products in your shopping cart:

if($prow->product_name)

You can apply it to wherever you want, not only the shipment cost.
Title: Re: Empty cart keeps shipping amount
Post by: kreativa on May 25, 2015, 10:43:29 AM
Hi,
I also had this problem.
In shipment methods the Lowest Weight should be more then 0 g
Title: Re: Empty cart keeps shipping amount
Post by: JestaBlunt on June 10, 2015, 16:36:41 PM
add 1 to the minimal count of products of the shipping type (in german its "Mindestanzahl von Produkten")...works like a charm
Title: Re: Empty cart keeps shipping amount
Post by: GJC Web Design on June 10, 2015, 19:14:05 PM
can confirm JestaBlunt solution is the correct one -- just choose a minimum of 1 product in your shipping method