本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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 ? '?' : '&') . 'config=' . $objConfigs->id);
}
}
\Haste\Generator\RowClass::withKey('class')->addFirstLast()->applyTo($arrConfigs);
$this->Template->configs = $arrConfigs;
}
示例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];
}
}
示例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);
}
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
}