• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP zen_get_products_quantity_order_max函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中zen_get_products_quantity_order_max函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_products_quantity_order_max函数的具体用法?PHP zen_get_products_quantity_order_max怎么用?PHP zen_get_products_quantity_order_max使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了zen_get_products_quantity_order_max函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: zen_get_products_quantity_min_units_display

function zen_get_products_quantity_min_units_display($product_id, $include_break = true, $shopping_cart_msg = false)
{
    $check_min = zen_get_products_quantity_order_min($product_id);
    $check_units = zen_get_products_quantity_order_units($product_id);
    $the_min_units = '';
    if ($check_min != 1 or $check_units != 1) {
        if ($check_min != 1) {
            $the_min_units .= PRODUCTS_QUANTITY_MIN_TEXT_LISTING . ' ' . $check_min;
        }
        if ($check_units != 1) {
            $the_min_units .= ($the_min_units ? ' ' : '') . PRODUCTS_QUANTITY_UNIT_TEXT_LISTING . ' ' . $check_units;
        }
        if (($check_min > 0 or $check_units > 0) and !zen_get_products_quantity_mixed($product_id)) {
            if ($include_break == true) {
                $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
            } else {
                $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_OFF : TEXT_PRODUCTS_MIX_OFF_SHOPPING_CART);
            }
        } else {
            if ($include_break == true) {
                $the_min_units .= '<br />' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
            } else {
                $the_min_units .= '&nbsp;&nbsp;' . ($shopping_cart_msg == false ? TEXT_PRODUCTS_MIX_ON : TEXT_PRODUCTS_MIX_ON_SHOPPING_CART);
            }
        }
    }
    // quantity max
    $check_max = zen_get_products_quantity_order_max($product_id);
    if ($check_max != 0) {
        if ($include_break == true) {
            $the_min_units .= ($the_min_units != '' ? '<br />' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
        } else {
            $the_min_units .= ($the_min_units != '' ? '&nbsp;&nbsp;' : '') . PRODUCTS_QUANTITY_MAX_TEXT_LISTING . '&nbsp;' . $check_max;
        }
    }
    return $the_min_units;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:37,代码来源:functions_prices.php


示例2: zen_output_string_protected

            $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']);
    $productsPrice = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
    $productsPriceEach = $currencies->display_price($products[$i]['final_price'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) . ($products[$i]['onetime_charges'] != 0 ? '<br />' . $currencies->display_price($products[$i]['onetime_charges'], zen_get_tax_rate($products[$i]['tax_class_id']), 1) : '');
    $productArray[$i] = array('attributeHiddenField' => $attributeHiddenField, 'flagStockCheck' => $flagStockCheck, 'flagShowFixedQuantity' => $showFixedQuantity, 'linkProductsImage' => $linkProductsImage, 'linkProductsName' => $linkProductsName, 'productsImage' => $productsImage, 'productsName' => $productsName, 'showFixedQuantity' => $showFixedQuantity, 'showFixedQuantityAmount' => $showFixedQuantityAmount, 'showMinUnits' => $showMinUnits, 'quantityField' => $quantityField, 'buttonUpdate' => $buttonUpdate, 'productsPrice' => $productsPrice, 'productsPriceEach' => $productsPriceEach, 'rowClass' => $rowClass, 'buttonDelete' => $buttonDelete, 'checkBoxDelete' => $checkBoxDelete, 'id' => $products[$i]['id'], 'attributes' => $attrArray);
}
// end FOR loop
$flag_disable_footer = TRUE;
$flag_disable_header = TRUE;
// This should be last line of the script:
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:header_php.php


示例3: actionMultipleAddProduct

 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  * @todo change while loop to a foreach
  */
 function actionMultipleAddProduct($goto, $parameters)
 {
     global $messageStack;
     if ($this->display_debug_messages) {
         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__, 'caution');
     }
     $addCount = 0;
     if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
         //echo '<pre>'; echo var_dump($_POST['products_id']); echo '</pre>';
         while (list($key, $val) = each($_POST['products_id'])) {
             $prodId = preg_replace('/[^0-9a-f:.]/', '', $key);
             if (is_numeric($val) && $val > 0) {
                 $adjust_max = false;
                 $qty = $val;
                 $add_max = zen_get_products_quantity_order_max($prodId);
                 $cart_qty = $this->in_cart_mixed($prodId);
                 $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
                 // bof: adjust new quantity to be same as current in stock
                 $chk_current_qty = zen_get_products_stock($prodId);
                 if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty > $chk_current_qty) {
                     $new_qty = $chk_current_qty;
                     $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                 }
                 // eof: adjust new quantity to be same as current in stock
                 if ($add_max == 1 and $cart_qty == 1) {
                     // do not add
                     $adjust_max = 'true';
                 } else {
                     // bof: adjust new quantity to be same as current in stock
                     if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty + $cart_qty > $chk_current_qty) {
                         $adjust_new_qty = 'true';
                         $alter_qty = $chk_current_qty - $cart_qty;
                         $new_qty = $alter_qty > 0 ? $alter_qty : 0;
                         $messageStack->add_session('shopping_cart', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($prodId), 'caution');
                     }
                     // eof: adjust new quantity to be same as current in stock
                     // adjust quantity if needed
                     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                         $adjust_max = 'true';
                         $new_qty = $add_max - $cart_qty;
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
                     $addCount++;
                 }
                 if ($adjust_max == 'true') {
                     if ($this->display_debug_messages) {
                         $messageStack->add_session('header', 'FUNCTION ' . __FUNCTION__ . '<br>' . ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                     }
                     $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                 }
             }
             if (!is_numeric($val) || $val < 0) {
                 // adjust quantity when not a value
                 $chk_link = '<a href="' . zen_href_link(zen_get_info_page($prodId), 'cPath=' . zen_get_generated_category_path_rev(zen_get_products_category_id($prodId)) . '&products_id=' . $prodId) . '">' . zen_get_products_name($prodId) . '</a>';
                 $messageStack->add_session('header', ERROR_CORRECTIONS_HEADING . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . $chk_link . ' ' . PRODUCTS_ORDER_QTY_TEXT . zen_output_string_protected($val), 'caution');
                 $val = 0;
             }
         }
         // display message if all is good and not on shopping_cart page
         if ($addCount && DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART && $messageStack->size('shopping_cart') == 0) {
             $messageStack->add_session('header', ($this->display_debug_messages ? 'FUNCTION ' . __FUNCTION__ . ': ' : '') . SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
         } else {
             if (DISPLAY_CART == 'false') {
                 zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
             }
         }
         zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     }
 }
开发者ID:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:76,代码来源:shopping_cart.php


示例4: actionMultipleAddProduct

 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  * @todo change while loop to a foreach
  */
 public function actionMultipleAddProduct($goto, $parameters)
 {
     $addCount = 0;
     if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
         while (list($key, $val) = each($_POST['products_id'])) {
             if ($val > 0) {
                 $adjust_max = false;
                 $prodId = preg_replace('/[^0-9a-f:.]/', '', $key);
                 $qty = $val;
                 $add_max = zen_get_products_quantity_order_max($prodId);
                 $cart_qty = $this->in_cart_mixed($prodId);
                 $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
                 // ***************************************** *****************************************
                 /**
                  * Add Attributes listing to product listing page as per this thread:
                  * http://www.zen-cart.com/showthread.php?98641-drop-down-attributes-at-product-listing-page-near-add-to-cart-button&p=608469#post608469
                  */
                 if ($qty > 0) {
                     $match_product_quantity = $_POST['products_id'][$prodId];
                     if ($match_product_quantity > 0) {
                         $attributes = $_POST['id'][$prodId] ? $_POST['id'][$prodId] : '';
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty, $attributes);
                 }
                 // ***************************************** *****************************************
                 if ($add_max == 1 and $cart_qty == 1) {
                     // do not add
                     $adjust_max = 'true';
                 } else {
                     // adjust quantity if needed
                     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                         $adjust_max = 'true';
                         $new_qty = $add_max - $cart_qty;
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
                     $addCount++;
                 }
                 if ($adjust_max == 'true') {
                     $this->getMessageStack()->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                 }
             }
         }
         // display message if all is good and not on shopping_cart page
         if ($addCount && DISPLAY_CART == 'false' && $this->getMainPage() != 'shopping_cart') {
             $this->getMessageStack()->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
         }
         zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     }
 }
开发者ID:zenmagick,项目名称:zenmagick,代码行数:56,代码来源:ShoppingCart.php


示例5: verifyQuantity

 function verifyQuantity($pProductsKey, $pQty)
 {
     $pQty = (int) $pQty;
     // verify qty to add
     $add_max = zen_get_products_quantity_order_max($_REQUEST['products_id']);
     $cart_qty = $gBitCustomer->mCart->in_cart_mixed($_REQUEST['products_id']);
     $new_qty = zen_get_buy_now_qty($_REQUEST['products_id']);
     if ($add_max == 1 and $cart_qty == 1) {
         // do not add
         $new_qty = 0;
     } else {
         // adjust quantity if needed
         if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
             $new_qty = $add_max - $cart_qty;
         }
     }
     if (!empty($adjust_max) && $adjust_max == 'true') {
         $messageStack->add_session('header', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($prodId), 'caution');
     }
     if ($product = $this->getProductObject($pProductsKey)) {
         if (is_object($product) && $pQty > $product->getField('products_quantity_order_max')) {
             // we are trying to add quantity greater than max purchable quantity
             $pQty = $product->getField('products_quantity_order_max');
         }
     } else {
         // product couldn't load, delete from card
         $pQty = 0;
     }
     return $pQty;
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:30,代码来源:CommerceShoppingCart.php


示例6: actionMultipleAddProduct

 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  * @todo change while loop to a foreach
  */
 function actionMultipleAddProduct($goto, $parameters)
 {
     global $messageStack;
     $addCount = 0;
     if (is_array($_POST['products_id']) && sizeof($_POST['products_id']) > 0) {
         while (list($key, $val) = each($_POST['products_id'])) {
             if ($val > 0) {
                 $adjust_max = false;
                 $prodId = preg_replace('/[^0-9a-f:.]/', '', $key);
                 $qty = $val;
                 $add_max = zen_get_products_quantity_order_max($prodId);
                 $cart_qty = $this->in_cart_mixed($prodId);
                 //        $new_qty = $qty;
                 //echo 'I SEE actionMultipleAddProduct: ' . $prodId . '<br>';
                 $new_qty = $this->adjust_quantity($qty, $prodId, 'shopping_cart');
                 if ($add_max == 1 and $cart_qty == 1) {
                     // do not add
                     $adjust_max = 'true';
                 } else {
                     // adjust quantity if needed
                     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                         $adjust_max = 'true';
                         $new_qty = $add_max - $cart_qty;
                     }
                     $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
                     $addCount++;
                 }
                 if ($adjust_max == 'true') {
                     //            $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' C: - ' . zen_get_products_name($prodId), 'caution');
                     $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($prodId), 'caution');
                 }
             }
         }
         // display message if all is good and not on shopping_cart page
         if ($addCount && DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
             $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCTS, 'success');
         }
         zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     }
 }
开发者ID:dalinhuang,项目名称:yijinhuanxiang,代码行数:47,代码来源:shopping_cart.php


示例7: actionMultipleAddProduct

 /**
  * Method to handle cart Action - multiple add products
  *
  * @param string forward destination
  * @param url parameters
  */
 function actionMultipleAddProduct($goto, $parameters)
 {
     global $messageStack;
     while (list($key, $val) = each($_POST['products_id'])) {
         if ($val > 0) {
             $prodId = $key;
             $qty = $val;
             $add_max = zen_get_products_quantity_order_max($prodId);
             $cart_qty = $this->in_cart_mixed($prodId);
             $new_qty = $qty;
             if ($add_max == 1 and $cart_qty == 1) {
                 // do not add
                 $adjust_max = 'true';
             } else {
                 // adjust quantity if needed
                 if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                     $adjust_max = 'true';
                     $new_qty = $add_max - $cart_qty;
                 }
                 $this->add_cart($prodId, $this->get_quantity($prodId) + $new_qty);
             }
             if ($adjust_max == 'true') {
                 $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($prodId), 'caution');
             }
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
 }
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:34,代码来源:shopping_cart.php


示例8: zen_get_products_name

     if (STOCK_ALLOW_CHECKOUT == 'false' && $new_qty + $cart_qty > $chk_current_qty) {
         $adjust_new_qty = 'true';
         $alter_qty = $chk_current_qty - $cart_qty;
         $new_qty = $alter_qty > 0 ? $alter_qty : 0;
         if (!$_SESSION['cart']->flag_duplicate_msgs_set) {
             $messageStack->add_session('shopping_cart', ($_SESSION['cart']->display_debug_messages ? 'D: FUNCTION ' . __FUNCTION__ . ': ' : '') . WARNING_PRODUCT_QUANTITY_ADJUSTED . zen_get_products_name($_POST['products_id']), 'caution');
         }
     }
     // eof: adjust new quantity to be same as current in stock
     // adjust quantity if needed
     if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
         $adjust_max = 'true';
         $new_qty = $add_max - $cart_qty;
     }
 }
 if (zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $_SESSION['cart']->in_cart_mixed($_POST['products_id']) == 1) {
     // do not add
 } else {
     // process normally
     // bof: set error message
     if ($the_list != '') {
         $messageStack->add('product_info', ERROR_CORRECTIONS_HEADING . $the_list, 'caution');
     } else {
         // process normally
         // iii 030813 added: File uploading: save uploaded files with unique file names
         $real_ids = isset($_POST['id']) ? $_POST['id'] : "";
         if (isset($_GET['number_of_uploads']) && $_GET['number_of_uploads'] > 0) {
             /**
              * Need the upload class for attribute type that allows user uploads.
              *
              */
开发者ID:badarac,项目名称:stock_by_attribute_1.5.4,代码行数:31,代码来源:stock_by_attributes.php


示例9: actionAddProductAjaxAttributes

 function actionAddProductAjaxAttributes($goto, $parameters)
 {
     global $messageStack, $db;
     if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
         // verify attributes and quantity first
         $the_list = '';
         $adjust_max = 'false';
         if (isset($_POST['id'])) {
             foreach ($_POST['id'] as $key => $value) {
                 $check = zen_get_attributes_valid($_POST['products_id'], $key, $value);
                 if ($check == false) {
                     $the_list .= TEXT_ERROR_OPTION_FOR . '<span class="alertBlack">' . zen_options_name($key) . '</span>' . TEXT_INVALID_SELECTION . '<span class="alertBlack">' . (zen_values_name($value) == 'TEXT' ? TEXT_INVALID_USER_INPUT : zen_values_name($value)) . '</span>' . '<br />';
                 }
             }
         }
         // verify qty to add
         //          $real_ids = $_POST['id'];
         //die('I see Add to Cart: ' . $_POST['products_id'] . 'real id ' . zen_get_uprid($_POST['products_id'], $real_ids) . ' add qty: ' . $add_max . ' - cart qty: ' . $cart_qty . ' - newqty: ' . $new_qty);
         $add_max = zen_get_products_quantity_order_max($_POST['products_id']);
         $cart_qty = $this->in_cart_mixed($_POST['products_id']);
         $new_qty = $_POST['cart_quantity'];
         //echo 'I SEE actionAddProduct: ' . $_POST['products_id'] . '<br>';
         $new_qty = $this->adjust_quantity($new_qty, $_POST['products_id'], 'shopping_cart');
         if ($add_max == 1 and $cart_qty == 1) {
             // do not add
             $new_qty = 0;
             $adjust_max = 'true';
         } else {
             // adjust quantity if needed
             if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                 $adjust_max = 'true';
                 $new_qty = $add_max - $cart_qty;
             }
         }
         if (zen_get_products_quantity_order_max($_POST['products_id']) == 1 and $this->in_cart_mixed($_POST['products_id']) == 1) {
             // do not add
         } else {
             // process normally
             // bof: set error message
             if ($the_list != '') {
                 //          $messageStack->add('product_info', ERROR_CORRECTIONS_HEADING . $the_list, 'caution');
                 $error_message = ERROR_CORRECTIONS_HEADING;
                 //          $messageStack->add('header', 'REMOVE ME IN SHOPPING CART CLASS BEFORE RELEASE<br/><BR />' . ERROR_CORRECTIONS_HEADING . $the_list, 'error');
             } else {
                 // process normally
                 // iii 030813 added: File uploading: save uploaded files with unique file names
                 $real_ids = isset($_POST['id']) ? $_POST['id'] : "";
                 if (isset($_GET['number_of_uploads']) && $_GET['number_of_uploads'] > 0) {
                     /**
                      * Need the upload class for attribute type that allows user uploads.
                      *
                      */
                     include DIR_WS_CLASSES . 'upload.php';
                     for ($i = 1, $n = $_GET['number_of_uploads']; $i <= $n; $i++) {
                         if (zen_not_null($_FILES['id']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]]) and $_FILES['id']['tmp_name'][TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] != 'none') {
                             $products_options_file = new upload('id');
                             $products_options_file->set_destination(DIR_FS_UPLOADS);
                             $products_options_file->set_output_messages('session');
                             if ($products_options_file->parse(TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i])) {
                                 $products_image_extension = substr($products_options_file->filename, strrpos($products_options_file->filename, '.'));
                                 if ($_SESSION['customer_id']) {
                                     $db->Execute("insert into " . TABLE_FILES_UPLOADED . " (sesskey, customers_id, files_uploaded_name) values('" . zen_session_id() . "', '" . $_SESSION['customer_id'] . "', '" . zen_db_input($products_options_file->filename) . "')");
                                 } else {
                                     $db->Execute("insert into " . TABLE_FILES_UPLOADED . " (sesskey, files_uploaded_name) values('" . zen_session_id() . "', '" . zen_db_input($products_options_file->filename) . "')");
                                 }
                                 $insert_id = $db->Insert_ID();
                                 $real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] = $insert_id . ". " . $products_options_file->filename;
                                 $products_options_file->set_filename("{$insert_id}" . $products_image_extension);
                                 if (!$products_options_file->save()) {
                                     break;
                                 }
                             } else {
                                 break;
                             }
                         } else {
                             // No file uploaded -- use previous value
                             $real_ids[TEXT_PREFIX . $_POST[UPLOAD_PREFIX . $i]] = $_POST[TEXT_PREFIX . UPLOAD_PREFIX . $i];
                         }
                     }
                 }
                 $this->add_cart($_POST['products_id'], $this->get_quantity(zen_get_uprid($_POST['products_id'], $real_ids)) + $new_qty, $real_ids);
                 // iii 030813 end of changes.
             }
             // eof: set error message
         }
         // eof: quantity maximum = 1
         if ($adjust_max == 'true') {
             //        $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . ' B: - ' . zen_get_products_name($_POST['products_id']), 'caution');
             //        $messageStack->add_session('shopping_cart', ERROR_MAXIMUM_QTY . zen_get_products_name($_POST['products_id']), 'caution');
             $error_message = ERROR_MAXIMUM_QTY;
         }
     }
     if ($the_list == '') {
         // no errors
         // display message if all is good and not on shopping_cart page
         if (DISPLAY_CART == 'false' && $_GET['main_page'] != FILENAME_SHOPPING_CART) {
             $messageStack->add_session('header', SUCCESS_ADDED_TO_CART_PRODUCT, 'success');
             //$error_message = SUCCESS_ADDED_TO_CART_PRODUCT;
         }
         //      zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
//.........这里部分代码省略.........
开发者ID:quangn92,项目名称:visualyou,代码行数:101,代码来源:shopping_cart.php


示例10: zen_redirect

         default:
     }
     zen_redirect(zen_href_link(FILENAME_EDIT_ORDERS, zen_get_all_get_params(array('action')) . 'action=edit', 'NONSSL'));
     break;
 case 'add_prdct':
     if (!zen_not_null($step)) {
         $step = 1;
     }
     if (EO_DEBUG_ACTION_LEVEL > 0) {
         eo_log(PHP_EOL . '============================================================' . PHP_EOL . '= Adding a new product to the order (step ' . $step . ')' . PHP_EOL . '============================================================' . PHP_EOL . PHP_EOL);
     }
     if ($step == 5) {
         // Get Order Info
         $GLOBALS['order'] = eo_get_order_by_id($oID);
         // Check qty field
         $add_max = zen_get_products_quantity_order_max($add_product_products_id);
         if ($add_product_quantity > $add_max && $add_max != 0) {
             $add_product_quantity = $add_max;
             $messageStack->add_session(WARNING_ORDER_QTY_OVER_MAX, 'warning');
         }
         // Retrieve the information for the new product
         $new_product = eo_get_new_product($add_product_products_id, $add_product_quantity, zen_db_prepare_input($_POST['id']), isset($_POST['applyspecialstoprice']));
         // Add the product to the order
         if (EO_DEBUG_ACTION_LEVEL > 3) {
             eo_log('Product Being Added:' . PHP_EOL . var_export($new_product, true) . PHP_EOL);
         }
         eo_add_product_to_order($oID, $new_product);
         // Update Subtotal and Pricing
         eo_update_order_subtotal($oID, $new_product);
         // Save the changes
         eo_update_database_order_totals($oID);
开发者ID:bislewl,项目名称:super_edit_orders_with_ty,代码行数:31,代码来源:edit_orders.php


示例11: zen_redirect

                 // $add_qty = zen_get_buy_now_qty($_GET['products_id']);
                 //                                    $_SESSION['cart']->add_cart($_GET['products_id'], $_SESSION['cart']->get_quantity($_GET['products_id'])+$add_qty);
                 $_SESSION['cart']->add_cart($_GET['products_id'], $_SESSION['cart']->get_quantity($_GET['products_id']) + $new_qty);
             }
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     break;
     // multiple products
 // multiple products
 case 'multiple_products_add_product':
     while (list($key, $val) = each($_POST['products_id'])) {
         if ($val > 0) {
             $prodId = $key;
             $qty = $val;
             $add_max = zen_get_products_quantity_order_max($prodId);
             $cart_qty = $_SESSION['cart']->in_cart_mixed($prodId);
             $new_qty = $qty;
             if ($add_max == 1 and $cart_qty == 1) {
                 // do not add
                 $adjust_max = 'true';
             } else {
                 // adjust quantity if needed
                 if ($new_qty + $cart_qty > $add_max and $add_max != 0) {
                     $adjust_max = 'true';
                     $new_qty = $add_max - $cart_qty;
                 }
                 $_SESSION['cart']->add_cart($prodId, $_SESSION['cart']->get_quantity($prodId) + $new_qty);
             }
             if ($adjust_max == 'true') {
                 $messageStack->add_session('header', ERROR_MAXIMUM_QTY . ' - ' . zen_get_products_name($prodId), 'caution');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:application_top.php



注:本文中的zen_get_products_quantity_order_max函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap