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


PHP Manufacturer::getMenuoptions方法代码示例

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


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

示例1: view_product_overview

 /**
  * Set up the shop page with products and discounts
  *
  * @param   array       $product_ids    The optional array of Product IDs.
  *                                      Overrides any URL parameters if set
  * @return  boolean                     True on success, false otherwise
  * @global  ADONewConnection  $objDatabase    Database connection object
  * @global  array       $_ARRAYLANG     Language array
  * @global  array       $_CONFIG        Core configuration array, see {@link /config/settings.php}
  * @global  string(?)   $themesPages    Themes pages(?)
  */
 static function view_product_overview($product_ids = null)
 {
     global $_ARRAYLANG;
     // activate javascript shadowbox
     \JS::activate('shadowbox');
     $flagSpecialoffer = intval(\Cx\Core\Setting\Controller\Setting::getValue('show_products_default', 'Shop'));
     if (isset($_REQUEST['cmd']) && $_REQUEST['cmd'] == 'discounts') {
         $flagSpecialoffer = Products::DEFAULT_VIEW_DISCOUNTS;
     }
     $flagLastFive = isset($_REQUEST['lastFive']);
     $product_id = isset($_REQUEST['productId']) ? intval($_REQUEST['productId']) : null;
     $cart_id = null;
     if (isset($_REQUEST['referer']) && $_REQUEST['referer'] == 'cart') {
         $cart_id = $product_id;
         $product_id = Cart::get_product_id($cart_id);
     }
     $manufacturer_id = isset($_REQUEST['manufacturerId']) ? intval($_REQUEST['manufacturerId']) : null;
     $term = isset($_REQUEST['term']) ? trim(contrexx_input2raw($_REQUEST['term'])) : null;
     $category_id = isset($_REQUEST['catId']) ? intval($_REQUEST['catId']) : null;
     if (!($product_id || $category_id || $manufacturer_id || $term || $cart_id)) {
         // NOTE: This is different from NULL
         // in that it enables listing the subcategories
         $category_id = 0;
     }
     // Validate parameters
     if ($product_id && empty($category_id)) {
         $objProduct = Product::getById($product_id);
         if ($objProduct) {
             $category_id = $objProduct->category_id();
         }
         if (isset($_SESSION['shop']['previous_category_id'])) {
             $category_id_previous = $_SESSION['shop']['previous_category_id'];
             foreach (preg_split('/\\s*,\\s*/', $category_id) as $id) {
                 if ($category_id_previous == intval($id)) {
                     $category_id = $category_id_previous;
                 }
             }
         }
     }
     // Remember visited Products
     if ($product_id) {
         self::rememberVisitedProducts($product_id);
     }
     $objCategory = null;
     if ($category_id && empty($product_id)) {
         $objCategory = ShopCategory::getById($category_id);
         if (!$objCategory) {
             $category_id = null;
         }
     }
     $shopMenu = '<form method="post" action="' . \Cx\Core\Routing\Url::fromModuleAndCmd('Shop', '') . '">' . '<input type="text" name="term" value="' . htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET) . '" style="width:150px;" />&nbsp;' . '<select name="catId" style="width:150px;">' . '<option value="0">' . $_ARRAYLANG['TXT_ALL_PRODUCT_GROUPS'] . '</option>' . ShopCategories::getMenuoptions($category_id) . '</select>&nbsp;' . Manufacturer::getMenu('manufacturerId', $manufacturer_id, true) . '<input type="submit" name="bsubmit" value="' . $_ARRAYLANG['TXT_SEARCH'] . '" style="width:66px;" />' . '</form>';
     self::$objTemplate->setGlobalVariable($_ARRAYLANG + array('SHOP_MENU' => $shopMenu, 'SHOP_SEARCH_TERM' => htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET), 'SHOP_CATEGORIES_MENUOPTIONS' => ShopCategories::getMenuoptions($category_id, true, 0, true), 'SHOP_MANUFACTURER_MENUOPTIONS' => Manufacturer::getMenuoptions($manufacturer_id, true)));
     // Only show the cart info when the JS cart is not active!
     global $_CONFIGURATION;
     if (empty($_CONFIGURATION['custom']['shopJsCart'])) {
         self::$objTemplate->setVariable(array('SHOP_CART_INFO' => self::cart_info()));
     }
     // Exclude Category list from search results
     if ($term == '') {
         self::showCategories($category_id);
     }
     if (self::$objTemplate->blockExists('shopNextCategoryLink')) {
         $nextCat = ShopCategory::getNextShopCategoryId($category_id);
         $objCategory = ShopCategory::getById($nextCat);
         if ($objCategory) {
             self::$objTemplate->setVariable(array('SHOP_NEXT_CATEGORY_ID' => $nextCat, 'SHOP_NEXT_CATEGORY_TITLE' => str_replace('"', '&quot;', $objCategory->name())));
         }
     }
     $pagingCmd = !empty($_REQUEST['cmd']) ? '&amp;cmd=' . contrexx_input2raw($_REQUEST['cmd']) : '';
     $pagingCatId = '';
     $pagingManId = '';
     $pagingTerm = '';
     // TODO: This probably breaks paging in search results!
     // Should only reset the flag conditionally, but add the URL parameters in
     // any case, methinks!
     if ($category_id > 0 && $term == '') {
         $flagSpecialoffer = false;
         $pagingCatId = "&amp;catId={$category_id}";
     }
     if ($manufacturer_id > 0) {
         $flagSpecialoffer = false;
         $pagingManId = "&amp;manufacturer_id={$manufacturer_id}";
     }
     if ($term != '') {
         $flagSpecialoffer = false;
         $pagingTerm = '&amp;term=' . htmlentities($term, ENT_QUOTES, CONTREXX_CHARSET);
     }
     // The Product count is passed by reference and set to the total
     // number of records, though only as many as specified by the core
//.........这里部分代码省略.........
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:101,代码来源:Shop.class.php

示例2: view_product_edit

 /**
  * Manage products
  *
  * Add and edit products
  * @access  public
  * @return  string
  * @author  Reto Kohli <reto.kohli@comvation.com> (parts)
  */
 function view_product_edit()
 {
     global $_ARRAYLANG;
     self::store_product();
     $product_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
     $objProduct = null;
     self::$objTemplate->addBlockfile('SHOP_PRODUCTS_FILE', 'shop_products_block', 'module_shop_product_manage.html');
     self::$objTemplate->setGlobalVariable($_ARRAYLANG);
     $cx = \Cx\Core\Core\Controller\Cx::instanciate();
     self::$objTemplate->setVariable(array('SHOP_DELETE_ICON' => $cx->getCodeBaseCoreWebPath() . '/Core/View/Media/icons/delete.gif', 'SHOP_NO_PICTURE_ICON' => self::$defaultImage));
     if ($product_id > 0) {
         $objProduct = Product::getById($product_id);
     }
     if (!$objProduct) {
         $objProduct = new Product('', 0, '', '', 0, 1, 0, 0);
     }
     $this->viewpart_product_attributes($product_id);
     $arrImages = Products::get_image_array_from_base64($objProduct->pictures());
     // Virtual Categories are disabled FTTB
     //        $flagsSelection =
     //            ShopCategories::getVirtualCategoriesSelectionForFlags(
     //                $objProduct->flags()
     //            );
     //        if ($flagsSelection) {
     //            self::$objTemplate->setVariable(
     //                'SHOP_FLAGS_SELECTION', $flagsSelection);
     //        }
     //
     // media browser
     $mediaBrowserOptions = array('type' => 'button', 'data-cx-mb-startmediatype' => 'shop', 'data-cx-mb-views' => 'filebrowser', 'id' => 'media_browser_shop', 'style' => 'display:none');
     self::$objTemplate->setVariable(array('MEDIABROWSER_BUTTON' => self::getMediaBrowserButton($mediaBrowserOptions, 'setSelectedImage')));
     $distribution = $objProduct->distribution();
     // Available active frontend groups, and those assigned to the product
     $objGroup = \FWUser::getFWUserObject()->objGroup->getGroups(array('type' => 'frontend', 'is_active' => true), array('group_id' => 'asc'));
     $usergroup_ids = $objProduct->usergroup_ids();
     $arrAssignedFrontendGroupId = explode(',', $usergroup_ids);
     $strActiveFrontendGroupOptions = '';
     $strAssignedFrontendGroupOptions = '';
     while ($objGroup && !$objGroup->EOF) {
         $strOption = '<option value="' . $objGroup->getId() . '">' . htmlentities($objGroup->getName(), ENT_QUOTES, CONTREXX_CHARSET) . '</option>';
         if (in_array($objGroup->getId(), $arrAssignedFrontendGroupId)) {
             $strAssignedFrontendGroupOptions .= $strOption;
         } else {
             $strActiveFrontendGroupOptions .= $strOption;
         }
         $objGroup->next();
     }
     $discount_group_count_id = $objProduct->group_id();
     $discount_group_article_id = $objProduct->article_id();
     $keywords = $objProduct->keywords();
     //die($objProduct->category_id());
     // Product assigned to multiple Categories
     $arrAssignedCategories = ShopCategories::getAssignedShopCategoriesMenuoptions($objProduct->category_id());
     // Date format for Datepicker:
     // Clear the date if none is set; there's no point in displaying
     // "01/01/1970" instead
     $start_date = $end_date = '';
     $start_time = strtotime($objProduct->date_start());
     // Note that the check for ">0" is necessary, as some systems return
     // crazy values for empty dates (it may even fail like this)!
     if ($start_time > 0) {
         $start_date = date(ASCMS_DATE_FORMAT_DATE, $start_time);
     }
     $end_time = strtotime($objProduct->date_end());
     if ($end_time > 0) {
         $end_date = date(ASCMS_DATE_FORMAT_DATE, $end_time);
     }
     //DBG::log("Dates from ".$objProduct->date_start()." ($start_time, $start_date) to ".$objProduct->date_start()." ($end_time, $end_date)");
     $websiteImagesShopPath = $cx->getWebsiteImagesShopPath() . '/';
     $websiteImagesShopWebPath = $cx->getWebsiteImagesShopWebPath() . '/';
     self::$objTemplate->setVariable(array('SHOP_PRODUCT_ID' => isset($_REQUEST['new']) ? 0 : $objProduct->id(), 'SHOP_PRODUCT_CODE' => contrexx_raw2xhtml($objProduct->code()), 'SHOP_PRODUCT_NAME' => contrexx_raw2xhtml($objProduct->name()), 'SHOP_CATEGORIES_ASSIGNED' => $arrAssignedCategories['assigned'], 'SHOP_CATEGORIES_AVAILABLE' => $arrAssignedCategories['available'], 'SHOP_CUSTOMER_PRICE' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->price())), 'SHOP_RESELLER_PRICE' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->resellerprice())), 'SHOP_DISCOUNT' => contrexx_raw2xhtml(Currency::formatPrice($objProduct->discountprice())), 'SHOP_SPECIAL_OFFER' => $objProduct->discount_active() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_VAT_MENUOPTIONS' => Vat::getMenuoptions($objProduct->vat_id(), true), 'SHOP_SHORT_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg('short', $objProduct->short()), 'SHOP_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg('long', $objProduct->long(), 'full'), 'SHOP_STOCK' => $objProduct->stock(), 'SHOP_MIN_ORDER_QUANTITY' => $objProduct->minimum_order_quantity(), 'SHOP_MANUFACTURER_URL' => contrexx_raw2xhtml($objProduct->uri()), 'SHOP_DATE_START' => \Html::getDatepicker('date_start', array('defaultDate' => $start_date), ''), 'SHOP_DATE_END' => \Html::getDatepicker('date_end', array('defaultDate' => $end_date), ''), 'SHOP_ARTICLE_ACTIVE' => $objProduct->active() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_B2B' => $objProduct->b2b() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_B2C' => $objProduct->b2c() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_STOCK_VISIBILITY' => $objProduct->stock_visible() ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_MANUFACTURER_MENUOPTIONS' => Manufacturer::getMenuoptions($objProduct->manufacturer_id()), 'SHOP_PICTURE1_IMG_SRC' => !empty($arrImages[1]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[1]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[1]['img'])) : self::$defaultImage, 'SHOP_PICTURE2_IMG_SRC' => !empty($arrImages[2]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[2]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[2]['img'])) : self::$defaultImage, 'SHOP_PICTURE3_IMG_SRC' => !empty($arrImages[3]['img']) && is_file(\ImageManager::getThumbnailFilename($websiteImagesShopPath . $arrImages[3]['img'])) ? contrexx_raw2encodedUrl(\ImageManager::getThumbnailFilename($websiteImagesShopWebPath . $arrImages[3]['img'])) : self::$defaultImage, 'SHOP_PICTURE1_IMG_SRC_NO_THUMB' => !empty($arrImages[1]['img']) && is_file($websiteImagesShopPath . $arrImages[1]['img']) ? $websiteImagesShopWebPath . $arrImages[1]['img'] : self::$defaultImage, 'SHOP_PICTURE2_IMG_SRC_NO_THUMB' => !empty($arrImages[2]['img']) && is_file($websiteImagesShopPath . $arrImages[2]['img']) ? $websiteImagesShopWebPath . $arrImages[2]['img'] : self::$defaultImage, 'SHOP_PICTURE3_IMG_SRC_NO_THUMB' => !empty($arrImages[3]['img']) && is_file($websiteImagesShopPath . $arrImages[3]['img']) ? $websiteImagesShopWebPath . $arrImages[3]['img'] : self::$defaultImage, 'SHOP_PICTURE1_IMG_WIDTH' => $arrImages[1]['width'], 'SHOP_PICTURE1_IMG_HEIGHT' => $arrImages[1]['height'], 'SHOP_PICTURE2_IMG_WIDTH' => $arrImages[2]['width'], 'SHOP_PICTURE2_IMG_HEIGHT' => $arrImages[2]['height'], 'SHOP_PICTURE3_IMG_WIDTH' => $arrImages[3]['width'], 'SHOP_PICTURE3_IMG_HEIGHT' => $arrImages[3]['height'], 'SHOP_DISTRIBUTION_MENU' => Distribution::getDistributionMenu($objProduct->distribution(), 'distribution', 'distributionChanged();', 'style="width: 220px"'), 'SHOP_WEIGHT' => $distribution == 'delivery' ? Weight::getWeightString($objProduct->weight()) : '0 g', 'SHOP_GROUPS_AVAILABLE' => $strActiveFrontendGroupOptions, 'SHOP_GROUPS_ASSIGNED' => $strAssignedFrontendGroupOptions, 'SHOP_ACCOUNT_VALIDITY_OPTIONS' => \FWUser::getValidityMenuOptions($distribution == 'download' ? $objProduct->weight() : 0), 'SHOP_CREATE_ACCOUNT_YES_CHECKED' => empty($usergroup_ids) ? '' : \Html::ATTRIBUTE_CHECKED, 'SHOP_CREATE_ACCOUNT_NO_CHECKED' => empty($usergroup_ids) ? \Html::ATTRIBUTE_CHECKED : '', 'SHOP_DISCOUNT_GROUP_COUNT_MENU_OPTIONS' => Discount::getMenuOptionsGroupCount($discount_group_count_id), 'SHOP_DISCOUNT_GROUP_ARTICLE_MENU_OPTIONS' => Discount::getMenuOptionsGroupArticle($discount_group_article_id), 'SHOP_KEYWORDS' => contrexx_raw2xhtml($keywords), 'SHOP_WEIGHT_ENABLED' => \Cx\Core\Setting\Controller\Setting::getValue('weight_enable', 'Shop') ? 1 : 0));
     return true;
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:81,代码来源:ShopManager.class.php


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