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


PHP Isotope::getConfig方法代码示例

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


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

示例1: findProducts

 /**
  * Fill the object's arrProducts array
  *
  * @param array|null $arrCacheIds
  *
  * @return array
  */
 protected function findProducts($arrCacheIds = null)
 {
     $t = Product::getTable();
     $arrColumns = array();
     $arrCategories = $this->findCategories();
     $arrProductIds = \Database::getInstance()->query("\n                SELECT pid\n                FROM tl_iso_product_category\n                WHERE page_id IN (" . implode(',', $arrCategories) . ")\n            ")->fetchEach('pid');
     $arrTypes = \Database::getInstance()->query("SELECT id FROM tl_iso_producttype WHERE variants='1'")->fetchEach('id');
     if (empty($arrProductIds)) {
         return array();
     }
     $queryBuilder = new FilterQueryBuilder(Isotope::getRequestCache()->getFiltersForModules($this->iso_filterModules));
     $arrColumns[] = "(\n            ({$t}.id IN (" . implode(',', $arrProductIds) . ") AND {$t}.type NOT IN (" . implode(',', $arrTypes) . "))\n            OR {$t}.pid IN (" . implode(',', $arrProductIds) . ")\n        )";
     if (!empty($arrCacheIds) && is_array($arrCacheIds)) {
         $arrColumns[] = Product::getTable() . ".id IN (" . implode(',', $arrCacheIds) . ")";
     }
     // Apply new/old product filter
     if ($this->iso_newFilter == 'show_new') {
         $arrColumns[] = Product::getTable() . ".dateAdded>=" . Isotope::getConfig()->getNewProductLimit();
     } elseif ($this->iso_newFilter == 'show_old') {
         $arrColumns[] = Product::getTable() . ".dateAdded<" . Isotope::getConfig()->getNewProductLimit();
     }
     if ($this->iso_list_where != '') {
         $arrColumns[] = $this->iso_list_where;
     }
     if ($queryBuilder->hasSqlCondition()) {
         $arrColumns[] = $queryBuilder->getSqlWhere();
     }
     $arrSorting = Isotope::getRequestCache()->getSortingsForModules($this->iso_filterModules);
     if (empty($arrSorting) && $this->iso_listingSortField != '') {
         $direction = $this->iso_listingSortDirection == 'DESC' ? Sort::descending() : Sort::ascending();
         $arrSorting[$this->iso_listingSortField] = $direction;
     }
     $objProducts = Product::findAvailableBy($arrColumns, $queryBuilder->getSqlValues(), array('order' => 'c.sorting', 'filters' => $queryBuilder->getFilters(), 'sorting' => $arrSorting));
     return null === $objProducts ? array() : $objProducts->getModels();
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:42,代码来源:ProductVariantList.php

示例2: isAvailable

 /**
  * Check the cart currency for ePay support
  *
  * @return bool
  */
 public function isAvailable()
 {
     if (!Currency::isSupported(Isotope::getConfig()->currency)) {
         return false;
     }
     return parent::isAvailable();
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:12,代码来源:EPay.php

示例3: isAvailable

 /**
  * sofortueberweisung.de only supports these currencies
  * @return  true
  */
 public function isAvailable()
 {
     if (!in_array(Isotope::getConfig()->currency, array('EUR', 'CHF', 'GBP'))) {
         return false;
     }
     return parent::isAvailable();
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:11,代码来源:Sofortueberweisung.php

示例4: isAvailable

 /**
  * Check the cart currency for ePay support
  *
  * @return bool
  */
 public function isAvailable()
 {
     if (!static::supportsCurrency(Isotope::getConfig()->currency)) {
         return false;
     }
     return parent::isAvailable();
 }
开发者ID:rpquadrat,项目名称:core,代码行数:12,代码来源:EPay.php

示例5: isAvailable

 /**
  * Paybyway only supports EUR currency
  * @return  bool
  */
 public function isAvailable()
 {
     $objConfig = Isotope::getConfig();
     if (null === $objConfig || $objConfig->currency != 'EUR') {
         return false;
     }
     return parent::isAvailable();
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:12,代码来源:Paybyway.php

示例6: compile

 /**
  * Compile the module
  * @return void
  */
 protected function compile()
 {
     $arrConfigs = array();
     $objConfigs = Config::findMultipleByIds($this->iso_config_ids);
     if (null !== $objConfigs) {
         while ($objConfigs->next()) {
             $arrConfigs[] = array('config' => $objConfigs->current(), 'label' => $objConfigs->current()->getLabel(), 'active' => Isotope::getConfig()->id == $objConfigs->id ? true : false, 'href' => \Environment::get('request') . (strpos(\Environment::get('request'), '?') === false ? '?' : '&amp;') . 'config=' . $objConfigs->id);
         }
     }
     \Haste\Generator\RowClass::withKey('class')->addFirstLast()->applyTo($arrConfigs);
     $this->Template->configs = $arrConfigs;
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:16,代码来源:ConfigSwitcher.php

示例7: limitCountries

 /**
  * Limit the member countries to the selection in store config
  * @param string
  */
 public function limitCountries($strTable)
 {
     if ($strTable != 'tl_member' || !Isotope::getConfig()->limitMemberCountries) {
         return;
     }
     $arrCountries = array_unique(array_merge(Isotope::getConfig()->getBillingCountries(), Isotope::getConfig()->getShippingCountries()));
     $arrCountries = array_intersect_key($GLOBALS['TL_DCA']['tl_member']['fields']['country']['options'], array_flip($arrCountries));
     $GLOBALS['TL_DCA']['tl_member']['fields']['country']['options'] = $arrCountries;
     if (count($arrCountries) == 1) {
         $arrCountryCodes = array_keys($arrCountries);
         $GLOBALS['TL_DCA']['tl_member']['fields']['country']['default'] = $arrCountryCodes[0];
     }
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:17,代码来源:Callback.php

示例8: calculatePrice

 /**
  * Calculate a price, removing tax if included but not applicable
  *
  * @param float $fltPrice
  * @param array $arrAddresses
  *
  * @return float
  */
 public function calculatePrice($fltPrice, array $arrAddresses = null)
 {
     switch (Isotope::getConfig()->getPriceDisplay()) {
         case Config::PRICE_DISPLAY_NET:
             return $this->calculateNetPrice($fltPrice);
         case Config::PRICE_DISPLAY_GROSS:
             return $this->calculateGrossPrice($fltPrice, $arrAddresses);
         case Config::PRICE_DISPLAY_FIXED:
             return $fltPrice;
         case Config::PRICE_DISPLAY_LEGACY:
         default:
             return $this->calculateLegacyPrice($fltPrice, $arrAddresses);
     }
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:22,代码来源:TaxClass.php

示例9: isAvailable

 /**
  * SEPA only supports these currencies
  * @return  true
  */
 public function isAvailable()
 {
     if (!in_array(Isotope::getConfig()->currency, array('EUR'))) {
         return false;
     }
     if (!FE_USER_LOGGED_IN) {
         return false;
     } else {
         $user = \FrontendUser::getInstance();
         if (!isset($user->iso_sepa_active) || $user->iso_sepa_active != "1") {
             return false;
         }
     }
     return parent::isAvailable();
 }
开发者ID:comolo,项目名称:isotope-sepa_direct_debit,代码行数:19,代码来源:SepaDirectDeposit.php

示例10: getOrderLabel

 /**
  * Generate the order label and return it as string
  * @param   array
  * @param   string
  * @return  string
  */
 public function getOrderLabel($row, $label, \DataContainer $dc, $args)
 {
     /** @var Order $objOrder */
     $objOrder = Order::findByPk($row['id']);
     if (null === $objOrder) {
         return $args;
     }
     // Override system to correctly format currencies etc
     Isotope::setConfig($objOrder->getRelated('config_id'));
     $objAddress = $objOrder->getBillingAddress();
     if (null !== $objAddress) {
         $arrTokens = $objAddress->getTokens(Isotope::getConfig()->getBillingFieldsConfig());
         $args[2] = $arrTokens['hcard_fn'];
     }
     $args[3] = Isotope::formatPriceWithCurrency($row['grandTotal']);
     /** @var \Isotope\Model\OrderStatus $objStatus */
     if (($objStatus = $objOrder->getRelated('order_status')) !== null) {
         $args[4] = '<span style="' . $objStatus->getColorStyles() . '">' . $objOrder->getStatusLabel() . '</span>';
     } else {
         $args[4] = '<span>' . $objOrder->getStatusLabel() . '</span>';
     }
     return $args;
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:29,代码来源:Callback.php

示例11: createFromCollection

 /**
  * Initialize a new collection and duplicate everything from the source
  * @param   IsotopeProductCollection
  */
 public static function createFromCollection(IsotopeProductCollection $objSource)
 {
     global $objPage;
     $objCollection = new static();
     $objConfig = $objSource->getRelated('config_id');
     if (null === $objConfig) {
         $objConfig = Isotope::getConfig();
     }
     $objCollection->uniqid = uniqid(Haste::getInstance()->call('replaceInsertTags', array((string) $objConfig->orderPrefix, false)), true);
     $objCollection->source_collection_id = (int) $objSource->id;
     $objCollection->config_id = (int) $objConfig->id;
     $objCollection->store_id = (int) $objSource->store_id;
     $objCollection->member = (int) $objSource->member;
     $objCollection->language = (string) $GLOBALS['TL_LANGUAGE'];
     $objCollection->currency = (string) $objConfig->currency;
     $objCollection->pageId = (int) $objPage->id;
     $objCollection->setShippingMethod($objSource->getShippingMethod());
     $objCollection->setPaymentMethod($objSource->getPaymentMethod());
     $objCollection->setShippingAddress($objSource->getShippingAddress());
     $objCollection->setBillingAddress($objSource->getBillingAddress());
     $arrItemIds = $objCollection->copyItemsFrom($objSource);
     $arrSurchargeIds = $objCollection->copySurchargesFrom($objSource, $arrItemIds);
     $objCollection->updateDatabase();
     // HOOK: order status has been updated
     if (isset($GLOBALS['ISO_HOOKS']['createFromProductCollection']) && is_array($GLOBALS['ISO_HOOKS']['createFromProductCollection'])) {
         foreach ($GLOBALS['ISO_HOOKS']['createFromProductCollection'] as $callback) {
             $objCallback = \System::importStatic($callback[0]);
             $objCallback->{$callback}[1]($objCollection, $objSource, $arrItemIds, $arrSurchargeIds);
         }
     }
     return $objCollection;
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:36,代码来源:ProductCollection.php

示例12: generateUniqueId

 /**
  * Generate unique order ID including the order prefix
  *
  * @return string
  */
 protected function generateUniqueId()
 {
     if ($this->arrData['uniqid'] != '') {
         return $this->arrData['uniqid'];
     }
     $objConfig = $this->getRelated('config_id');
     if (null === $objConfig) {
         $objConfig = Isotope::getConfig();
     }
     return uniqid(Haste::getInstance()->call('replaceInsertTags', array((string) $objConfig->orderPrefix, false)), true);
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:16,代码来源:Order.php

示例13: getErrors

 /**
  * Get error messages for the cart
  * @return  array
  */
 public function getErrors()
 {
     $arrErrors = parent::getErrors();
     if (Isotope::getConfig()->cartMinSubtotal > 0 && Isotope::getConfig()->cartMinSubtotal > $this->getSubtotal()) {
         $arrErrors[] = sprintf($GLOBALS['TL_LANG']['ERR']['cartMinSubtotal'], Isotope::formatPriceWithCurrency(Isotope::getConfig()->cartMinSubtotal));
     }
     return $arrErrors;
 }
开发者ID:Aziz-JH,项目名称:core,代码行数:12,代码来源:Cart.php

示例14: getProductCacheExpiration

 /**
  * Returns the timestamp when the product cache expires
  * @return int
  */
 protected function getProductCacheExpiration()
 {
     $time = time();
     // Find timestamp when the next product becomes available
     $expires = (int) \Database::getInstance()->execute("SELECT MIN(start) AS expires FROM tl_iso_product WHERE start>{$time}")->expires;
     // Find
     if ($this->iso_newFilter == 'show_new' || $this->iso_newFilter == 'show_old') {
         $added = \Database::getInstance()->execute("SELECT MIN(dateAdded) FROM tl_iso_product WHERE dateAdded>" . Isotope::getConfig()->getNewProductLimit());
         if ($added < $expires) {
             $expires = $added;
         }
     }
     return $expires;
 }
开发者ID:rpquadrat,项目名称:core,代码行数:18,代码来源:ProductList.php

示例15: getTaxAddState

 /**
  * Get "add to total" state for tax rate
  *
  * @param bool $default The legacy state (if tax was included in backend price)
  *
  * @return bool
  */
 private static function getTaxAddState($default)
 {
     switch (Isotope::getConfig()->getPriceDisplay()) {
         case Config::PRICE_DISPLAY_NET:
             return true;
         case Config::PRICE_DISPLAY_GROSS:
         case Config::PRICE_DISPLAY_FIXED:
             return false;
         case Config::PRICE_DISPLAY_LEGACY:
         default:
             return $default;
     }
 }
开发者ID:ralfhartmann,项目名称:isotope_core,代码行数:20,代码来源:ProductCollectionSurcharge.php


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