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


PHP zen_get_products_quantity_min_units_display函数代码示例

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


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

示例1: zen_href_link

                 $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
             } else {
                 $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
             }
         } else {
             // qty box with add to cart button
             if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
                 $lc_button = zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($listing->fields['products_id']) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
             } else {
                 $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
             }
         }
     }
     $the_button = $lc_button;
     $products_link = '<span class="more-info"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a></span>';
     $lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
     $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_quantity'];
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_weight'];
     break;
 case 'PRODUCT_LIST_IMAGE':
     $lc_align = 'center';
     if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
         $lc_text = '';
     } else {
开发者ID:dalinhuang,项目名称:kakayaga,代码行数:31,代码来源:product_listing.php

示例2: zen_href_link

     } else {
         if (PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_all->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = '<span>' . TEXT_PRODUCT_ALL_LISTING_MULTIPLE_ADD_TO_CART . "</span><input class='input-text' type=\"text\" name=\"products_id[" . $products_all->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_ALL_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_all->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
         }
     }
     $the_button = $link;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
 } else {
     $link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $the_button = $link;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_all->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_all->fields['master_categories_id']) . '&products_id=' . $products_all->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($products_all->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($products_all->fields['products_id']) . str_repeat('', substr(PRODUCT_ALL_BUY_NOW, 3, 1));
 }
 if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {
     $disp_text = zen_get_products_description($products_all->fields['products_id']);
     $disp_text = zen_clean_html($disp_text);
     $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_ALL_LIST_DESCRIPTION));
 } else {
     $display_products_description = '';
 }
 $get_discount_prod = mb_discount_product($products_all->fields['products_id']);
 if (mb_featured_product($products_all->fields['products_id']) == 1) {
     $ribbon = "<div class='tag tag-orange' title=''><div class='text'>HOT</div></div>";
 } else {
     if (mb_special_product($products_all->fields['products_id']) == 1) {
         $ribbon = "<div class='tag tag-orange' title=''><div class='text'>SALE</div></div>";
     } else {
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:tpl_modules_products_all_listing.php

示例3: zen_get_products_price_is_priced_by_attributes

        if ($_GET['products_filter'] != '') {
            ?>
          <tr>
            <td class="main" width="200" align="left" valign="top">&nbsp;</td>
            <td colspan="2" class="main"><?php 
            echo TEXT_PRODUCT_TO_VIEW;
            ?>
</td>
          </tr>
          <tr>
            <td class="main" width="200" align="center" valign="top">
<?php 
            $display_priced_by_attributes = zen_get_products_price_is_priced_by_attributes($_GET['products_filter']);
            echo $display_priced_by_attributes ? '<span class="alert">' . TEXT_PRICED_BY_ATTRIBUTES . '</span>' . '<br />' : '';
            echo zen_get_products_display_price($_GET['products_filter']) . '<br /><br />';
            echo zen_get_products_quantity_min_units_display($_GET['products_filter'], $include_break = true);
            ?>
            </td>
            <td class="attributes-even" align="center"><?php 
            echo zen_draw_products_pull_down('products_filter', 'size="10"', '', true, $_GET['products_filter'], true, true);
            ?>
</td>
            <td class="main" align="right" valign="top"><?php 
            echo zen_image_submit('button_display.gif', IMAGE_DISPLAY);
            ?>
</td>
          </tr>
        </table></td>
      </form></tr>

<?php 
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:attributes_controller.php

示例4: zen_href_link

</h1></td>
    <td align="center" valign="top" class="smallText">
      <?php 
if (zen_not_null($products_image)) {
    require DIR_FS_PAGES . $current_page_base . '/main_template_vars_images.php';
}
// more info in place of buy now
if (zen_has_product_attributes($review->fields['products_id'])) {
    //   $link = '<p>' . '<a href="' . zen_href_link(zen_get_info_page($review->fields['products_id']), 'products_id=' . $review->fields['products_id'] ) . '">' . MORE_INFO_TEXT . '</a>' . '</p>';
    $link = '';
} else {
    $link = '<br /><br />' . '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now') . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
}
$the_button = $link;
$products_link = '<br />';
echo zen_get_buy_now_button($review->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($review->fields['products_id']);
?>
    </td>
  </tr>
<?php 
$review_status = " and r.`status` = '1'";
$reviews_query_raw = "select r.`reviews_id`, rd.reviews_text,\n                               r.reviews_rating, r.`date_added`, r.customers_name\n                        from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd\n                        where r.`products_id` = '" . (int) $_GET['products_id'] . "'\n                        and r.`reviews_id` = rd.`reviews_id`\n                        and rd.`languages_id` = '" . (int) $_SESSION['languages_id'] . "'" . $review_status . "\n                        order by r.`reviews_id` desc";
$reviews_split = new splitPageResults($reviews_query_raw, MAX_DISPLAY_NEW_REVIEWS);
if ($reviews_split->number_of_rows > 0) {
    if (PREV_NEXT_BAR_LOCATION == '1' || PREV_NEXT_BAR_LOCATION == '3') {
        ?>
  <tr>
    <td class="pagination"><?php 
        echo $reviews_split->display_count(TEXT_DISPLAY_NUMBER_OF_REVIEWS);
        ?>
</td>
开发者ID:bitweaver,项目名称:commerce,代码行数:31,代码来源:product_reviews.php

示例5: add_to_cart

    public static function add_to_cart()
    {
        global $flag_show_product_info_in_cart_qty, $products_qty_box_status;
        global $products_quantity_order_max, $_GET, $display_qty;
        $button = '';
        $show_qty_in_cart = $flag_show_product_info_in_cart_qty == 1 && $_SESSION['cart']->in_cart($_GET['products_id']);
        if ($show_qty_in_cart) {
            $cart_quantity = $_SESSION['cart']->get_quantity($_GET['products_id']);
            $button .= '<p class="text-center" id="in-cart-text"><small>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . $cart_quantity . '</small></p>';
        }
        $submit_button = '<button type="submit" class="btn btn-primary">' . BUTTON_IN_CART_ALT . '</button>';
        $hide_quantity_input = $products_qty_box_status == 0 || $products_quantity_order_max == 1;
        if ($hide_quantity_input) {
            // Default to a quantity of 1
            $button .= $submit_button . zen_draw_hidden_field('cart_quantity', 1) . zen_draw_hidden_field('products_id', (int) $_GET['products_id']);
        } else {
            $quantity = zen_get_buy_now_qty($_GET['products_id']);
            $min_quantity = zen_get_products_quantity_min_units_display((int) $_GET['products_id']);
            $hidden = zen_draw_hidden_field('products_id', (int) $_GET['products_id']);
            $button .= <<<HTML
<div class='input-group'>
  <input class='form-control' type='text' name='cart_quantity' value='{$quantity}'
         maxlength='6' size='3' />
  <span class='input-group-btn'>{$submit_button}</span>
</div> {$min_quantity} {$hidden}
HTML;
        }
        $display_button = zen_get_buy_now_button($_GET['products_id'], $button);
        $display_button = BootstrapUtils::clean_buy_now_button($display_button, '');
        if ($display_button != '' || $display_qty != '') {
            return "<div id='cart-add'>{$display_qty} {$display_button}</div>";
        }
    }
开发者ID:Southern-Exposure-Seed-Exchange,项目名称:Zencart-Bootstrap-Theme,代码行数:33,代码来源:tpl_product_info_display.php

示例6: zen_href_link

         //          $link= '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
         if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 && $products_new->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = TEXT_PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $products_new->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_PRODUCTS_NEW, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>&nbsp;';
         }
     }
     $the_button = $link;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1));
 } else {
     $link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $the_button = $link;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($products_new->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($products_new->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_NEW_BUY_NOW, 3, 1));
 }
 if (PRODUCT_NEW_LIST_DESCRIPTION > '0') {
     $disp_text = zen_get_products_description($products_new->fields['products_id']);
     $disp_text = zen_clean_html($disp_text);
     $display_products_description = stripslashes(zen_trunc_string($disp_text, PRODUCT_NEW_LIST_DESCRIPTION, '<a href="' . zen_href_link(zen_get_info_page($products_new->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($products_new->fields['master_categories_id']) . '&products_id=' . $products_new->fields['products_id']) . '"> ' . MORE_INFO_TEXT . '</a>'));
 } else {
     $display_products_description = '';
 }
 ?>
   <ul class="list_product clear">
     <li class="relative"><?php 
 echo $display_products_image;
 ?>
       
     </li>
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:tpl_modules_products_new_listing.php

示例7: zen_draw_form

                 $lc_button = zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($listing->fields['products_id']) . '" maxlength="6" size="4" class="addtocart input-text" />&nbsp;&nbsp;' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<button class="button btn_addtocart">' . BUTTON_ADD_TO_CART . '</button>' . '</form>';
                 $lst_lc_button = zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($listing->fields['products_id']) . '" maxlength="6" size="4" class="addtocart input-text" />&nbsp;&nbsp;' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . '<button class="button btn_addtocart">' . BUTTON_ADD_TO_CART . '</button>' . '</form>';
             } else {
                 $lc_button = '<a title="Add to Cart" class="add-to-cart product_cart_image" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '"><span class="icon-shopcart"></span></a>';
                 $lst_lc_button = '<a class="btn btn-primary btn-iconed" title="Add to Cart" href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '"><i class="icon-shopcart"></i><span>Add to Cart</span></a>';
             }
         }
     }
     $the_button = $lc_button;
     $lst_the_button = $lst_lc_button;
     $products_link = '<a class="link-learn" href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $product_link_only = zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : $_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id'])) . '&products_id=' . $listing->fields['products_id']);
     $min_quantity = '<div class="product-minquantity">' . zen_get_products_quantity_min_units_display($listing->fields['products_id']) . '</div>';
     $freeshipping = '<div class="product-freeship">' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON : '' : '');
     $lst_lc_text .= '';
     $min_quantity = '<div class="product-minquantity">' . zen_get_products_quantity_min_units_display($listing->fields['products_id']) . '</div>';
     $freeshipping = '<div class="product-freeship">' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON : '' : '');
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     if ($listing->fields['products_quantity'] != '') {
         $trg_extra_val .= '<div class="product-qty">' . TABLE_HEADING_QUANTITY . ' : ' . $listing->fields['products_quantity'] . "</div>";
     }
     //$lst_lc_text = '<div class="product-qty">'.$listing->fields['products_quantity']."</div>";
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     if ($listing->fields['products_weight'] != '') {
         $trg_extra_val .= '<div class="product-weight">' . TABLE_HEADING_WEIGHT . ' : ' . $listing->fields['products_weight'] . '</div>';
     }
     //$lst_lc_text = '<div class="product-weight">'.$listing->fields['products_weight'].'</div>';
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:product_listing.php

示例8: zen_draw_hidden_field

<!--bof Add to Cart Box -->
<?php 
if (CUSTOMERS_APPROVAL == 3 and TEXT_LOGIN_FOR_PRICE_BUTTON_REPLACE_SHOWROOM == '') {
    // do nothing
} else {
    ?>
            <?php 
    $display_qty = ($flag_show_product_info_in_cart_qty == 1 and $_SESSION['cart']->in_cart($_GET['products_id'])) ? '<dt>' . PRODUCTS_ORDER_QTY_TEXT_IN_CART . '</dt><dd>' . $_SESSION['cart']->get_quantity($_GET['products_id']) . '</dd>' : '';
    if ($products_qty_box_status == 0 or $products_quantity_order_max == 1) {
        // hide the quantity box and default to 1
        $the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int) $_GET['products_id']);
    } else {
        // show the quantity box
        $the_button = '';
        $the_button .= '<dt>' . PRODUCTS_ORDER_QTY . '</dt>' . "\n";
        $the_button .= '<dd><input type="text" name="cart_quantity" value="' . zen_get_buy_now_qty($_GET['products_id']) . '" maxlength="6" size="4" />' . PRODUCTS_ORDER_QTY_TEXT . '<br />' . zen_get_products_quantity_min_units_display((int) $_GET['products_id']) . '' . zen_draw_hidden_field('products_id', (int) $_GET['products_id']) . '</dd>' . "\n" . '</dl>' . "\n";
    }
    $in_cart_button_html = '<div class="cartAdd">' . '<div class="price">' . ((zen_has_product_attributes_values((int) $_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int) $_GET['products_id']) . '</div>' . "\n" . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT, 'class="imgover"') . '</div>';
    $the_button .= $in_cart_button_html;
    $display_button = ($advanced_stock_button = zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_buy_now_button', array($_GET['products_id'], $the_button))) != '' ? $advanced_stock_button : zen_get_buy_now_button($_GET['products_id'], $the_button);
    ?>

<?php 
    if ($display_qty != '' or $display_button != '') {
        echo $display_qty;
        echo $display_button;
    }
    // display qty and button
}
// CUSTOMERS_APPROVAL == 3
?>
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:31,代码来源:tpl_product_info_display.php

示例9: verifyCheckout

 function verifyCheckout()
 {
     global $gCommerceSystem;
     foreach ($this->contents as $productsKey => $productsHash) {
         $product = $this->getProductObject($productsKey);
         $check_quantity = $productsHash['products_quantity'];
         $check_quantity_min = $product->getField('products_quantity_order_min');
         // Check quantity min
         if ($new_check_quantity = $this->in_cart_mixed($productsKey)) {
             $check_quantity = $new_check_quantity;
         }
         $fix_once = 0;
         if ($check_quantity < $check_quantity_min) {
             $fix_once++;
             $this->mErrors['checkout'][$productsKey] = tra('Product: ') . $product->getTitle() . tra(' ... Quantity Units errors - ') . tra('You ordered a total of: ') . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display(zen_get_prid($productsKey), false, true) . '</span> ';
         }
         // Check Quantity Units if not already an error on Quantity Minimum
         if ($fix_once == 0) {
             $check_units = $product->getField('products_quantity_order_units');
             if (fmod($check_quantity, $check_units) != 0) {
                 $this->mErrors['checkout'][$productsKey] = tra('Product: ') . $product->getTitle() . tra(' ... Quantity Units errors - ') . tra('You ordered a total of: ') . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display(zen_get_prid($productsKey), false, true) . '</span> ';
             }
         }
         // Check if the required stock is available. If insufficent stock is available return an out of stock message
         if ($gCommerceSystem->getConfig('STOCK_CHECK') && !$gCommerceSystem->getConfig('STOCK_ALLOW_CHECKOUT')) {
             foreach ($this->contents as $productsKey => $productsHash) {
                 $product = $this->getProductObject($productsKey);
                 if (!$product->getField('products_quantity') && !$product->getField('products_virtual')) {
                     if ($gCommerceSystem->getConfig('STOCK_ALLOW_CHECKOUT')) {
                         $this->mErrors['checkout'][$productsKey] = tra('Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' are out of stock.<br />Items not in stock will be placed on backorder.');
                     } else {
                         $this->mErrors['checkout'][$productsKey] = tra('Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' are out of stock or there are not enough in stock to fill your order.<br />Please change the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '). Thank you');
                     }
                 }
             }
         }
     }
     return empty($this->mErrors['checkout']);
 }
开发者ID:bitweaver,项目名称:commerce,代码行数:39,代码来源:CommerceShoppingCart.php

示例10: zen_href_link

     $lc_button = '';
     if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
         $lc_button = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
             if (zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N' && $listing->fields['product_is_call'] == 0 && ($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0)) {
                 $how_many++;
             }
             $lc_button = TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT) . '</a>';
         }
     }
     $the_button = $lc_button;
     $products_link = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $lc_text .= '<br />' . (($advanced_stock_button = zen_addOnModules_call_function('advanced_stock', 'advanced_stock_get_buy_now_button', array($listing->fields['products_id'], $the_button, $products_link))) != '' ? $advanced_stock_button : zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link)) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
     $lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_quantity'];
     break;
 case 'PRODUCT_LIST_WEIGHT':
     $lc_align = 'right';
     $lc_text = $listing->fields['products_weight'];
     break;
 case 'PRODUCT_LIST_IMAGE':
     $lc_align = 'center';
     if (isset($_GET['manufacturers_id'])) {
         $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'manufacturers_id=' . $_GET['manufacturers_id'] . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT) . '</a>';
     } else {
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:31,代码来源:product_listing.php

示例11: get_products

 /**
  * Method to return details of all products in the cart
  *
  * @param boolean whether to check if cart contents are valid
  * @return array
  */
 function get_products($check_for_valid_cart = false)
 {
     global $db;
     $this->notify('NOTIFIER_CART_GET_PRODUCTS_START');
     if (!is_array($this->contents)) {
         return false;
     }
     $products_array = array();
     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
         $products_query = "select p.products_id, p.master_categories_id, p.products_status, pd.products_name, p.products_model, p.products_image,\n                                  p.products_price,p.products_price_sample, p.products_weight, p.products_tax_class_id,\n                                  p.products_quantity_order_min, p.products_quantity_order_units,\n                                  p.product_is_free, p.products_priced_by_attribute,\n                                  p.products_discount_type, p.products_discount_type_from\n                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd\n                           where p.products_id = '" . (int) $products_id . "'\n                           and pd.products_id = p.products_id\n                           and pd.language_id = '" . (int) $_SESSION['languages_id'] . "'";
         if ($products = $db->Execute($products_query)) {
             $prid = $products->fields['products_id'];
             $products_price = $products->fields['products_price'] == 0 ? $products->fields['products_price_sample'] : $products->fields['products_price'];
             //fix here
             /*
             $special_price = zen_get_products_special_price($prid);
             if ($special_price) {
             $products_price = $special_price;
             }
             */
             $special_price = zen_get_products_special_price($prid);
             if ($special_price and $products->fields['products_priced_by_attribute'] == 0) {
                 $products_price = $special_price;
             } else {
                 $special_price = 0;
             }
             if (zen_get_products_price_is_free($products->fields['products_id'])) {
                 // no charge
                 $products_price = 0;
             }
             // adjust price for discounts when priced by attribute
             if ($products->fields['products_priced_by_attribute'] == '1' and zen_has_product_attributes($products->fields['products_id'], 'false')) {
                 // reset for priced by attributes
                 //            $products_price = $products->fields['products_price'];
                 if ($special_price) {
                     $products_price = $special_price;
                 } else {
                     $products_price = $products->fields['products_price'];
                 }
             } else {
                 // discount qty pricing
                 $categories_query = $db->Execute("SELECT categories_discount_type FROM " . TABLE_CATEGORIES . " WHERE categories_id = " . zen_get_products_category_id($products_id));
                 if ($products->fields['products_discount_type'] != 0 || $categories_query->fields['categories_discount_type'] != 0) {
                     $products_price = zen_get_products_discount_price_qty($products->fields['products_id'], $this->contents[$products_id]['qty']);
                 }
             }
             // validate cart contents for checkout
             if ($check_for_valid_cart == true) {
                 $fix_once = 0;
                 // Check products_status if not already
                 $check_status = $products->fields['products_status'];
                 if ($check_status == 0) {
                     $fix_once++;
                     $_SESSION['valid_to_checkout'] = false;
                     $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_STATUS_SHOPPING_CART . '<br />';
                     $this->remove($products_id);
                 }
                 // check only if valid products_status
                 if ($fix_once == 0) {
                     $check_quantity = $this->contents[$products_id]['qty'];
                     $check_quantity_min = $products->fields['products_quantity_order_min'];
                     // Check quantity min
                     if ($new_check_quantity = $this->in_cart_mixed($prid)) {
                         $check_quantity = $new_check_quantity;
                     }
                 }
                 if ($fix_once == 0) {
                     if ($check_quantity < $check_quantity_min) {
                         $fix_once++;
                         $_SESSION['valid_to_checkout'] = false;
                         $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_MIN_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int) $prid, false, true) . '</span> ' . '<br />';
                     }
                 }
                 // Check Quantity Units if not already an error on Quantity Minimum
                 if ($fix_once == 0) {
                     $check_units = $products->fields['products_quantity_order_units'];
                     if (fmod_round($check_quantity, $check_units) != 0) {
                         $_SESSION['valid_to_checkout'] = false;
                         $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int) $prid, false, true) . '</span> ' . '<br />';
                     }
                 }
                 // Verify Valid Attributes
             }
             //clr 030714 update $products_array to include attribute value_text. This is needed for text attributes.
             // convert quantity to proper decimals
             if (QUANTITY_DECIMALS != 0) {
                 //          $new_qty = round($new_qty, QUANTITY_DECIMALS);
                 $fix_qty = $this->contents[$products_id]['qty'];
                 switch (true) {
                     case !strstr($fix_qty, '.'):
                         $new_qty = $fix_qty;
                         break;
                     default:
//.........这里部分代码省略.........
开发者ID:happyxlq,项目名称:lt_svn,代码行数:101,代码来源:shopping_cart.php

示例12: zproduct_add_btn

function zproduct_add_btn($a1, $a2)
{
    echo zen_get_products_quantity_min_units_display((int) $_GET['products_id']) . zen_draw_hidden_field('products_id', (int) $_GET['products_id']) . zen_image_submit($a1, $a2);
}
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:4,代码来源:functions_manual.php

示例13: array

            }
        }
        $products_name .= '    </td>' . '  </tr>' . '</table>';
        $info_box_contents[$cur_row][] = array('params' => 'class="productListing-data"', 'text' => $products_name);
        $show_products_quantity_max = zen_get_products_quantity_order_max($products[$i]['id']);
        if ($show_products_quantity_max == 1 or zen_get_products_qty_box_status($products[$i]['id']) == 0) {
            if (SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) {
                $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="middle"', 'text' => $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1) . '<br />' . zen_get_products_quantity_min_units_display((int) $products[$i]['id']) . '<br />' . zen_image_submit(BUTTON_IMAGE_UPDATE_CART, BUTTON_UPDATE_CART_ALT));
            } else {
                $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="middle"', 'text' => $products[$i]['quantity'] . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . zen_draw_hidden_field('cart_quantity[]', 1) . '<br />' . zen_get_products_quantity_min_units_display((int) $products[$i]['id']));
            }
        } else {
            if (SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) {
                $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="middle"', 'text' => zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . '<br />' . zen_image_submit(BUTTON_IMAGE_UPDATE_CART, BUTTON_UPDATE_CART_ALT) . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . '<br />' . zen_get_products_quantity_min_units_display((int) $products[$i]['id']));
            } else {
                $info_box_contents[$cur_row][] = array('align' => 'center', 'params' => 'class="productListing-data" valign="middle"', 'text' => zen_draw_input_field('cart_quantity[]', $products[$i]['quantity'], 'size="4"') . zen_draw_hidden_field('products_id[]', $products[$i]['id']) . '<br />' . zen_get_products_quantity_min_units_display((int) $products[$i]['id']));
            }
        }
        $info_box_contents[$cur_row][] = array('align' => 'right', 'params' => 'class="productListing-data" valign="middle"', 'text' => '<span class="cartproductprice">' . $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) : '') . '</span>');
    }
    new productListingBox($info_box_contents);
    ?>
    </td>
  </tr>
  <tr>
    <td class="main" colspan="3"><?php 
    echo zen_draw_separator(DIR_WS_TEMPLATE_IMAGES . OTHER_IMAGE_SILVER_SEPARATOR, '100%', '1');
    ?>
</td>
  </tr>
  <tr>
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:tpl_shopping_cart_default.php

示例14: zen_get_buy_now_qty

?>
						</div>
					</dd>
					<dd class="product-quantity">
						<div class="form-inline">
							<div class="form-group">
								<label for="qty"><?php 
echo PRODUCTS_ORDER_QTY_TEXT;
?>
</label>
								<input  id="qty" class="form-control" type="text" name="cart_quantity" value="<?php 
echo zen_get_buy_now_qty($_GET['products_id']);
?>
" maxlength="12" size="5"/>
								<?php 
echo zen_get_products_quantity_min_units_display((int) $_GET['products_id']) . zen_draw_hidden_field('products_id', (int) $_GET['products_id']);
?>
								<input type="submit" name="add_to_cart" class="btn btn-danger" value="<?php 
echo BUTTON_IN_CART_ALT;
?>
"/>
							</div>
						</div>
						
						
					</dd>
				</dl>
			</div>
		</div>
	
	</div>
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:31,代码来源:tpl_product_info_display.php

示例15: get_products


//.........这里部分代码省略.........
             if ($check_for_valid_cart == true) {
                 $fix_once = 0;
                 // Check products_status if not already
                 $check_status = $products->fields['products_status'];
                 if ($check_status == 0) {
                     $fix_once++;
                     $_SESSION['valid_to_checkout'] = false;
                     $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_STATUS_SHOPPING_CART . '<br />';
                     $this->remove($products_id);
                 } else {
                     if (isset($this->contents[$products_id]['attributes'])) {
                         reset($this->contents[$products_id]['attributes']);
                         $chkcount = 0;
                         while (list(, $value) = each($this->contents[$products_id]['attributes'])) {
                             $chkcount++;
                             $chk_attributes_exist_query = "select products_id\n                                          from " . TABLE_PRODUCTS_ATTRIBUTES . " pa\n                                          where pa.products_id = '" . (int) $products_id . "'\n                                          and pa.options_values_id = '" . (int) $value . "'";
                             $chk_attributes_exist = $db->Execute($chk_attributes_exist_query);
                             //echo 'what is it: ' . ' : ' . $products_id . ' - ' . $value . ' records: ' . $chk_attributes_exist->RecordCount() . ' vs ' . print_r($this->contents[$products_id]) . '<br>';
                             if ($chk_attributes_exist->EOF) {
                                 $fix_once++;
                                 $_SESSION['valid_to_checkout'] = false;
                                 $chk_product_attributes = $db->Execute("SELECT products_status FROM " . TABLE_PRODUCTS . " WHERE products_status = 1 and products_id = '" . $products->fields["products_id"] . "' limit 1");
                                 if (!$chk_product_attributes->EOF && $chk_product_attributes->fields['products_status'] == 1) {
                                     $chk_products_link = '<a href="' . zen_href_link(zen_get_info_page($products->fields["products_id"]), 'cPath=' . zen_get_generated_category_path_rev($products->fields["master_categories_id"]) . '&products_id=' . $products->fields["products_id"]) . '">' . $products->fields['products_name'] . '</a>';
                                 } else {
                                     $chk_products_link = $products->fields['products_name'];
                                 }
                                 $_SESSION['cart_errors'] .= ERROR_PRODUCT_ATTRIBUTES . $chk_products_link . ERROR_PRODUCT_STATUS_SHOPPING_CART_ATTRIBUTES . '<br />';
                                 $this->remove($products_id);
                                 break;
                             }
                         }
                     }
                 }
                 // check only if valid products_status
                 if ($fix_once == 0) {
                     $check_quantity = $this->contents[$products_id]['qty'];
                     $check_quantity_min = $products->fields['products_quantity_order_min'];
                     // Check quantity min
                     if ($new_check_quantity = $this->in_cart_mixed($prid)) {
                         $check_quantity = $new_check_quantity;
                     }
                 }
                 // Check Quantity Max if not already an error on Minimum
                 if ($fix_once == 0) {
                     if ($products->fields['products_quantity_order_max'] != 0 && $check_quantity > $products->fields['products_quantity_order_max']) {
                         $fix_once++;
                         $_SESSION['valid_to_checkout'] = false;
                         $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_MAX_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int) $prid, false, true) . '</span> ' . '<br />';
                     }
                 }
                 if ($fix_once == 0) {
                     if ($check_quantity < $check_quantity_min) {
                         $fix_once++;
                         $_SESSION['valid_to_checkout'] = false;
                         $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_MIN_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int) $prid, false, true) . '</span> ' . '<br />';
                     }
                 }
                 // Check Quantity Units if not already an error on Quantity Minimum
                 if ($fix_once == 0) {
                     $check_units = $products->fields['products_quantity_order_units'];
                     if (fmod_round($check_quantity, $check_units) != 0) {
                         $_SESSION['valid_to_checkout'] = false;
                         $_SESSION['cart_errors'] .= ERROR_PRODUCT . $products->fields['products_name'] . ERROR_PRODUCT_QUANTITY_UNITS_SHOPPING_CART . ERROR_PRODUCT_QUANTITY_ORDERED . $check_quantity . ' <span class="alertBlack">' . zen_get_products_quantity_min_units_display((int) $prid, false, true) . '</span> ' . '<br />';
                     }
                 }
                 // Verify Valid Attributes
             }
             //clr 030714 update $products_array to include attribute value_text. This is needed for text attributes.
             // convert quantity to proper decimals
             if (QUANTITY_DECIMALS != 0) {
                 //          $new_qty = round($new_qty, QUANTITY_DECIMALS);
                 $fix_qty = $this->contents[$products_id]['qty'];
                 switch (true) {
                     case !strstr($fix_qty, '.'):
                         $new_qty = $fix_qty;
                         break;
                     default:
                         $new_qty = preg_replace('/[0]+$/', '', $this->contents[$products_id]['qty']);
                         break;
                 }
             } else {
                 $new_qty = $this->contents[$products_id]['qty'];
             }
             $check_unit_decimals = zen_get_products_quantity_order_units((int) $products->fields['products_id']);
             if (strstr($check_unit_decimals, '.')) {
                 $new_qty = round($new_qty, QUANTITY_DECIMALS);
             } else {
                 $new_qty = round($new_qty, 0);
             }
             //@@TODO - should be okay to remove
             if (false && $new_qty == (int) $new_qty) {
                 $new_qty = (int) $new_qty;
             }
             $products_array[] = array('id' => $products_id, 'category' => $products->fields['master_categories_id'], 'name' => $products->fields['products_name'], 'model' => $products->fields['products_model'], 'image' => $products->fields['products_image'], 'price' => $products->fields['product_is_free'] == '1' ? 0 : $products_price, 'quantity' => $new_qty, 'weight' => $products->fields['products_weight'] + $this->attributes_weight($products_id), 'final_price' => $products_price + $this->attributes_price($products_id), 'onetime_charges' => $this->attributes_price_onetime_charges($products_id, $new_qty), 'tax_class_id' => $products->fields['products_tax_class_id'], 'attributes' => isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '', 'attributes_values' => isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : '', 'products_priced_by_attribute' => $products->fields['products_priced_by_attribute'], 'product_is_free' => $products->fields['product_is_free'], 'products_discount_type' => $products->fields['products_discount_type'], 'products_discount_type_from' => $products->fields['products_discount_type_from'], 'products_virtual' => $products->fields['products_virtual'], 'product_is_always_free_shipping' => $products->fields['product_is_always_free_shipping']);
         }
     }
     $this->notify('NOTIFIER_CART_GET_PRODUCTS_END', array(), $products_array);
     return $products_array;
 }
开发者ID:jeking928,项目名称:Dual-Pricing-2.1.6,代码行数:101,代码来源:shopping_cart.php


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