当前位置: 首页>>代码示例>>PHP>>正文


PHP ps_product::product_order_levels方法代码示例

本文整理汇总了PHP中ps_product::product_order_levels方法的典型用法代码示例。如果您正苦于以下问题:PHP ps_product::product_order_levels方法的具体用法?PHP ps_product::product_order_levels怎么用?PHP ps_product::product_order_levels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ps_product的用法示例。


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

示例1: vmGet

    $price['product_price'] = vmGet($_REQUEST, 'product_price', '');
}
$quantity_start = 0;
$quantity_end = 0;
$quantity_step = 1;
if (!empty($product_id)) {
    // get the Database object we're filling the product form with
    $db = $ps_product->get($product_id);
    //get quantity options
    $quantity_options = ps_product::get_quantity_options($product_id);
    extract($quantity_options);
    //get list style
    $child_options = ps_product::get_child_options($product_id);
    extract($child_options);
    //Get min max order levels
    $order_levels = ps_product::product_order_levels($product_id);
    if ($order_levels) {
        $min_order = array_shift($order_levels);
        $max_order = array_shift($order_levels);
    }
    // Get category IDs
    $db2 = new ps_DB();
    $q = "SELECT category_id FROM #__{vm}_product_category_xref WHERE product_id='{$product_id}'";
    $db2->query($q);
    while ($db2->next_record()) {
        $my_categories[$db2->f("category_id")] = "1";
    }
    // Get the Manufacturer ID
    $db2->query("SELECT manufacturer_id FROM #__{vm}_product_mf_xref WHERE product_id='{$product_id}'");
    $db2->next_record();
    $manufacturer_id = $db2->f("manufacturer_id");
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:product.product_form.php

示例2: updateSaved

 /**
  * updates the quantity of a product_id in the cart
  * @author pablo
  * @param array $d
  * @return boolean result of the update
  */
 function updateSaved(&$d)
 {
     global $VM_LANG, $vmLogger, $page;
     $d = $GLOBALS['vmInputFilter']->process($d);
     include_class("product");
     $db = new ps_DB();
     $product_id = $d["prod_id"];
     $quantity = isset($d["quantity"]) ? (int) $d["quantity"] : 1;
     $_SESSION['last_page'] = "shop.savedcart";
     // Check for negative quantity
     if ($quantity < 0) {
         $vmLogger->warning($VM_LANG->_('PHPSHOP_CART_ERROR_NO_NEGATIVE', false));
         return False;
     }
     if (!is_numeric($quantity)) {
         $vmLogger->warning($VM_LANG->_('PHPSHOP_CART_ERROR_NO_VALID_QUANTITY', false));
         return False;
     }
     if (!$product_id) {
         return false;
     }
     if ($quantity == 0) {
         $deleted_prod = $this->deleteSaved($d);
     } else {
         for ($i = 0; $i < $_SESSION['savedcart']["idx"]; $i++) {
             // modified for the advanced attribute modification
             if ($_SESSION['savedcart'][$i]["product_id"] == $product_id && $_SESSION['savedcart'][$i]["description"] == $d["description"]) {
                 // Get min and max order levels
                 list($min, $max) = ps_product::product_order_levels($product_id);
                 if ($min != 0 && $quantity < $min) {
                     eval("\$msg = \"" . $VM_LANG->_('VM_CART_MIN_ORDER', false) . "\";");
                     $vmLogger->warning($msg);
                     return false;
                 }
                 if ($max != 0 && $quantity > $max) {
                     eval("\$msg = \"" . $VM_LANG->_('VM_CART_MAX_ORDER', false) . "\";");
                     $vmLogger->warning($msg);
                     return false;
                 }
                 // Check to see if checking stock quantity
                 if (CHECK_STOCK) {
                     $q = "SELECT product_in_stock ";
                     $q .= "FROM #__{vm}_product where product_id=";
                     $q .= $product_id;
                     $db->query($q);
                     $db->next_record();
                     $product_in_stock = $db->f("product_in_stock");
                     if (empty($product_in_stock)) {
                         $product_in_stock = 0;
                     }
                     if ($quantity > $product_in_stock) {
                         global $notify;
                         $_SESSION['notify'] = array();
                         $_SESSION['notify']['idx'] = 0;
                         $k = 0;
                         $notify = $_SESSION['notify'];
                         $_SESSION['notify'][$k]["prod_id"] = $product_id;
                         $_SESSION['notify'][$k]["quantity"] = $quantity;
                         $_SESSION['notify']['idx']++;
                         $page = 'shop.waiting_list';
                         return true;
                     }
                 }
                 $_SESSION['savedcart'][$i]["quantity"] = $quantity;
             }
         }
     }
     return true;
 }
开发者ID:rafarubert,项目名称:megafiltros,代码行数:75,代码来源:ps_cart.php


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