rshary Posted January 12, 2010 Share Posted January 12, 2010 Right now my cart is applying the shipping cost based on the total of the products plus the tax. I would like it to base shipping on ONLY the base price total of the products, not including tax.For Example (what my cart currently does):Shipping Ranges --> ($5 - $10) = $2 shipping; ($10 - $15) = $4 shippingProduct 1 = $4.50Product 2 = $5.00Tax Total = $.74Total w/ tax = $10.24Shipping = $4What I'd LIKE my cart to do:Product 1 = $4.50Product 2 = $5.00Tax Total = $.74Total w/ tax = $10.24Shipping = $2As always... any help would be appreciated. Link to comment Share on other sites More sharing options...
rocky Posted January 13, 2010 Share Posted January 13, 2010 Try changing line 678-679 of classes/Cart.php from: // Order total without fees $orderTotal = $this->getOrderTotal(true, 7); to: // Order total without fees $orderTotal = $this->getOrderTotal(false, 7); Link to comment Share on other sites More sharing options...
rshary Posted January 13, 2010 Author Share Posted January 13, 2010 Thanks for your help. Unfortunately changing the 'true' to 'false' doesn't seem to change anything in my situation. Could the problem be due to the fact that it's not a tax for the specific carrier, but a tax that is applied only when shipping to a certain state?I was looking through the code at this section (starting at line 719 in my Cart.php): // Get shipping cost using correct method if ($carrier->range_behavior) { // Get id zone if (isset($this->id_address_delivery) AND $this->id_address_delivery) $id_zone = Address::getZoneById(intval($this->id_address_delivery)); else $id_zone = intval($defaultCountry->id_zone); if ((Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), $id_zone))) OR (!Configuration::get('PS_SHIPPING_METHOD') AND (!Carrier::checkDeliveryPriceByPrice($carrier->id, $this->getOrderTotal(true, 4), $id_zone)))) $shipping_cost += 0; else { if (intval($configuration['PS_SHIPPING_METHOD'])) $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone); else $shipping_cost += $carrier->getDeliveryPriceByPrice($orderTotal, $id_zone); } } else { if (intval($configuration['PS_SHIPPING_METHOD'])) $shipping_cost += $carrier->getDeliveryPriceByWeight($this->getTotalWeight(), $id_zone); else $shipping_cost += $carrier->getDeliveryPriceByPrice($orderTotal, $id_zone); } Do you think the problem could be in the getDeliveryPriceByPrice(); function? Link to comment Share on other sites More sharing options...
rocky Posted January 15, 2010 Share Posted January 15, 2010 This is harder to do than I thought it would be. It appears it is the Tax::getApplicableTax($id_tax, $productTax) function that adds the state tax to the order, then shipping is calculated based on the total order. I think you will need to call the function to get the tax and then subtract it from the order total after the line I mentioned above. Link to comment Share on other sites More sharing options...
rshary Posted January 15, 2010 Author Share Posted January 15, 2010 Wow... I'm feeling really dumb. I have 2 installations of Prestashop on my server in different directories. I was editing the Cart.php file in the wrong directory. Your first solution worked perfectly after I realized my error.I apologize sincerely for wasting your time Link to comment Share on other sites More sharing options...
manciuria Posted July 12, 2010 Share Posted July 12, 2010 I know that isn't a good habit to write on an hold post but I'd like to know how I can show Total of my order without taxes (and with) and because it seems that you've already know the function very well...Thank you! Link to comment Share on other sites More sharing options...
Eddie Morrison Posted October 6, 2011 Share Posted October 6, 2011 fixed for 1.4.3 // eddie modification free shipping not including tax. around line 1360 change: $total_free_ship = $free_ship - ($this->getOrderTotal(true, Cart::ONLY_PRODUCTS) + $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS)); for $total_free_ship = $free_ship - ($this->getOrderTotal(true, Cart::ONLY_PRODUCTS) + $this->getOrderTotal(true, Cart::ONLY_DISCOUNTS) - $total_tax); Link to comment Share on other sites More sharing options...
fgord Posted October 16, 2011 Share Posted October 16, 2011 Hi Eddie, I fixed it by changing line 991 like Rocky mentioned (with PS 1.4.3.). Link to comment Share on other sites More sharing options...
jadess Posted November 4, 2011 Share Posted November 4, 2011 I am having this problem right now.. Neither of the above mentioned solutions have worked... Are there any other suggestions? I have two items in my cart totaling $97. Tax is $8.49. Free shipping is set at $100. However, because of the tax,, the cart is showing shipping at $0. This fix does correctly get the order total without tax: $order_total = $this->getOrderTotal(false, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING); ... so something else is adding the state sales tax, but I can't figure out where. Link to comment Share on other sites More sharing options...
norseman Posted November 16, 2011 Share Posted November 16, 2011 Yep, me too, while the warning "Remaining amount to be added to your cart in order to obtain free shipping: "is calculated correctly now, the shipping amt STILL disappears when the products are calculated WITH tax to be greater than the free shipping amt... using 1.4.4.1 Link to comment Share on other sites More sharing options...
Kent88z Posted April 3, 2012 Share Posted April 3, 2012 I had the same issue with v.1.4.7 including tax in the free shipping calculation and it took me a while to find this thread in the forum. Boy why doesn't PS have a pre-configured US version so you don't have to tweak everything? Couldn't find the lines in cart.php mentioned by Rocky but did find the line mentioned by Eddie Morrison but in 1.4.7 its on line 1351. Made the change and so far it's working. Link to comment Share on other sites More sharing options...
Kent88z Posted April 3, 2012 Share Posted April 3, 2012 I spoke too soon. Still not working. Link to comment Share on other sites More sharing options...
kelvz Posted August 12, 2013 Share Posted August 12, 2013 On 1/13/2010 at 2:09 AM, rocky said: Try changing line 678-679 of classes/Cart.php from: // Order total without fees $orderTotal = $this->getOrderTotal(true, 7); to: // Order total without fees $orderTotal = $this->getOrderTotal(false, 7); Hi, I want to try this solution but i have no line "$orderTotal = $this->getOrderTotal(true, 7);" in my classes/Cart.php... my prestashop version is 1.4.8.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now