Jump to content

Shipping value problem Free shipping + Per Category


eriknv

Recommended Posts

Hello,

 

I have a problem with the shipping value. I am using 2 shipping methods for my webshop: 

 

1. Free Shipping (minimum order value $100,-)

2. Per Category (some categories are $2.95 and some categories are $3.95)

 

When I put 2 products of $60 directly from the product page in my basket there is no problem. The shipping cost is 0.00, that's exactly right.

 

There is only a problem when i first put one product in the basket from $60,- and change the quantity to 2 on the basket page. The shipping cost is still $3,95 where it needs to be 0,00 (subtotal is $120)..

 

This problem only appears on the 'shopping-cart' page before the user is logged in. On the 'index.php?_a=confirm' page everything works fine (When a user is logged in).

 

I am using Cubecart 5.2.2. Can somebody help me with this problem?

 

Thanx in advance.

Erik

Link to comment
Share on other sites

Good suggestion Dirty Butter. Unfortunately, upgrading to the latest version did not solve the problem.

Hopefully there is a quick solution for the problem bsmither. Maybe somebody knows a temporary solution. 

 

Something hard coded in the cart class like this:

if ($this->basket['subtotal'] > 100) {
    $this->basket['shipping'] = 0;
}

Thanx in advance.

Link to comment
Share on other sites

I added this in my cart.class.php file and it looks like it works. 

if ($this->basket['subtotal'] > 100) {
   $this->basket['By_Category_Shipping'] = 0;
   $this->basket['shipping']['offset'] = 1;
   $this->basket['shipping']['name'] = 'Gratis verzending bij besteding vanaf €100,-';
   $this->basket['shipping']['value'] = 0;
   $this->basket['shipping']['tax_id'] = 0;
   $this->_shipping = 0;
}

The code above bellow this line:

if (isset($this->basket[$tax_on]['state_id']) && isset($this->basket['shipping'])) {
   $GLOBALS['tax']->productTax($this->_shipping, $this->basket['shipping']['tax_id'], false, $this->basket[$tax_on]['state_id'], 'shipping');
}

Can somebody give some feedback on this? Even if this code is really terrible.

Link to comment
Share on other sites

Using an installation of CC524 that has a number of fixes applied -- but none related to the problem you are experiencing -- when the quantity is changed in the View Cart (_a=basket) past the point where the cart total reaches above 100, only until then will Free Shipping appear.

 

I've made a trace of the code and, except for a redundant trip through the Per-Category calculator that happens too early, CubeCart behaves fine.

 

I just double-checked on an 'un-fixed' version of CC524, and when changing the quantity of an item so that it goes over the Free Shipping amount, Free Shipping does appear.

 

I wonder if there is a difference in your case because your money expression uses a comma as a decimal point. To test this, please enable debug mode. (admin, Store Settings, Advanced tab, Debug mode: enabled, and also enter your IP address in the field -- you can get your IP address at www.whatismyip.com)

 

At the bottom of the CubeCart pages will be a grey section. In here, you will find what the prices of the shopping basket are. Do they use periods as decimal points, or commas?

Link to comment
Share on other sites

This isn't a known issue at all. I don't have much in the way of a suggestion without getting my hands dirty debugging the source. Maybe you want to send a tech support ticket?

 

A very common mistake is for currency symbols to be entered into module configuration text fields but I'm just taking a quick stab in the dark.

Link to comment
Share on other sites

 

A very common mistake is for currency symbols to be entered into module configuration text fields but I'm just taking a quick stab in the dark.

 

This is the sort of thing that needs to be added to the Admin page as a caution at the point of use. There are probably several common errors you could eliminate by doing that with the next upgrade.

Link to comment
Share on other sites

Thanks for all the comments! 

 

[...]

I wonder if there is a difference in your case because your money expression uses a comma as a decimal point. To test this, please enable debug mode. (admin, Store Settings, Advanced tab, Debug mode: enabled, and also enter your IP address in the field -- you can get your IP address at www.whatismyip.com)

 

At the bottom of the CubeCart pages will be a grey section. In here, you will find what the prices of the shopping basket are. Do they use periods as decimal points, or commas?

 

This is some debug info:

First I added 2 the same products (91,90), after that I updated the products to 3. 

'id' => 7930
'quantity' => '3'
'digital' => '0'
'options' =>
'1' => '29106'
'options_identifier' => 'd41d8cd98f00b204e9800998ecf8427e'
'option_line_price' => 0
'total_price_each' => '45.95'
'description' => ' Blablabla'
'product_code' => '82438916'
'product_weight' => 0
'tax_each' => false
'By_Category_Shipping' => 3.95
'weight' => '0.000'
'discount' => '0.00'
'subtotal' => '137.85'
'total_tax' => '0.00'
'total' => '141.80'

As you can see I use decimal points for every value.

 

This is debug when I was logged in and add the same products in 2 times (first 2 and later update to to 3)

'id' => 7930
'quantity' => '3'
'digital' => '0'
'options' =>
'1' => '29106'
'options_identifier' => 'd41d8cd98f00b204e9800998ecf8427e'
'option_line_price' => 0
'total_price_each' => '45.95'
'description' => ' Blablabla'
'product_code' => '82438916'
'product_weight' => 0
'tax_each' => false
'By_Category_Shipping' => 3.95
'weight' => '0.000'
'discount' => '0.00'
'subtotal' => '137.85'
'total_tax' => '0.00'
'total' => '137.85'
'shipping' =>
'offset' => 1
'name' => 'Gratis verzending (Bij besteding vanaf €100)'
'value' => 0
'tax_id' => 0

The bold values (From 'shipping' =>) â€‹â€‹were missing in the debug before I logged in. Maybe that is causing the problem?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...