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


PHP Configuration::isCatalogMode方法代码示例

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


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

示例1: getTemplateVarSitemap

 public function getTemplateVarSitemap()
 {
     $pages = [];
     $catalog_mode = Configuration::isCatalogMode();
     $cms = CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1);
     foreach ($cms['cms'] as $p) {
         $pages[] = ['id' => 'cms-page-' . $p['id_cms'], 'label' => $p['meta_title'], 'url' => $this->context->link->getCMSLink(new CMS($p['id_cms']))];
     }
     $pages[] = ['id' => 'stores-page', 'label' => $this->trans('Our stores', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('stores')];
     $pages[] = ['id' => 'contact-page', 'label' => $this->trans('Contact us', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('contact')];
     $pages[] = ['id' => 'sitemap-page', 'label' => $this->trans('Sitemap', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('sitemap')];
     $pages[] = ['id' => 'login-page', 'label' => $this->trans('Log in', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('authentication')];
     $pages[] = ['id' => 'register-page', 'label' => $this->trans('Create new account', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('authentication')];
     $catalog = ['new-product' => ['id' => 'new-product-page', 'label' => $this->trans('New products', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('new-products')]];
     if ($catalog_mode && Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         $catalog['best-sales'] = ['id' => 'best-sales-page', 'label' => $this->trans('Best sellers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('best-sales')];
         $catalog['prices-drop'] = ['id' => 'prices-drop-page', 'label' => $this->trans('Price drop', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('prices-drop')];
     }
     if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
         $manufacturers = Manufacturer::getLiteManufacturersList($this->context->language->id, 'sitemap');
         $catalog['manufacturer'] = ['id' => 'manufacturer-page', 'label' => $this->trans('Manufacturers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('manufacturer'), 'children' => $manufacturers];
         $suppliers = Supplier::getLiteSuppliersList($this->context->language->id, 'sitemap');
         $catalog['supplier'] = ['id' => 'supplier-page', 'label' => $this->trans('Suppliers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('supplier'), 'children' => $suppliers];
     }
     $categories = Category::getRootCategory()->recurseLiteCategTree(0, 0, null, null, 'sitemap');
     $catalog['category'] = ['id' => 'category-page', 'label' => $this->trans('Categories', array(), 'Shop.Theme.Catalog'), 'url' => '#', 'children' => $categories['children']];
     $sitemap = [['id' => 'page-page', 'label' => $this->trans('Pages', array(), 'Shop.Theme'), 'url' => '#', 'children' => $pages], ['id' => 'catalog-page', 'label' => $this->trans('Catalog', array(), 'Shop.Theme'), 'url' => '#', 'children' => $catalog]];
     return $sitemap;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:29,代码来源:SitemapController.php

示例2: initContent

 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $this->setTemplate('customer/order-return');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:13,代码来源:OrderReturnController.php

示例3: renderWidget

 public function renderWidget($hookName, array $params)
 {
     if (Configuration::isCatalogMode()) {
         return;
     }
     $this->smarty->assign($this->getWidgetVariables($hookName, $params));
     return $this->fetch('module:ps_shoppingcart/ps_shoppingcart.tpl');
 }
开发者ID:prestashop,项目名称:ps_shoppingcart,代码行数:8,代码来源:ps_shoppingcart.php

示例4: getPresentationSettings

 public function getPresentationSettings()
 {
     $settings = new ProductPresentationSettings();
     $settings->catalog_mode = Configuration::isCatalogMode();
     $settings->include_taxes = $this->taxConfiguration->includeTaxes();
     $settings->allow_add_variant_to_cart_from_listing = (int) Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY');
     $settings->stock_management_enabled = Configuration::get('PS_STOCK_MANAGEMENT');
     $settings->showPrices = Configuration::showPrices();
     return $settings;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:10,代码来源:ProductPresenterFactory.php

示例5: renderWidget

 public function renderWidget($hookName, array $configuration)
 {
     if (Configuration::isCatalogMode() || !Currency::isMultiCurrencyActivated()) {
         return false;
     }
     if (!$this->isCached($this->templateFile, $this->getCacheId('ps_currencyselector'))) {
         $this->smarty->assign($this->getWidgetVariables($hookName, $configuration));
     }
     return $this->fetch($this->templateFile, $this->getCacheId('ps_currencyselector'));
 }
开发者ID:prestashop,项目名称:ps_currencyselector,代码行数:10,代码来源:ps_currencyselector.php

示例6: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $cart_rules = $this->getTemplateVarCartRules();
     if (count($cart_rules) <= 0) {
         $this->warning[] = $this->trans('You do not have any vouchers.', array(), 'Shop.Notifications.Warning');
     }
     $this->context->smarty->assign(['cart_rules' => $cart_rules]);
     $this->setTemplate('customer/discount');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:17,代码来源:DiscountController.php

示例7: initContent

 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $ordersReturn = $this->getTemplateVarOrdersReturns();
     if (count($ordersReturn) <= 0) {
         $this->errors[] = $this->trans('You have no merchandise return authorizations.', array(), 'Shop.Notifications.Error');
     }
     $this->context->smarty->assign('ordersReturn', $ordersReturn);
     $this->setTemplate('customer/order-follow');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:18,代码来源:OrderFollowController.php

示例8: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $credit_slips = $this->getTemplateVarCreditSlips();
     if (count($credit_slips) <= 0) {
         $this->warning[] = $this->trans('You have not received any credit slips.', array(), 'Shop.Notifications.Warning');
     }
     $this->context->smarty->assign(['credit_slips' => $credit_slips]);
     $this->setTemplate('customer/order-slip');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:17,代码来源:OrderSlipController.php

示例9: initContent

 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $order = new Order(Order::getOrderByCartId((int) $this->id_cart));
     $presentedOrder = $this->order_presenter->present($order);
     $register_form = $this->makeCustomerForm()->setGuestAllowed(false)->fillWith(Tools::getAllValues());
     $this->context->smarty->assign(array('HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation($order), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn($order), 'order' => $presentedOrder, 'register_form' => $register_form));
     if ($this->context->customer->is_guest) {
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     }
     $this->setTemplate('checkout/order-confirmation');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:21,代码来源:OrderConfirmationController.php

示例10: initContent

 /**
  * Assign template vars related to page content.
  *
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     $this->order_presenter = new OrderPresenter();
     if (Tools::isSubmit('slowvalidation')) {
         $this->warning[] = $this->trans('If you have just placed an order, it may take a few minutes for it to be validated. Please refresh this page if your order is missing.', array(), 'Shop.Notifications.Warning');
     }
     $orders = $this->getTemplateVarOrders();
     if (count($orders) <= 0) {
         $this->warning[] = $this->trans('You have not placed any orders.', array(), 'Shop.Notifications.Warning');
     }
     $this->context->smarty->assign(array('orders' => $orders));
     $this->setTemplate('customer/history');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:22,代码来源:HistoryController.php

示例11: getWidgetVariables

 public function getWidgetVariables($hookName = null, array $configuration = [])
 {
     $notifications = false;
     if (Tools::isSubmit('submitMessage')) {
         $this->sendMessage();
         if (!empty($this->context->controller->errors)) {
             $notifications['messages'] = $this->context->controller->errors;
             $notifications['nw_error'] = true;
         } elseif (!empty($this->context->controller->success)) {
             $notifications['messages'] = $this->context->controller->success;
             $notifications['nw_error'] = false;
         }
     }
     if (($id_customer_thread = (int) Tools::getValue('id_customer_thread')) && ($token = Tools::getValue('token'))) {
         $cm = new CustomerThread($id_customer_thread);
         if ($cm->token == $token) {
             $this->customer_thread = $this->context->controller->objectPresenter->present($cm);
             $order = new Order((int) $this->customer_thread['id_order']);
             if (Validate::isLoadedObject($order)) {
                 $customer_thread['reference'] = $order->getUniqReference();
             }
         }
     }
     $this->contact['contacts'] = $this->getTemplateVarContact();
     $this->contact['message'] = html_entity_decode(Tools::getValue('message'));
     $this->contact['allow_file_upload'] = (bool) Configuration::get('PS_CUSTOMER_SERVICE_FILE_UPLOAD');
     if (!(bool) Configuration::isCatalogMode()) {
         $this->contact['orders'] = $this->getTemplateVarOrders();
     } else {
         $this->contact['orders'] = array();
     }
     if ($this->customer_thread['email']) {
         $this->contact['email'] = $this->customer_thread['email'];
     } else {
         $this->contact['email'] = Tools::safeOutput(Tools::getValue('from', isset($this->context->cookie) && isset($this->context->cookie->email) && Validate::isEmail($this->context->cookie->email) ? $this->context->cookie->email : ''));
     }
     return ['contact' => $this->contact, 'notifications' => $notifications];
 }
开发者ID:prestashop,项目名称:contactform,代码行数:38,代码来源:contactform.php

示例12: initContent

 /**
  * Assign template vars related to page content
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     if (Configuration::isCatalogMode()) {
         Tools::redirect('index.php');
     }
     parent::initContent();
     if (!($id_order = (int) Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order)) {
         $this->redirect_after = '404';
         $this->redirect();
     } else {
         if (Tools::getIsset('errorQuantity')) {
             $this->errors[] = $this->trans('You do not have enough products to request an additional merchandise return.', array(), 'Shop.Notifications.Error');
         } elseif (Tools::getIsset('errorMsg')) {
             $this->errors[] = $this->trans('Please provide an explanation for your RMA.', array(), 'Shop.Notifications.Error');
         } elseif (Tools::getIsset('errorDetail1')) {
             $this->errors[] = $this->trans('Please check at least one product you would like to return.', array(), 'Shop.Notifications.Error');
         } elseif (Tools::getIsset('errorDetail2')) {
             $this->errors[] = $this->trans('For each product you wish to add, please specify the desired quantity.', array(), 'Shop.Notifications.Error');
         } elseif (Tools::getIsset('errorNotReturnable')) {
             $this->errors[] = $this->trans('This order cannot be returned', array(), 'Shop.Notifications.Error');
         } elseif (Tools::getIsset('messagesent')) {
             $this->success[] = $this->trans('Message successfully sent', array(), 'Shop.Notifications.Success');
         }
         $order = new Order($id_order);
         if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
             $this->order_to_display = (new OrderPresenter())->present($order);
             $this->context->smarty->assign(['order' => $this->order_to_display, 'HOOK_DISPLAYORDERDETAIL' => Hook::exec('displayOrderDetail', ['order' => $order])]);
         } else {
             $this->redirect_after = '404';
             $this->redirect();
         }
         unset($order);
     }
     $this->setTemplate('customer/order-detail');
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:39,代码来源:OrderDetailController.php

示例13: checkProductsAccess

 /**
  * Check if the product can be accessed by the Customer
  *
  * @return bool Indicates if the Customer in the current Cart has access
  */
 public function checkProductsAccess()
 {
     if (Configuration::isCatalogMode()) {
         return true;
     }
     foreach ($this->getProducts() as $product) {
         if (!Product::checkAccessStatic($product['id_product'], $this->id_customer)) {
             return $product['id_product'];
         }
     }
     return false;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:17,代码来源:Cart.php

示例14: getTemplateVarConfiguration

 public function getTemplateVarConfiguration()
 {
     $quantity_discount_price = Configuration::get('PS_DISPLAY_DISCOUNT_PRICE');
     return array('display_taxes_label' => $this->getDisplayTaxesLabel(), 'low_quantity_threshold' => (int) Configuration::get('PS_LAST_QTIES'), 'is_b2b' => (bool) Configuration::get('PS_B2B_ENABLE'), 'is_catalog' => (bool) Configuration::isCatalogMode(), 'show_prices' => (bool) Configuration::showPrices(), 'opt_in' => array('partner' => (bool) Configuration::get('PS_CUSTOMER_OPTIN')), 'quantity_discount' => array('type' => $quantity_discount_price ? 'price' : 'discount', 'label' => $quantity_discount_price ? $this->getTranslator()->trans('Price', array(), 'Shop.Theme.Catalog') : $this->getTranslator()->trans('Discount', array(), 'Shop.Theme.Catalog')), 'voucher_enabled' => (int) CartRule::isFeatureActive(), 'return_enabled' => (int) Configuration::get('PS_ORDER_RETURN'), 'number_of_days_for_return' => (int) Configuration::get('PS_ORDER_RETURN_NB_DAYS'));
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:5,代码来源:FrontController.php

示例15: getTemplateVarProduct

 public function getTemplateVarProduct()
 {
     $productSettings = $this->getProductPresentationSettings();
     $product = $this->objectPresenter->present($this->product);
     $product['id_product'] = (int) $this->product->id;
     $product['out_of_stock'] = (int) $this->product->out_of_stock;
     $product['new'] = (int) $this->product->new;
     $product['id_product_attribute'] = (int) Tools::getValue('id_product_attribute');
     $product['minimal_quantity'] = $this->getProductMinimalQuantity($product);
     $product['quantity_wanted'] = $this->getRequiredQuantity($product);
     $product_full = Product::getProductProperties($this->context->language->id, $product, $this->context);
     $product_full = $this->addProductCustomizationData($product_full);
     $product_full['show_quantities'] = (bool) (Configuration::get('PS_DISPLAY_QTIES') && Configuration::get('PS_STOCK_MANAGEMENT') && $this->product->quantity > 0 && $this->product->available_for_order && !Configuration::isCatalogMode());
     $product_full['quantity_label'] = $this->product->quantity > 1 ? $this->trans('Items', array(), 'Shop.Theme.Catalog') : $this->trans('Item', array(), 'Shop.Theme.Catalog');
     $product_full['quantity_discounts'] = $this->quantity_discounts;
     if ($product_full['unit_price_ratio'] > 0) {
         $unitPrice = $productSettings->include_taxes ? $product_full['price'] : $product_full['price_tax_exc'];
         $product_full['unit_price'] = $unitPrice / $product_full['unit_price_ratio'];
     }
     $group_reduction = GroupReduction::getValueForProduct($this->product->id, (int) Group::getCurrent()->id);
     if ($group_reduction === false) {
         $group_reduction = Group::getReduction((int) $this->context->cookie->id_customer) / 100;
     }
     $product_full['customer_group_discount'] = $group_reduction;
     $presenter = $this->getProductPresenter();
     return $presenter->present($productSettings, $product_full, $this->context->language);
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:27,代码来源:ProductController.php


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