Jump to content

Add Free Shipping Cost BUT based on Weight


MrBaseball34
 Share

Recommended Posts

Still struggling with this issue...
In Cart.php, around line 738 (PS v1.3.0.1)

$configuration = Configuration::getMultiple(array('PS_SHIPPING_FREE_PRICE', 'PS_SHIPPING_HANDLING', 
                                                 'PS_SHIPPING_METHOD', 'PS_SHIPPING_FREE_WEIGHT'));
// Free fees
if (isset($configuration['PS_SHIPPING_FREE_PRICE']) 
   AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) 
   AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0)
 return $shipping_cost;
if (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) 
   AND $this->getTotalWeight() >= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) 
   AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)
 return $shipping_cost;



How would I modify this to return the shipping_cost if I had a PS_SHIPPING_FREE_PRICE
value of $100 AND PS_SHIPPING_FREE_WEIGHT of 20lbs.

I want the free shipping to happen ONLY if >=$100 and <=20 lbs.

My first thought was this but it didn't work:

$configuration = Configuration::getMultiple(array('PS_SHIPPING_FREE_PRICE', 'PS_SHIPPING_HANDLING', 
                                                 'PS_SHIPPING_METHOD', 'PS_SHIPPING_FREE_WEIGHT'));
// Free fees
if (isset($configuration['PS_SHIPPING_FREE_PRICE']) 
   AND $orderTotal >= floatval($configuration['PS_SHIPPING_FREE_PRICE']) 
   AND floatval($configuration['PS_SHIPPING_FREE_PRICE']) > 0)
   AND (isset($configuration['PS_SHIPPING_FREE_WEIGHT']) 
   AND $this->getTotalWeight() <= floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) 
   AND floatval($configuration['PS_SHIPPING_FREE_WEIGHT']) > 0)
 return $shipping_cost;



Isn't it kind of idiotic to offer free shipping to where the total weight is GREATER than xxxx lbs?
I thought shipping was based on weight?

I would think that the free shipping that is based on weight should be calculated on if the total
was LESS than xxxx lbs.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More