Hello,
Under Prestashop 1.5.4, I have three carriers and FREE SHIPPING over $99. I need to disable two carriers and just enable one carrier, as I can't ship for free in express. So, I just edited the Cart.php with the following code (note that this only reflects one carrier):
// Free fees
$disable_freeshipping = array('7');
$free_fees_price = 0;
if (isset($configuration['PS_SHIPPING_FREE_PRICE']))
$free_fees_price = Tools::convertPrice((float)$configuration['PS_SHIPPING_FREE_PRICE'], Currency::getCurrencyInstance((int)$this->id_currency));
$orderTotalwithDiscounts = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, null, null, false);
if ($orderTotalwithDiscounts >= (float)($free_fees_price) && (float)($free_fees_price) > 0 && !in_array($id_carrier, $disable_freeshipping))
{
Cache::store($cache_id, $shipping_cost);
return $shipping_cost;
}
if (isset($configuration['PS_SHIPPING_FREE_WEIGHT'])
&& $this->getTotalWeight() >= (float)$configuration['PS_SHIPPING_FREE_WEIGHT']
&& (float)$configuration['PS_SHIPPING_FREE_WEIGHT'] > 0
&& !in_array($id_carrier, $disable_freeshipping))
{
Cache::store($cache_id, $shipping_cost);
return $shipping_cost;
}
However, it is messing everything up and now I got either a blank page or can't add any product to cart.
Could you help me figure out the right code under Prestashop 1.5.4 so that I can disable two carriers for free shipping?
Thank you in advance!