Hi all :)
On a site that I upgraded from 1.5.4 / PHP 5.6 to 1.5.5f / PHP 7 some codes stopped working
without any error.
Any old code I should change in the following code ?
Code:
if (!IS_ADMIN_FLAG) {
global $cart;
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('master_categories_id', '78');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('master_categories_id', '79');
$chk_products_in_cart += $_SESSION['cart']->in_cart_check('products_id', '340');
// do not deliver to cities 1001-1007
$chk_delivery_zone = $order->delivery['zone_id'];
$chk_states = '1001, 1002, 1003, 1004, 1005, 1006, 1007';
$arr1 = explode(", ", $chk_states);
$arr2 = explode(", ", $chk_delivery_zone);
$donotshow_state = array_intersect($arr1, $arr2);
if ((int)$donotshow_state && $chk_products_in_cart > 0) {
$this->enabled = false;
}
}
The code if for restricting some products to some cities.
Thanks
Bookmarks