$attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]); $attr_value = $products[$i]['attributes_values'][$option]; } else { $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attr_value = $attributes_values->fields['products_options_values_name']; } $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name']; $attrArray[$option]['options_values_id'] = $value; $attrArray[$option]['products_options_values_name'] = zen_output_string_protected($attr_value); $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price']; $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix']; } } //end foreach [attributes] if (STOCK_CHECK == 'true') { $flagStockCheck = zen_check_stock($products[$i]['id'], $products[$i]['quantity']); if ($flagStockCheck == true) { $flagAnyOutOfStock = true; } } $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" onfocus="set_update_count(this);" onbeforepaste="clipboardData.setData(\'text\',clipboardData.getData(\'text\').replace(/[^\\d]/g,\'\'));update_count(this);" onkeyup="value=value.replace(/[^\\d]/g,\'\');update_count(this);" class="check_input_num" id="cart_quantity[]"'); $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);
} // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!$_SESSION['shipping']) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) { if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // Stock Check if (STOCK_CHECK == 'true' && STOCK_ALLOW_CHECKOUT != 'true') { $products = $_SESSION['cart']->get_products(); for ($i = 0, $n = sizeof($products); $i < $n; $i++) { if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); break; } } } // get coupon code if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\n FROM " . TABLE_COUPONS . "\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); } // if no billing destination address was selected, use the customers own address as default if (!$_SESSION['billto']) { $_SESSION['billto'] = $_SESSION['customer_default_address_id']; } else {
$messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error'); } if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } if ($messageStack->size('checkout_payment') > 0) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } //echo $messageStack->size('checkout_payment'); //die('here'); // Stock Check $flagAnyOutOfStock = false; $stock_check = array(); if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $flagAnyOutOfStock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $flagAnyOutOfStock == true) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } } // update customers_referral with $_SESSION['gv_id'] if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\n FROM " . TABLE_COUPONS . "\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); $customers_referral_query = "SELECT customers_referral\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_id = :customersID"; $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer');
public function prepareConfirmation() { global $messageStack, $template, $breadcrumb, $template_dir_select, $template_dir, $language_page_directory, $currencies, $order, $zco_notifier, $db, $current_page_base, $order_total_modules, $credit_covers; // error_reporting(E_ALL); // ini_set('display_errors', 'on'); $_GET['main_page'] = $current_page_base = $current_page = FILENAME_CHECKOUT_CONFIRMATION; if ($_SESSION['cart']->count_contents() <= 0) { zen_redirect(zen_href_link(FILENAME_TIME_OUT)); } if (!$_SESSION['customer_id']) { $_SESSION['navigation']->set_snapshot(array('mode' => 'SSL', 'page' => FILENAME_CHECKOUT_PAYMENT)); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } else { // validate customer if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); } } // avoid hack attempts during the checkout procedure by checking the internal cartID if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) { if ($_SESSION['cart']->cartID != $_SESSION['cartID']) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } } // if no shipping method has been selected, redirect the customer to the shipping method selection page if (!isset($_SESSION['shipping'])) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free' && $_SESSION['cart']->get_content_type() != 'virtual' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER') && $_SESSION['cart']->show_total() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); } if (isset($_POST['payment'])) { $_SESSION['payment'] = $_POST['payment']; } $_SESSION['comments'] = $_POST['comments']; if (DISPLAY_CONDITIONS_ON_CHECKOUT == 'true') { if (!isset($_POST['conditions']) || $_POST['conditions'] != '1') { $messageStack->add_session('checkout_payment', ERROR_CONDITIONS_NOT_ACCEPTED, 'error'); } } // echo $messageStack->size('checkout_payment'); // load the selected payment module require DIR_WS_CLASSES . 'payment.php'; $payment_modules = new payment($_POST['payment']); $payment_modules->update_status(); if (($_POST['payment'] == '' || !is_object($payment_modules->paymentClass)) && $credit_covers === FALSE) { $messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error'); } $GLOBALS[$_POST['payment']] = $payment_modules->paymentClass; require DIR_WS_CLASSES . 'order.php'; $order = new order(); // load the selected shipping module require DIR_WS_CLASSES . 'shipping.php'; $shipping_modules = new shipping($_SESSION['shipping']); require DIR_WS_CLASSES . 'order_total.php'; $order_total_modules = new order_total(); $order_total_modules->collect_posts(); $order_total_modules->pre_confirmation_check(); if (!isset($credit_covers)) { $credit_covers = FALSE; } // echo 'credit covers'.$credit_covers; if ($credit_covers) { unset($_SESSION['payment']); $_SESSION['payment'] = ''; } // @debug echo ($credit_covers == true) ? 'TRUE' : 'FALSE'; if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } if ($messageStack->size('checkout_payment') > 0) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } // Stock Check $flagAnyOutOfStock = false; $stock_check = array(); if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'])) { $flagAnyOutOfStock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $flagAnyOutOfStock == true) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } } // update customers_referral with $_SESSION['gv_id'] if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\n FROM " . TABLE_COUPONS . "\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); $customers_referral_query = "SELECT customers_referral\n FROM " . TABLE_CUSTOMERS . "\n WHERE customers_id = :customersID"; $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer'); $customers_referral = $db->Execute($customers_referral_query); // only use discount coupon if set by coupon if ($customers_referral->fields['customers_referral'] == '' and CUSTOMERS_REFERRAL_STATUS == 1) { $sql = "UPDATE " . TABLE_CUSTOMERS . "\n SET customers_referral = :customersReferral\n WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $sql = $db->bindVars($sql, ':customersReferral', $discount_coupon->fields['coupon_code'], 'string'); $db->Execute($sql); } else { // do not update referral was added before } } if (isset(${$_SESSION}['payment']->form_action_url)) { $form_action_url = ${$_SESSION}['payment']->form_action_url; } else { $form_action_url = zen_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } // if shipping-edit button should be overridden, do so $editShippingButtonLink = zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); if (method_exists(${$_SESSION}['payment'], 'alterShippingEditButton')) { $theLink = ${$_SESSION}['payment']->alterShippingEditButton(); if ($theLink) { $editShippingButtonLink = $theLink; } } // deal with billing address edit button $flagDisablePaymentAddressChange = false; if (isset(${$_SESSION}['payment']->flagDisablePaymentAddressChange)) { $flagDisablePaymentAddressChange = ${$_SESSION}['payment']->flagDisablePaymentAddressChange; } $current_page_base = FILENAME_CHECKOUT_CONFIRMATION; require_once DIR_WS_LANGUAGES . $_SESSION['language'] . '.php'; require_once DIR_WS_MODULES . zen_get_module_directory('require_languages.php'); require_once DIR_WS_MODULES . zen_get_module_directory('meta_tags.php'); $breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); $breadCrumbHtml = $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); $body_code = DIR_FS_CATALOG . $template->get_template_dir('tpl_ajax_checkout_confirmation_default.php', DIR_WS_TEMPLATE, $current_page_base, 'templates') . '/tpl_ajax_checkout_confirmation_default.php'; ob_start(); require_once $body_code; $confirmationHtml = ob_get_clean(); ob_flush(); return array('breadCrumbHtml' => $breadCrumbHtml, 'confirmationHtml' => $confirmationHtml, 'pageTitle' => META_TAG_TITLE); }
function _build_attributes_combinations($attributes, $showoos, $markoos, &$combinations, &$selected_combination, $oidindex = 0, $comb = array(), $id = "", $text = '', $isselected = true) { global $cart; foreach ($attributes[$oidindex]['ovals'] as $attrib) { $newcomb = $comb; $newcomb[$attributes[$oidindex]['oid']] = $attrib['id']; $newid = $id . ',' . $attributes[$oidindex]['oid'] . '-' . $attrib['id']; $newtext = $text . ", " . $attrib['text']; if (isset($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']])) { $newisselected = $cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']] == $attrib['id'] ? $isselected : false; } else { $newisselected = false; } if (isset($attributes[$oidindex + 1])) { $this->_build_attributes_combinations($attributes, $showoos, $markoos, $combinations, $selected_combination, $oidindex + 1, $newcomb, $newid, $newtext, $newisselected); } else { $is_out_of_stock = zen_check_stock(zen_get_prid($this->products_id), 1, $newcomb); if (!$is_out_of_stock | $showoos == true) { switch ($markoos) { case 'Left': $newtext = ($is_out_of_stock ? TEXT_OUT_OF_STOCK . ' - ' : '') . substr($newtext, 2); break; case 'Right': $newtext = substr($newtext, 2) . ($is_out_of_stock ? ' - ' . TEXT_OUT_OF_STOCK : ''); break; default: $newtext = substr($newtext, 2); break; } $combinations[] = array('comb' => $newcomb, 'id' => substr($newid, 1), 'text' => $newtext); if ($newisselected) { $selected_combination = sizeof($combinations) - 1; } } // EOF if !$is_out_of_stock etc... } // EOF Else } // EOF foreach }
foreach ($duplicatesCOMPARE as $dupCOMPARE) { foreach ($dupCOMPARE[1] as $dupC) { foreach ($products[$i]['attributes'] as $pAttr) { // echo 'dupC: ' . $dupC . ' ' . $dupCOMPARE[3] . '<br />'; // echo 'pAttr: ' . $pAttr . ' ' . $products[$i]['quantity'] . '<br />'; // echo 'Prod ID: ' . $products[$i]['id'] . ' ' . $dupCOMPARE[2] . '<br /><br />'; if ($pAttr === $dupC && $products[$i]['id'] != $dupCOMPARE[2]) { // echo 'Product: ' . $products[$i]['id'] . '<br />'; // echo 'Requested: ' . $products[$i]['quantity'] . '<br />'; // echo zen_get_products_stock($products[$i]['id'], $attributes, 'true') . ' TEST<br />'; if (zen_get_products_stock($products[$i]['id'], $attributes, 'true') != 'true') { $productsQty = $productsQty + $dupCOMPARE[3] + $products[$i]['quantity']; // echo 'Qty Requested: ' . $productsQty . '<br />'; // echo 'Available qty: ' . zen_get_products_stock($products[$i]['id'], $attributes) . '<br />'; // echo zen_get_products_stock($products[$i]['id'], $attributes, 'true'); $flagStockCheck = zen_check_stock($products[$i]['id'], $productsQty, $attributes); // echo 'Flag: ' . $flagStockCheck . '<br /><br /><br />'; break 3; //this will break three time, to move out of the three loops } // END if zen_get_products_stock != true } // END if compare } // END foreach $products[$i]['attributes'] } // END foreach dupCOMPARE[1] } // End foreach duplicatesCOMPARE } //End if CartProductCount > 1
$messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error'); } if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } if ($messageStack->size('checkout_payment') > 0) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } //echo $messageStack->size('checkout_payment'); //die('here'); // Stock Check $flagAnyOutOfStock = false; $stock_check = array(); if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $product_in_order[zen_get_prid($order->products[$i]['id'])])) { $flagAnyOutOfStock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $flagAnyOutOfStock == true) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } } // update customers_referral with $_SESSION['gv_id'] if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\r\n FROM " . TABLE_COUPONS . "\r\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); $customers_referral_query = "SELECT customers_referral\r\n FROM " . TABLE_CUSTOMERS . "\r\n WHERE customers_id = :customersID"; $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer');
} } // update customers_referral with $_SESSION['gv_id'] if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\r\n FROM " . TABLE_COUPONS . "\r\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); $customers_referral_query = "SELECT customers_referral \r\n FROM " . TABLE_CUSTOMERS . " \r\n WHERE customers_id = :customersID"; $customers_referral_query = $db->bindVars($customers_referral_query, ':customersID', $_SESSION['customer_id'], 'integer'); $customers_referral = $db->Execute($customers_referral_query); // only use discount coupon if set by coupon if ($customers_referral->fields['customers_referral'] == '' and CUSTOMERS_REFERRAL_STATUS == 1) { $sql = "UPDATE " . TABLE_CUSTOMERS . " \r\n SET customers_referral = :customersReferral \r\n WHERE customers_id = :customersID"; $sql = $db->bindVars($sql, ':customersID', $_SESSION['customer_id'], 'integer'); $sql = $db->bindVars($sql, ':customersReferral', $discount_coupon->fields['coupon_code'], 'string'); $db->Execute($sql); } else { // do not update referral was added before } } if (isset(${$_SESSION}['payment']->form_action_url)) { $form_action_url = ${$_SESSION}['payment']->form_action_url; } else { $form_action_url = zen_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); } $stock_check = STOCK_CHECK == 'true' ? zen_check_stock(stripslashes($order->products[$i]['id']), $order->products[$i]['qty']) : ''; require DIR_WS_MODULES . zen_get_module_directory('require_languages.php'); $breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')); $breadcrumb->add(NAVBAR_TITLE_2); // This should be last line of the script: $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_CONFIRMATION');
<tr> <td class="plainBoxHeading" colspan="2" ><?php echo HEADING_PRODUCTS; ?> </td> <td align="right"><?php echo '<a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?> </td> </tr> <?php } for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="main" valign="top">' . $order->products[$i]['name']; if (STOCK_CHECK == 'true') { echo zen_check_stock(stripslashes($order->products[$i]['id']), $order->products[$i]['qty']); } if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) { for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) { echo '<br /><nobr> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></nobr>'; } } echo ' </td>' . "\n"; if (sizeof($order->info['tax_groups']) > 1) { echo ' <td class="main" valign="top" align="right">' . zen_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n"; } echo ' <td class="main" align="right" valign="top">' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . ($order->products[$i]['onetime_charges'] != 0 ? '<br /> ' . $currencies->display_price($order->products[$i]['onetime_charges'], $order->products[$i]['tax'], 1) : '') . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table> </td>
$attr_value = htmlspecialchars($products[$i]['attributes_values'][$option], ENT_COMPAT, CHARSET, TRUE); } else { $attributeHiddenField .= zen_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attr_value = $attributes_values->fields['products_options_values_name']; } $attrArray[$option]['products_options_name'] = $attributes_values->fields['products_options_name']; $attrArray[$option]['options_values_id'] = $value; $attrArray[$option]['products_options_values_name'] = $attr_value; $attrArray[$option]['options_values_price'] = $attributes_values->fields['options_values_price']; $attrArray[$option]['price_prefix'] = $attributes_values->fields['price_prefix']; } } //end foreach [attributes] if (STOCK_CHECK == 'true') { $product_in_cart[zen_get_prid($products[$i]['id'])] += $products[$i]['quantity']; $flagStockCheck = zen_check_stock($products[$i]['id'], $product_in_cart[zen_get_prid($products[$i]['id'])]); if ($flagStockCheck == true) { $flagAnyOutOfStock = true; } } $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'];
$messageStack->add_session('checkout_payment', ERROR_NO_PAYMENT_MODULE_SELECTED, 'error'); } if (is_array($payment_modules->modules)) { $payment_modules->pre_confirmation_check(); } if ($messageStack->size('checkout_payment') > 0) { zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } //echo $messageStack->size('checkout_payment'); //die('here'); // Stock Check $flagAnyOutOfStock = false; $stock_check = array(); if (STOCK_CHECK == 'true') { for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) { if ($stock_check[$i] = zen_check_stock($order->products[$i]['id'], $order->products[$i]['qty'], $order->products[$i]['attributes'], 'order')) { //mc12345678 SBA 1.5.4 2015-10-09 $flagAnyOutOfStock = true; } } // Out of Stock if (STOCK_ALLOW_CHECKOUT != 'true' && $flagAnyOutOfStock == true) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } } // update customers_referral with $_SESSION['gv_id'] if ($_SESSION['cc_id']) { $discount_coupon_query = "SELECT coupon_code\r\r\n FROM " . TABLE_COUPONS . "\r\r\n WHERE coupon_id = :couponID"; $discount_coupon_query = $db->bindVars($discount_coupon_query, ':couponID', $_SESSION['cc_id'], 'integer'); $discount_coupon = $db->Execute($discount_coupon_query); $customers_referral_query = "SELECT customers_referral\r\r\n FROM " . TABLE_CUSTOMERS . "\r\r\n WHERE customers_id = :customersID";
$messageStack->add('header', ERROR_CART_UPDATE, 'error'); zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); } // Stock Check if (STOCK_CHECK == 'true' && STOCK_ALLOW_CHECKOUT != 'true') { $products = $_SESSION['cart']->get_products(); for ($i = 0, $n = sizeof($products); $i < $n; $i++) { // Added to allow individual stock of different attributes unset($attributes); if (is_array($products[$i]['attributes'])) { $attributes = $products[$i]['attributes']; } else { $attributes = ''; } // End change if (zen_check_stock($products[$i]['id'], $products[$i]['quantity'], $attributes)) { zen_redirect(zen_href_link(FILENAME_SHOPPING_CART)); break; } } } // register a random ID in the session to check throughout the checkout procedure // against alterations in the shopping cart contents $_SESSION['cartID'] = $_SESSION['cart']->cartID; // load all enabled shipping modules require DIR_WS_CLASSES . 'shipping.php'; $shipping_modules = new shipping(); // if no shipping destination address was selected, use the customers own address as default if (!$_SESSION['sendto']) { $_SESSION['sendto'] = $_SESSION['customer_default_address_id']; } else {