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

PHP zen_has_product_attributes函数代码示例

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

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



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

示例1: zen_get_products_quantity_mixed

function zen_get_products_quantity_mixed($product_id)
{
    global $db;
    // don't check for mixed if not attributes
    $chk_attrib = zen_has_product_attributes((int) $product_id);
    if ($chk_attrib == true) {
        $the_products_quantity_mixed = $db->Execute("select products_id, products_quantity_mixed from " . TABLE_PRODUCTS . " where products_id = '" . (int) $product_id . "'");
        if ($the_products_quantity_mixed->fields['products_quantity_mixed'] == '1') {
            $look_up = true;
        } else {
            $look_up = false;
        }
    } else {
        $look_up = 'none';
    }
    return $look_up;
}
开发者ID:zenmagick,项目名称:zencart,代码行数:17,代码来源:functions_prices.php


示例2: product_cart_button

 public static function product_cart_button($product, $product_link)
 {
     global $how_many;
     $has_attributes = zen_has_product_attributes($product->fields['products_id']);
     $hide_quantity = $product->fields['products_qty_box_status'] == 0;
     if ($has_attributes || PRODUCT_LIST_PRICE_BUY_NOW == '0') {
         $lc_button = "<a class='btn btn-default' href='{$product_link}'>" . MORE_INFO_TEXT . "</a>";
     } elseif (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
         $can_add_to_cart = zen_get_products_allow_add_to_cart($product->fields['products_id']) != 'N';
         $in_stock_or_ignore_stock = $product->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0;
         $not_call_for_price = $product->fields['product_is_call'] == 0;
         if (!$hide_quantity && $can_add_to_cart && $not_call_for_price && $in_stock_or_ignore_stock) {
             $how_many++;
         }
         if ($hide_quantity) {
             $buy_now_link = zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product->fields['products_id']);
             $buy_now_button = "<button class='btn btn-primary'>" . BUTTON_BUY_NOW_ALT . "</button>";
             $lc_button = "<a href='{$buy_now_link}'>{$buy_now_button}</a>";
         } else {
             $add_to_cart_button = '<span class="input-group-btn">' . '<button class="btn btn-primary" type="submit">Add</button></span>';
             $lc_button = "<div class='input-group'>" . "<input type='text' class='form-control' name='products_id[" . "{$product->fields['products_id']}]' value='1' size='4' />" . "{$add_to_cart_button}</div>";
         }
     } elseif (PRODUCT_LIST_PRICE_BUY_NOW == '2' && !$hide_quantity) {
         $action_link = zen_href_link(zen_get_info_page($product->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $product->fields['products_id']);
         $buy_now_qty = zen_get_buy_now_qty($product->fields['products_id']);
         $lc_button = zen_draw_form('cart_quantity', $action_link, 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . $buy_now_qty . '" ' . 'maxlength="6" size="4" />' . zen_draw_hidden_field('products_id', $product->fields['products_id']) . "<button class='btn btn-default' type='submit'>" . BUTTON_IN_CART_ALT . "</button></form>";
     } else {
         $action_link = zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $product->fields['products_id']);
         $buy_now_button = zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"');
         $lc_button = "<a class='btn btn-default' href='{$action_link}'>" . BUTTON_BUY_NOW_ALT . "</a>";
     }
     return $lc_button;
 }
开发者ID:Southern-Exposure-Seed-Exchange,项目名称:Zencart-Bootstrap-Theme,代码行数:33,代码来源:product_listing.php


示例3: zen_copy_products_attributes

function zen_copy_products_attributes($products_id_from, $products_id_to)
{
    global $db;
    global $messageStack;
    global $copy_attributes_delete_first, $copy_attributes_duplicates_skipped, $copy_attributes_duplicates_overwrite, $copy_attributes_include_downloads, $copy_attributes_include_filename;
    // Check for errors in copy request
    if (!zen_has_product_attributes($products_id_from, 'false') or !zen_products_id_valid($products_id_to) or $products_id_to == $products_id_from) {
        if ($products_id_to == $products_id_from) {
            // same products_id
            $messageStack->add_session('<b>WARNING: Cannot copy from Product ID #' . $products_id_from . ' to Product ID # ' . $products_id_to . ' ... No copy was made' . '</b>', 'caution');
        } else {
            if (!zen_has_product_attributes($products_id_from, 'false')) {
                // no attributes found to copy
                $messageStack->add_session('<b>WARNING: No Attributes to copy from Product ID #' . $products_id_from . ' for: ' . zen_get_products_name($products_id_from) . ' ... No copy was made' . '</b>', 'caution');
            } else {
                // invalid products_id
                $messageStack->add_session('<b>WARNING: There is no Product ID #' . $products_id_to . ' ... No copy was made' . '</b>', 'caution');
            }
        }
    } else {
        // FIX HERE - remove once working
        // check if product already has attributes
        $check_attributes = zen_has_product_attributes($products_id_to, 'false');
        if ($copy_attributes_delete_first == '1' and $check_attributes == true) {
            // die('DELETE FIRST - Copying from ' . $products_id_from . ' to ' . $products_id_to . ' Do I delete first? ' . $copy_attributes_delete_first);
            // delete all attributes first from products_id_to
            zen_products_attributes_download_delete($products_id_to);
            $db->Execute("delete from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int) $products_id_to . "'");
        }
        // get attributes to copy from
        $products_copy_from = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int) $products_id_from . "'" . " order by products_attributes_id");
        while (!$products_copy_from->EOF) {
            // This must match the structure of your products_attributes table
            $update_attribute = false;
            $add_attribute = true;
            $check_duplicate = $db->Execute("select * from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int) $products_id_to . "'" . " and options_id= '" . (int) $products_copy_from->fields['options_id'] . "' and options_values_id='" . (int) $products_copy_from->fields['options_values_id'] . "'");
            if ($check_attributes == true) {
                if ($check_duplicate->RecordCount() == 0) {
                    $update_attribute = false;
                    $add_attribute = true;
                } else {
                    if ($check_duplicate->RecordCount() == 0) {
                        $update_attribute = false;
                        $add_attribute = true;
                    } else {
                        $update_attribute = true;
                        $add_attribute = false;
                    }
                }
            } else {
                $update_attribute = false;
                $add_attribute = true;
            }
            // die('UPDATE/IGNORE - Checking Copying from ' . $products_id_from . ' to ' . $products_id_to . ' Do I delete first? ' . ($copy_attributes_delete_first == '1' ? TEXT_YES : TEXT_NO) . ' Do I add? ' . ($add_attribute == true ? TEXT_YES : TEXT_NO) . ' Do I Update? ' . ($update_attribute == true ? TEXT_YES : TEXT_NO) . ' Do I skip it? ' . ($copy_attributes_duplicates_skipped=='1' ? TEXT_YES : TEXT_NO) . ' Found attributes in From: ' . $check_duplicate->RecordCount());
            if ($copy_attributes_duplicates_skipped == '1' and $check_duplicate->RecordCount() != 0) {
                // skip it
                $messageStack->add_session(TEXT_ATTRIBUTE_COPY_SKIPPING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
            } else {
                if ($add_attribute == true) {
                    // New attribute - insert it
                    $db->Execute("insert into " . TABLE_PRODUCTS_ATTRIBUTES . " (products_attributes_id, products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_display_only, attributes_default, attributes_discounted, attributes_image, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, attributes_required) values (0, '" . (int) $products_id_to . "',\n          '" . $products_copy_from->fields['options_id'] . "',\n          '" . $products_copy_from->fields['options_values_id'] . "',\n          '" . $products_copy_from->fields['options_values_price'] . "',\n          '" . $products_copy_from->fields['price_prefix'] . "',\n          '" . $products_copy_from->fields['products_options_sort_order'] . "',\n          '" . $products_copy_from->fields['product_attribute_is_free'] . "',\n          '" . $products_copy_from->fields['products_attributes_weight'] . "',\n          '" . $products_copy_from->fields['products_attributes_weight_prefix'] . "',\n          '" . $products_copy_from->fields['attributes_display_only'] . "',\n          '" . $products_copy_from->fields['attributes_default'] . "',\n          '" . $products_copy_from->fields['attributes_discounted'] . "',\n          '" . $products_copy_from->fields['attributes_image'] . "',\n          '" . $products_copy_from->fields['attributes_price_base_included'] . "',\n          '" . $products_copy_from->fields['attributes_price_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_offset'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_factor_onetime_offset'] . "',\n          '" . $products_copy_from->fields['attributes_qty_prices'] . "',\n          '" . $products_copy_from->fields['attributes_qty_prices_onetime'] . "',\n          '" . $products_copy_from->fields['attributes_price_words'] . "',\n          '" . $products_copy_from->fields['attributes_price_words_free'] . "',\n          '" . $products_copy_from->fields['attributes_price_letters'] . "',\n          '" . $products_copy_from->fields['attributes_price_letters_free'] . "',\n          '" . $products_copy_from->fields['attributes_required'] . "')");
                    $messageStack->add_session(TEXT_ATTRIBUTE_COPY_INSERTING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
                }
                if ($update_attribute == true) {
                    // Update attribute - Just attribute settings not ids
                    $db->Execute("update " . TABLE_PRODUCTS_ATTRIBUTES . " set\n          options_values_price='" . $products_copy_from->fields['options_values_price'] . "',\n          price_prefix='" . $products_copy_from->fields['price_prefix'] . "',\n          products_options_sort_order='" . $products_copy_from->fields['products_options_sort_order'] . "',\n          product_attribute_is_free='" . $products_copy_from->fields['product_attribute_is_free'] . "',\n          products_attributes_weight='" . $products_copy_from->fields['products_attributes_weight'] . "',\n          products_attributes_weight_prefix='" . $products_copy_from->fields['products_attributes_weight_prefix'] . "',\n          attributes_display_only='" . $products_copy_from->fields['attributes_display_only'] . "',\n          attributes_default='" . $products_copy_from->fields['attributes_default'] . "',\n          attributes_discounted='" . $products_copy_from->fields['attributes_discounted'] . "',\n          attributes_image='" . $products_copy_from->fields['attributes_image'] . "',\n          attributes_price_base_included='" . $products_copy_from->fields['attributes_price_base_included'] . "',\n          attributes_price_onetime='" . $products_copy_from->fields['attributes_price_onetime'] . "',\n          attributes_price_factor='" . $products_copy_from->fields['attributes_price_factor'] . "',\n          attributes_price_factor_offset='" . $products_copy_from->fields['attributes_price_factor_offset'] . "',\n          attributes_price_factor_onetime='" . $products_copy_from->fields['attributes_price_factor_onetime'] . "',\n          attributes_price_factor_onetime_offset='" . $products_copy_from->fields['attributes_price_factor_onetime_offset'] . "',\n          attributes_qty_prices='" . $products_copy_from->fields['attributes_qty_prices'] . "',\n          attributes_qty_prices_onetime='" . $products_copy_from->fields['attributes_qty_prices_onetime'] . "',\n          attributes_price_words='" . $products_copy_from->fields['attributes_price_words'] . "',\n          attributes_price_words_free='" . $products_copy_from->fields['attributes_price_words_free'] . "',\n          attributes_price_letters='" . $products_copy_from->fields['attributes_price_letters'] . "',\n          attributes_price_letters_free='" . $products_copy_from->fields['attributes_price_letters_free'] . "',\n          attributes_required='" . $products_copy_from->fields['attributes_required'] . "'" . " where products_id='" . (int) $products_id_to . "'" . " and options_id= '" . $products_copy_from->fields['options_id'] . "' and options_values_id='" . $products_copy_from->fields['options_values_id'] . "'");
                    //           . " where products_id='" . $products_id_to . "'" . " and options_id= '" . $products_copy_from->fields['options_id'] . "' and options_values_id='" . $products_copy_from->fields['options_values_id'] . "' and attributes_image='" . $products_copy_from->fields['attributes_image'] . "' and attributes_price_base_included='" . $products_copy_from->fields['attributes_price_base_included'] .  "'");
                    $messageStack->add_session(TEXT_ATTRIBUTE_COPY_UPDATING . $products_copy_from->fields['products_attributes_id'] . ' for Products ID#' . $products_id_to, 'caution');
                }
            }
            $products_copy_from->MoveNext();
        }
        // end of products attributes while loop
        // reset products_price_sorter for searches etc.
        zen_update_products_price_sorter($products_id_to);
    }
    // end of no attributes or other errors
}
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:78,代码来源:general.php


示例4: array

     }
     $contents[] = array('align' => 'center', 'text' => '<br />' . zen_image_submit('button_copy.gif', IMAGE_COPY) . ' <a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
     // attribute features
 // attribute features
 case 'attribute_features':
     $copy_attributes_delete_first = '0';
     $copy_attributes_duplicates_skipped = '0';
     $copy_attributes_duplicates_overwrite = '0';
     $copy_attributes_include_downloads = '1';
     $copy_attributes_include_filename = '1';
     $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_ATTRIBUTE_FEATURES . $pInfo->products_id . '</b>');
     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . TEXT_PRODUCTS_ATTRIBUTES_INFO . '</strong>' . '<br />');
     $contents[] = array('align' => 'center', 'text' => '<br />' . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><br />' . (zen_has_product_attributes($pInfo->products_id, 'false') ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '</a>' . '&nbsp;&nbsp;' : '') . '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'products_filter=' . $pInfo->products_id . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_edit_attribs.gif', IMAGE_EDIT_ATTRIBUTES) . '</a>' . '<br /><br />');
     // only if attributes
     if (zen_has_product_attributes($pInfo->products_id, 'false')) {
         $contents[] = array('align' => 'left', 'text' => '<br />' . '<strong>' . TEXT_PRODUCT_ATTRIBUTES_DOWNLOADS . '</strong>' . zen_has_product_attributes_downloads($pInfo->products_id) . zen_has_product_attributes_downloads($pInfo->products_id, true));
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_DELETE . '<strong>' . zen_get_products_name($pInfo->products_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=delete_attributes' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_UPDATES . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=update_attributes_sort_order' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_PRODUCT . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_product' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
         $contents[] = array('align' => 'left', 'text' => '<br />' . TEXT_INFO_ATTRIBUTES_FEATURES_COPY_TO_CATEGORY . '<strong>' . zen_get_products_name($pInfo->products_id, $languages_id) . ' ID# ' . $pInfo->products_id . '</strong><br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . '&action=attribute_features_copy_to_category' . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . '&products_id=' . $pInfo->products_id) . '">' . zen_image_button('button_copy_to.gif', IMAGE_COPY_TO) . '</a>');
     }
     $contents[] = array('align' => 'center', 'text' => '<br /><a href="' . zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $pInfo->products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
     break;
     // attribute copier to product
 // attribute copier to product
 case 'attribute_features_copy_to_product':
     $_GET['products_update_id'] = '';
     // excluded current product from the pull down menu of products
     $products_exclude_array = array();
     $products_exclude_array[] = $pInfo->products_id;
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:categories.php


示例5: count

     if ($_SESSION['customer_id'] && isset($_GET['products_id'])) {
         $check_query = "select count(*) as count\r\n                                                from " . TABLE_PRODUCTS_NOTIFICATIONS . "\r\n                                                where products_id = '" . $_GET['products_id'] . "'\r\n                                                and customers_id = '" . $_SESSION['customer_id'] . "'";
         $check = $db->Execute($check_query);
         if ($check->fields['count'] > 0) {
             $sql = "delete from " . TABLE_PRODUCTS_NOTIFICATIONS . "\r\n                                          where products_id = '" . $_GET['products_id'] . "'\r\n                                          and customers_id = '" . $_SESSION['customer_id'] . "'";
             $db->Execute($sql);
         }
         zen_redirect(zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action', 'main_page'))));
     } else {
         $_SESSION['navigation']->set_snapshot();
         zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
     }
     break;
 case 'cust_order':
     if ($_SESSION['customer_id'] && isset($_GET['pid'])) {
         if (zen_has_product_attributes($_GET['pid'])) {
             zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid']));
         } else {
             $db->Execute("delete from " . TABLE_WISHLIST . " where products_id = '" . $_GET['pid'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'");
             $_SESSION['cart']->add_cart($_GET['pid'], $_SESSION['cart']->get_quantity($_GET['pid']) + 1);
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
     break;
     // Add product to the wishlist
 // Add product to the wishlist
 case 'add_wishlist':
     if (ereg('^[0-9]+$', $_POST['products_id'])) {
         if ($_POST['products_id']) {
             $db->Execute("delete from " . TABLE_WISHLIST . " where products_id = '" . $_GET['products_id'] . "' and customers_id = '" . $_SESSION['customer_id'] . "'");
             $db->Execute("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $_SESSION['customer_id'] . "', '" . $_POST['products_id'] . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )");
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:application_top.php


示例6: zen_href_link

          <tr>
            <td class="smallText" align="center"><?php 
        echo '<a href="' . zen_href_link(FILENAME_CATEGORIES, 'action=new_product' . '&cPath=' . zen_get_product_path($products_filter) . '&pID=' . $products_filter . '&product_type=' . zen_get_products_type($products_filter)) . '">' . zen_image_button('button_edit_product.gif', IMAGE_EDIT_PRODUCT) . '<br />' . TEXT_PRODUCT_EDIT . '</a>';
        ?>
</td>
            <td class="smallText" align="center">
              <?php 
        if ($zc_products->get_allow_add_to_cart($products_filter) == "Y") {
            echo '<a href="' . zen_href_link(FILENAME_PRODUCTS_PRICE_MANAGER, '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_products_price_manager.gif', IMAGE_PRODUCTS_PRICE_MANAGER) . '<br />' . TEXT_PRODUCTS_PRICE_MANAGER . '</a>';
        } else {
            echo TEXT_INFO_ALLOW_ADD_TO_CART_NO;
        }
        ?>
            </td>
<?php 
        if (zen_has_product_attributes($products_filter, 'false')) {
            ?>
            <td class="smallText" align="center"><?php 
            echo zen_draw_form('update_sort', FILENAME_ATTRIBUTES_CONTROLLER, 'action=update_attribute_sort' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id);
            echo zen_image_submit('button_update_sort.gif', IMAGE_UPDATE_SORT);
            echo zen_draw_hidden_field('confirm', 'y');
            ?>
</form><br /><?php 
            echo TEXT_ATTRIBUTES_UPDATE_SORT_ORDER;
            ?>
</td>
            <td class="smallText" align="center"><?php 
            echo '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, '&action=attributes_preview' . '&products_filter=' . $products_filter . '&current_category_id=' . $current_category_id) . '">' . zen_image_button('button_preview.gif', IMAGE_PREVIEW) . '<br />' . TEXT_ATTRIBUTES_PREVIEW . '</a>';
            ?>
</td>
            <td class="smallText" align="center"><?php 
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:attributes_controller.php


示例7:

            echo $quantityDiscount['discount'];
            ?>
</td><?php 
        }
        $disc_cnt++;
        if ($discount_col_cnt == $disc_cnt && !($key == sizeof($quantityDiscount))) {
            $disc_cnt = 0;
            ?>
  </tr>
<?php 
        }
    }
    ?>

<?php 
    if (zen_has_product_attributes($products_id_current)) {
        ?>
    <tr>
      <td colspan="<?php 
        echo $columnCount + 1;
        ?>
" align="center">
        <?php 
        echo TEXT_FOOTER_DISCOUNT_QUANTITIES;
        ?>
      </td>
    </tr>
<?php 
    }
    ?>
  </table>
开发者ID:happyxlq,项目名称:lt_svn,代码行数:31,代码来源:tpl_modules_products_quantity_discounts.php


示例8: actionCustomerOrder

 /**
  * Method to handle cart Action - Customer Order
  *
  * @param string forward destination
  * @param url parameters
  */
 function actionCustomerOrder($goto, $parameters)
 {
     global $zco_page;
     if ($_SESSION['customer_id'] && isset($_GET['pid'])) {
         if (zen_has_product_attributes($_GET['pid'])) {
             zen_redirect(zen_href_link(zen_get_info_page($_GET['pid']), 'products_id=' . $_GET['pid']));
         } else {
             $this->add_cart($_GET['pid'], $this->get_quantity($_GET['pid']) + 1);
         }
     }
     zen_redirect(zen_href_link($goto, zen_get_all_get_params($parameters)));
 }
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:18,代码来源:shopping_cart.php


示例9: str_repeat

     $display_products_date_added = '';
 }
 if (PRODUCT_FEATURED_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($featured_products->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $featured_products->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $featured_products->fields['manufacturers_name'] . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_FEATURED_LIST_PRICE != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_get_products_display_price($featured_products->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_LIST_PRICE, 3, 1)) . (zen_get_show_product_switch($featured_products->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($featured_products->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
 }
 // more info in place of buy now
 if (PRODUCT_FEATURED_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($featured_products->fields['products_id']) == 'Y') {
     if (zen_has_product_attributes($featured_products->fields['products_id'])) {
         $link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         //          $link= '<a href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</a>';
         if (PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART > 0 && $featured_products->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = TEXT_PRODUCT_FEATURED_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $featured_products->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_FEATURED_PRODUCTS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products->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($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($featured_products->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($featured_products->fields['products_id']) . str_repeat('<br clear="all" />', substr(PRODUCT_FEATURED_BUY_NOW, 3, 1));
 } else {
     $link = '<a href="' . zen_href_link(zen_get_info_page($featured_products->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($featured_products->fields['master_categories_id']) . '&products_id=' . $featured_products->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
开发者ID:kirkbauer2,项目名称:kirkzc,代码行数:31,代码来源:tpl_modules_products_featured_listing.php


示例10: zen_trunc_string

     // add description
     if (PRODUCT_LIST_DESCRIPTION > 0) {
         $lc_text .= '<div>' . zen_trunc_string(zen_clean_html(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id'])), PRODUCT_LIST_DESCRIPTION) . '</div>';
     }
     break;
 case 'PRODUCT_LIST_MANUFACTURER':
     $lc_align = '';
     $lc_text = '&nbsp;<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>&nbsp;';
     break;
 case 'PRODUCT_LIST_PRICE':
     $lc_price = CommerceProduct::getDisplayPriceFromHash($listing->fields['products_id']) . '<br />';
     $lc_align = 'right';
     $lc_text = '&nbsp;' . $lc_price . '&nbsp;';
     // more info in place of buy now
     $lc_button = '';
     if ($listing->fields['products_priced_by_attribute'] || PRODUCT_LIST_PRICE_BUY_NOW == '0' || zen_has_product_attributes($listing->fields['products_id'])) {
         $lc_button = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 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>&nbsp;';
         }
     }
     $the_button = $lc_button;
     $products_link = '<a href="' . CommerceProduct::getDisplayUrlFromId($listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $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']);
     break;
 case 'PRODUCT_LIST_QUANTITY':
     $lc_align = 'right';
开发者ID:bitweaver,项目名称:commerce,代码行数:31,代码来源:product_listing.php


示例11: eo_get_new_product

function eo_get_new_product($product_id, $product_qty = 1, $product_options = array(), $use_specials = true)
{
    global $db;
    $product_id = (int) $product_id;
    $product_qty = (double) $product_qty;
    $retval = array('id' => $product_id, 'qty' => $product_qty);
    $query = $db->Execute('SELECT `p`.`products_id`, `p`.`master_categories_id`, `p`.`products_status`, ' . '`pd`.`products_name`, `p`.`products_model`, `p`.`products_image`, `p`.`products_price`, ' . '`p`.`products_weight`, `p`.`products_tax_class_id`, `p`.`manufacturers_id`, ' . '`p`.`products_quantity_order_min`, `p`.`products_quantity_order_units`, ' . '`p`.`products_quantity_order_max`, `p`.`product_is_free`, `p`.`products_virtual`, ' . '`p`.`products_discount_type`, `p`.`products_discount_type_from`, ' . '`p`.`products_priced_by_attribute`, `p`.`product_is_always_free_shipping` ' . 'FROM `' . TABLE_PRODUCTS . '` AS `p`, `' . TABLE_PRODUCTS_DESCRIPTION . '` AS `pd` ' . 'WHERE `p`.`products_id`=\'' . (int) $product_id . '\' ' . 'AND `pd`.`products_id`=`p`.`products_id` ' . 'AND `pd`.`language_id`=\'' . (int) $_SESSION['languages_id'] . '\'');
    if (!$query->EOF) {
        // Handle common fields
        $retval = array_merge($retval, array('name' => $query->fields['products_name'], 'model' => $query->fields['products_model'], 'price' => $query->fields['products_price'], 'products_discount_type' => $query->fields['products_discount_type'], 'products_discount_type_from' => $query->fields['products_discount_type_from'], 'products_priced_by_attribute' => $query->fields['products_priced_by_attribute'], 'product_is_free' => $query->fields['product_is_free'], 'products_virtual' => $query->fields['products_virtual'], 'product_is_always_free_shipping' => $query->fields['product_is_always_free_shipping'], 'tax' => number_format(zen_get_tax_rate_value($query->fields['products_tax_class_id']), 4), 'tax_description' => zen_get_tax_description($query->fields['products_tax_class_id'])));
        // Handle pricing
        $special_price = zen_get_products_special_price($product_id);
        if ($use_specials && $special_price && $retval['products_priced_by_attribute'] == 0) {
            $retval['price'] = $special_price;
        } else {
            $special_price = 0;
        }
        if (zen_get_products_price_is_free($product_id)) {
            // no charge
            $retval['price'] = 0;
        }
        // adjust price for discounts when priced by attribute
        if ($retval['products_priced_by_attribute'] == '1' && zen_has_product_attributes($product_id, 'false')) {
            // reset for priced by attributes
            if ($special_price) {
                $retval['price'] = $special_price;
            } else {
                $retval['price'] = $query->fields['products_price'];
                // START MARKUP
                if (isset($GLOBALS['priceMarkup'])) {
                    $retval['price'] = $GLOBALS['priceMarkup']->calculatePrice($product_id, $query->fields['manufacturers_id'], $query->fields['master_categories_id'], $retval['price']);
                }
                // END MARKUP
            }
        } else {
            // discount qty pricing
            if ($retval['products_discount_type'] != '0') {
                $retval['price'] = zen_get_products_discount_price_qty($product_id, $retval['qty']);
            }
            // START MARKUP
            if (isset($GLOBALS['priceMarkup'])) {
                $retval['price'] = $GLOBALS['priceMarkup']->calculatePrice($product_id, $query->fields['manufacturers_id'], $query->fields['master_categories_id'], $retval['price']);
            }
            // END MARKUP
        }
        unset($special_price);
        $retval['onetime_charges'] = 0;
        $retval['final_price'] = $retval['price'];
    }
    // Handle attributes
    if (is_array($product_options) && count($product_options > 0)) {
        $retval['attributes'] = array();
        include_once DIR_WS_CLASSES . 'attributes.php';
        $attributes = new attributes();
        foreach ($product_options as $option_id => $details) {
            $attr = array();
            switch ($details['type']) {
                case PRODUCTS_OPTIONS_TYPE_TEXT:
                case PRODUCTS_OPTIONS_TYPE_FILE:
                    $attr['option_id'] = $option_id;
                    $attr['value'] = $details['value'];
                    if ($attr['value'] == '') {
                        continue 2;
                    }
                    // There should only be one text per name.....
                    $get_attr_id = $attributes->get_attributes_by_option($product_id, $option_id);
                    if (count($get_attr_id) == 1) {
                        $details['value'] = $get_attr_id[0]['products_attributes_id'];
                    }
                    unset($get_attr_id);
                    break;
                case PRODUCTS_OPTIONS_TYPE_CHECKBOX:
                    if (!array_key_exists('value', $details)) {
                        continue 2;
                    }
                    $tmp_id = array_shift($details['value']);
                    foreach ($details['value'] as $attribute_id) {
                        // We only get here if more than one checkbox per
                        // option was selected.
                        $tmp = $attributes->get_attribute_by_id($attribute_id, 'order');
                        $retval['attributes'][] = $tmp;
                        // Handle pricing
                        $prices = eo_get_product_attribute_prices($attribute_id, $tmp['value'], $product_qty);
                        unset($tmp);
                        if (!$query->EOF) {
                            $retval['onetime_charges'] += $prices['onetime_charges'];
                            $retval['final_price'] += $prices['price'];
                        }
                    }
                    $details['value'] = $tmp_id;
                    $attr = $attributes->get_attribute_by_id($details['value'], 'order');
                    unset($attribute_id);
                    unset($attribute_value);
                    unset($tmp_id);
                    break;
                default:
                    $attr = $attributes->get_attribute_by_id($details['value'], 'order');
            }
            $retval['attributes'][] = $attr;
            if (!$query->EOF) {
//.........这里部分代码省略.........
开发者ID:bislewl,项目名称:super_edit_orders_with_ty,代码行数:101,代码来源:edit_orders_functions.php


示例12: str_repeat

 }
 if (PRODUCT_SPECIALS_MANUFACTURER != '0' and zen_get_show_product_switch($specials->fields['products_id'], 'manufacturer')) {
     $display_products_manufacturers_name = $specials->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . $specials->fields['manufacturers_name'] . str_repeat('', substr(PRODUCT_SPECIALS_MANUFACTURER, 3, 1)) : '';
 } else {
     $display_products_manufacturers_name = '';
 }
 if (PRODUCT_SPECIALS_PRICE != '0' and zen_get_products_allow_add_to_cart($specials->fields['products_id']) == 'Y' and zen_check_show_prices() == true) {
     $products_price = zen_mb_get_products_display_price($specials->fields['products_id']);
     $display_products_price = TEXT_PRICE . ' ' . $products_price . str_repeat('', substr(PRODUCT_SPECIALS_PRICE, 3, 1)) . (zen_get_show_product_switch($specials->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? zen_get_product_is_always_free_shipping($specials->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '' : '');
 } else {
     $display_products_price = '';
     $products_price = '';
 }
 // more info in place of buy now
 if (PRODUCT_NEW_BUY_NOW != '0' and zen_get_products_allow_add_to_cart($specials->fields['products_id']) == 'Y') {
     if (zen_has_product_attributes($specials->fields['products_id'])) {
         $link = '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     } else {
         if (PRODUCT_SPECIALS_MULTIPLE_ADD_TO_CART > 0 && $specials->fields['products_qty_box_status'] != 0) {
             //            $how_many++;
             $link = '<span>' . TEXT_PRODUCT_SPECIALS_MULTIPLE_ADD_TO_CART . "</span><input class='input-text' type=\"text\" name=\"products_id[" . $specials->fields['products_id'] . "]\" value=\"0\" size=\"4\" />";
         } else {
             $link = '<a href="' . zen_href_link(FILENAME_SPECIALS, zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $specials->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($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $display_products_button = zen_get_buy_now_button($specials->fields['products_id'], $the_button, $products_link) . zen_get_products_quantity_min_units_display($specials->fields['products_id']) . str_repeat('', substr(PRODUCT_NEW_BUY_NOW, 3, 1));
 } else {
     $link = '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
     $the_button = $link;
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:tpl_modules_specials_listing.php


示例13: str_replace

         $result->MoveNext();
     }
     $ProductOptions = str_replace('value="' . $add_product_products_id . '"', 'value="' . $add_product_products_id . '" selected', $ProductOptions);
     echo $ProductOptions;
     unset($ProductOptions);
     echo "</select></td>\n";
     echo "<input type='hidden' name='add_product_categories_id' value='{$add_product_categories_id}'>";
     echo "<input type='hidden' name='search' value='" . $_POST['search'] . "'>";
     echo "<input type='hidden' name='step' value='3'>";
     echo "</form></tr>\n";
     echo "<tr><td colspan='3'>&nbsp;</td></tr>\n";
 }
 // Step 3: Choose Options
 if ($step > 2 && $add_product_products_id > 0) {
     // Skip to Step 4 if no Options
     if (!zen_has_product_attributes($add_product_products_id)) {
         echo "<tr class=\"dataTableRow\">\n";
         echo "<td class='dataTableContent' align='right'><strong>" . ADDPRODUCT_TEXT_STEP3 . "</strong></td><td class='dataTableContent' valign='top' colspan='2'><i>" . ADDPRODUCT_TEXT_OPTIONS_NOTEXIST . "</i></td>";
         echo "</tr>\n";
         $step = 4;
     } else {
         $attrs = eo_get_product_attributes_options($add_product_products_id);
         echo "<tr class='dataTableRow'>" . zen_draw_form('add_prdct', FILENAME_EDIT_ORDERS, zen_get_all_get_params(array('action', 'oID')) . 'oID=' . 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP zen_has_product_attributes_values函数代码示例发布时间:2022-05-23
下一篇:
PHP zen_get_zone_name函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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