Osc- Modify Custom Array Check

Osc- Modify Custom Array Check
Existing working custom piece of code in /includes/modules/shipping/usps.php

Code retreives contents of shopping cart. If all products within shopping cart have field products_first_class_shipping = 1, then the shipping method of USPS First Class Mail is enabled. If any one product has products_first_class_shipping = 0, then First Class Shipping Method is disabled.

//*******************************************************************************
//BOF: First Class Mail Mod
$cart_prd_list = $cart->get_prd_id_list();
// check if the the flag is unset for any of the products
$chk_Q = tep_db_query(‘select count(products_id) as prd_count from ‘ . TABLE_PRODUCTS . ‘ where products_first_class_shipping = 0 and products_id in (‘ . $cart_prd_list .’)’ );
$chk_arr = tep_db_fetch_array($chk_Q);
if($chk_arr[‘prd_count’] == 0)
$this->_setFirstClassPossible(‘True’);
else
$this->_setFirstClassPossible(‘False’);
if ( tep_not_null($method)

Leave a Reply

Your email address will not be published. Required fields are marked *