Jump to content

[BUG] carrier bill by total price ranges not working with "disable out of range"


r00tb33r

Recommended Posts

PrestaShop v1.6.1.4

default-bootstrap v1.0

 

There's a bug in "Billing -  According to total price." for shipping carriers when "Out-of-range behavior - Disable carrier" is set.

 

Testing:

 

Test 1

 

Ranges:

$0 to $250 is $10

$250 to $500 is $20

 

Settings:

Billing -  According to total price.

Out-of-range behavior - Apply the cost of the highest defined range

 

Input:

Cart total = $240

 

Output:

Shipping rate = $10 - CORRECT

 

Test 2

 

Ranges:

$0 to $250 is $10

$250 to $500 is $20

 

Settings:

Billing -  According to total price.

Out-of-range behavior - Apply the cost of the highest defined range

 

Input:

Cart total = $280

 

Output:

Shipping rate = $20 - CORRECT

 

Test 3

 

Ranges:

$0 to $250 is $10

$250 to $500 is $20

 

Settings:

Billing -  According to total price.

Out-of-range behavior - Disable carrier

 

Input:

Cart total = $240

 

Output:

Shipping rate = NO CARRIER - FAIL! BUG!!!  Why fail? Because $0 < $240 < $250.

 

Test 4

 

Ranges:

$0 to $250 is $10

$250 to $500 is $20

 

Settings:

Billing -  According to total price.

Out-of-range behavior - Disable carrier

 

Input:

Cart total = $280

 

Output:

Shipping rate = NO CARRIER - FAIL! BUG!!!  Why fail? Because $250 < $280 < $500.

 
-------------------------------------------------

Please tell me where the code for this logic is so I could fix the bug.  I need this functionality working correctly to implement a second carrier that is only enabled for a certain $ range.

 

Thanks in advance!

Link to comment
Share on other sites

Looks like the bulk of the code is in \classes\Carriers.php...  The bug is probably somewhere in the function calls or type conversions.  "Disable carrier out of range" is too buggy to use so I implemented a hack to make it work without it.  I implemented a poison value for ranges where I want to disable a carrier.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...