$customid = null; $tmpCheck = null; $attributes = null; if (STOCK_SBA_DISPLAY_CUSTOMID == 'true') { if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) { //create array for use in zen_get_customid for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) { $attributes[] = $order->products[$i]['attributes'][$j]['value_id']; //value_id option_id } $customid = '<br />('; //get custom ID for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) { if ($tmpCheck != $order->products[$i]['id']) { $tmpCheck = $order->products[$i]['id']; $customid .= zen_get_customid($order->products[$i]['id'], $attributes) . ', '; } } $customid = rtrim($customid, ', '); $customid .= ')'; } elseif (isset($order->products[$i]['model'])) { $customid = '<br />(' . $order->products[$i]['model'] . ')'; } } echo $customid; // END "Stock by Attributes" ?> <?php // if there are attributes, loop thru them and display one per line if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
} // End if/else mixed stock } // End flagStockCheck != true } //End of ZC Basic Function inside StockCheck == 'true' //Below seems appropriate for both ZC standard product as well as for SBA variants, therefore is outside the above "loop". // eof: extra check on stock for mixed YES if ($flagStockCheck == true) { $flagAnyOutOfStock = true; } } // End of STOCK_CHECK == 'true' //Set Custom ID variable. //Indepdendent of Stock_check. if (STOCK_SBA_DISPLAY_CUSTOMID == 'true') { $customid = zen_get_customid($products[$i]['id'], $attributes); } $linkProductsImage = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']); $linkProductsName = zen_href_link(zen_get_info_page($products[$i]['id']), 'products_id=' . $products[$i]['id']); $productsImage = IMAGE_SHOPPING_CART_STATUS == 1 ? zen_image(DIR_WS_IMAGES . $products[$i]['image'], $products[$i]['name'], IMAGE_SHOPPING_CART_WIDTH, IMAGE_SHOPPING_CART_HEIGHT) : ''; $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']); $showFixedQuantity = ($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) ? true : false; // $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1); // $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', 1); $showFixedQuantityAmount = $products[$i]['quantity'] . zen_draw_hidden_field('cart_quantity[]', $products[$i]['quantity']); $showMinUnits = zen_get_products_quantity_min_units_display($products[$i]['id']); $quantityField = zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"'); $ppe = $products[$i]['final_price']; $ppe = zen_round(zen_add_tax($ppe, zen_get_tax_rate($products[$i]['tax_class_id'])), $currencies->get_decimal_places($_SESSION['currency'])); $ppt = $ppe * $products[$i]['quantity']; $productsPriceEach = $currencies->format($ppe) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
function updateNotifyOrderProcessingStockDecrementInit(&$callingClass, $notifier, $paramsArray, &$productI, &$i) { $this->_i = $i; $this->_productI = $productI; $this->_orderIsSBA = zen_product_is_sba($this->_productI['id']); if ($this->_orderIsSBA) { // Only take SBA action on SBA tracked product mc12345678 12-18-2015 $this->_stock_info = zen_get_sba_stock_attribute_info(zen_get_prid($this->_productI['id']), $this->_productI['attributes'], 'order'); // Sorted comma separated list of the attribute_id. // START "Stock by Attributes" $attributeList = null; $customid = null; if (isset($this->_productI['attributes']) and sizeof($this->_productI['attributes']) > 0) { foreach ($this->_productI['attributes'] as $attributes) { $attributeList[] = $attributes['value_id']; } $customid = zen_get_customid($this->_productI['id'], $attributeList); // Expects that customid would be from a combination product, not individual attributes on a single product. Should return an array if the values are individual or a single value if all attributes equal a single product. $productI['customid'] = $customid; $this->_productI['customid'] = $customid; // $productI['model'] = (zen_not_null($customid) ? $customid : $productI['model']); $this->_productI['model'] = $productI['model']; } } // END "Stock by Attributes" }