Hi all, wonder if any of you can help. I'm not much a of a PHP person, and after battling with this for a few hours, i thought i'd ask on here.
HEre's the code..
Code: Select all
$products_list_id = $cart->get_product_id_list() ;
$products_list_id_array = array($products_list_id);
foreach($products_list_id_array as $pidvalue) {
$check_free_shipping_query = tep_db_query("select products_free_shipping from " . TABLE_PRODUCTS . " where products_id = '" . (int)$pidvalue . "'");
$check_free_shipping = tep_db_fetch_array($check_free_shipping_query);
$check_free_shipping_array[] = $check_free_shipping['products_free_shipping'];
}
if (in_array("1", $check_free_shipping_array) && !in_array("0", $check_free_shipping_array)) {
$free_shipping = true;
}The middle section gets the value of 'products_free_shipping' from db in relation to the product ID, and bungs the value in an array.
The bottom checks to see if certain requirements are met, and if so set free_shipping as true.
The problem is that the foreach only seems to be returning one value in the loop, then stopping. It doesnt go one to check the second one in the list.
What am i doing wrong?
pickle | Please use [ syntax=php ], [ syntax=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: