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

PHP Mage_Core_Model_Website类代码示例

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

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



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

示例1: exportSubscribersPerWebsite

 /**
  * Export subscriber per website.
  * @param Mage_Core_Model_Website $website
  *
  * @return int
  */
 public function exportSubscribersPerWebsite(Mage_Core_Model_Website $website)
 {
     $updated = 0;
     $fileHelper = Mage::helper('ddg/file');
     $limit = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_SYNC_LIMIT);
     $subscribers = Mage::getModel('ddg_automation/contact')->getSubscribersToImport($website, $limit);
     if (count($subscribers)) {
         $subscribersFilename = strtolower($website->getCode() . '_subscribers_' . date('d_m_Y_Hi') . '.csv');
         //get mapped storename
         $subscriberStorename = Mage::helper('ddg')->getMappedStoreName($website);
         //file headers
         $fileHelper->outputCSV($fileHelper->getFilePath($subscribersFilename), array('Email', 'emailType', $subscriberStorename));
         foreach ($subscribers as $subscriber) {
             try {
                 $email = $subscriber->getEmail();
                 $subscriber->setSubscriberImported(1)->save();
                 $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($email);
                 $storeName = Mage::app()->getStore($subscriber->getStoreId())->getName();
                 // save data for subscribers
                 $fileHelper->outputCSV($fileHelper->getFilePath($subscribersFilename), array($email, 'Html', $storeName));
                 $updated++;
             } catch (Exception $e) {
                 Mage::logException($e);
             }
         }
         Mage::helper('ddg')->log('Subscriber filename: ' . $subscribersFilename);
         //register in queue with importer
         Mage::getModel('ddg_automation/importer')->registerQueue(Dotdigitalgroup_Email_Model_Importer::IMPORT_TYPE_SUBSCRIBERS, '', Dotdigitalgroup_Email_Model_Importer::MODE_BULK, $website->getId(), $subscribersFilename);
     }
     //add updated number for the website
     $this->_countSubscriber += $updated;
     return $updated;
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:39,代码来源:Subscriber.php


示例2: _prepareTemporarySelect

 /**
  * Prepare temporary data
  *
  * @param Mage_Core_Model_Website $website
  * @return Varien_Db_Select
  */
 protected function _prepareTemporarySelect(Mage_Core_Model_Website $website)
 {
     /** @var $catalogFlatHelper Mage_Catalog_Helper_Product_Flat */
     $catalogFlatHelper = $this->_factory->getHelper('catalog/product_flat');
     /** @var $eavConfig Mage_Eav_Model_Config */
     $eavConfig = $this->_factory->getSingleton('eav/config');
     $priceAttribute = $eavConfig->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'price');
     //magebrew: get Cost attribute
     $costAttribute = $eavConfig->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'cost');
     $select = $this->_connection->select()->from(array('rp' => $this->_resource->getTable('catalogrule/rule_product')), array())->joinInner(array('r' => $this->_resource->getTable('catalogrule/rule')), 'r.rule_id = rp.rule_id', array())->where('rp.website_id = ?', $website->getId())->order(array('rp.product_id', 'rp.customer_group_id', 'rp.sort_order', 'rp.rule_product_id'))->joinLeft(array('pg' => $this->_resource->getTable('catalog/product_attribute_group_price')), 'pg.entity_id = rp.product_id AND pg.customer_group_id = rp.customer_group_id' . ' AND pg.website_id = rp.website_id', array())->joinLeft(array('pgd' => $this->_resource->getTable('catalog/product_attribute_group_price')), 'pgd.entity_id = rp.product_id AND pgd.customer_group_id = rp.customer_group_id' . ' AND pgd.website_id = 0', array());
     $storeId = $website->getDefaultStore()->getId();
     if ($catalogFlatHelper->isEnabled() && $storeId && $catalogFlatHelper->isBuilt($storeId)) {
         $select->joinInner(array('p' => $this->_resource->getTable('catalog/product_flat') . '_' . $storeId), 'p.entity_id = rp.product_id', array());
         $priceColumn = $this->_connection->getIfNullSql($this->_connection->getIfNullSql('pg.value', 'pgd.value'), 'p.price');
         //magebrew: Cost column select for Flat catalog
         $costColumn = $this->_connection->getIfNullSql('p.cost', 0);
     } else {
         $select->joinInner(array('pd' => $this->_resource->getTable(array('catalog/product', $priceAttribute->getBackendType()))), 'pd.entity_id = rp.product_id AND pd.store_id = 0 AND pd.attribute_id = ' . $priceAttribute->getId(), array())->joinLeft(array('p' => $this->_resource->getTable(array('catalog/product', $priceAttribute->getBackendType()))), 'p.entity_id = rp.product_id AND p.store_id = ' . $storeId . ' AND p.attribute_id = pd.attribute_id', array())->joinLeft(array('pc' => $this->_resource->getTable(array('catalog/product', $costAttribute->getBackendType()))), 'pc.entity_id = rp.product_id AND pc.store_id = 0 AND pc.attribute_id = ' . $costAttribute->getId(), array());
         $priceColumn = $this->_connection->getIfNullSql($this->_connection->getIfNullSql('pg.value', 'pgd.value'), $this->_connection->getIfNullSql('p.value', 'pd.value'));
         //magebrew: Cost column select for Eav catalog
         $costColumn = $this->_connection->getIfNullSql('pc.value', 0);
     }
     $select->columns(array('grouped_id' => $this->_connection->getConcatSql(array('rp.product_id', 'rp.customer_group_id'), '-'), 'product_id' => 'rp.product_id', 'customer_group_id' => 'rp.customer_group_id', 'from_date' => 'r.from_date', 'to_date' => 'r.to_date', 'action_amount' => 'rp.action_amount', 'action_operator' => 'rp.action_operator', 'action_stop' => 'rp.action_stop', 'sort_order' => 'rp.sort_order', 'price' => $priceColumn, 'cost' => $costColumn, 'rule_product_id' => 'rp.rule_product_id', 'from_time' => 'rp.from_time', 'to_time' => 'rp.to_time'));
     return $select;
 }
开发者ID:magebrew,项目名称:CatalogRule,代码行数:31,代码来源:Refresh.php


示例3: _getCollection

 /**
  * filter $collection by the cutoff date.
  * @param  string                    $cutoffDate
  * @param  Mage_Core_Model_Website   $website
  * @return Varien_Data_Collection_Db
  */
 protected function _getCollection($cutoffDate, Mage_Core_Model_Website $website)
 {
     $collection = Mage::getResourceModel('catalog/product_collection');
     $collection->addAttributeToSelect('entity_id');
     if ($cutoffDate) {
         $collection->addFieldToFilter('updated_at', array('gteq' => $cutoffDate));
     }
     $collection->addWebsiteFilter(array($website->getId()));
     return $collection;
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:16,代码来源:Price.php


示例4: _getChangedStoresForWebsite

 /**
  * @param Mage_Core_Model_Website $website
  * @return array
  */
 protected function _getChangedStoresForWebsite($website)
 {
     $changedStores = array();
     foreach ($website->getStores() as $store) {
         /** @var Mage_Core_Model_Store $store */
         if ($this->_isValueChanged($store, $website)) {
             $changedStores[Mage::helper('scopehint')->__('Store View: %s', $this->_getFullStoreName($store))] = $this->_getReadableConfigValue($store);
         }
     }
     return $changedStores;
 }
开发者ID:therouv,项目名称:AvS_ScopeHint,代码行数:15,代码来源:Hint.php


示例5: _saveWebsiteConfigItems

 private function _saveWebsiteConfigItems(array $configs, Mage_Core_Model_Website $website)
 {
     try {
         if (!$website->getId()) {
             throw new Exception($this->__('Website does not exist'));
         }
         if (!empty($configs)) {
             foreach ($configs as $config) {
                 if (isset($config['encrypted']) && $config['encrypted'] == 1) {
                     $config['value'] = Mage::helper('core')->encrypt($config['value']);
                 }
                 // Save config
                 $this->_checkAndSaveConfig($config['path'], $config['value'], 'websites', $website->getId(), $website->getCode());
             }
         }
     } catch (Exception $e) {
         $this->log($e->getMessage());
     }
 }
开发者ID:ThomasNegeli,项目名称:magento-configurator,代码行数:19,代码来源:Config.php


示例6: _addWebsiteFieldset

 /**
  * Method add website fieldset to the form.
  * @param Mage_Core_Model_Website $website
  */
 private function _addWebsiteFieldset($website, $form)
 {
     $prefixWeb = 'website-' . $website->getCode();
     /* make fieldset */
     $layoutFieldset = $form->addFieldset($prefixWeb . '_fieldset', array('legend' => Mage::helper('mturbo')->__($website->getName() . ' settings'), 'class' => 'fieldset'));
     /* add extra user control */
     $layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
     $layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
     /* indicator whether website is enabled */
     $layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => Mage::helper('mturbo')->__('Enable website') . ':', 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
     /* add field for turbopath */
     $layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'value' => Mage::getBaseDir(), 'label' => Mage::helper('mturbo')->__('Base directory') . ':'));
     /* add field for server name */
     $layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'value' => Mage::helper('mturbo/website')->getServerName($website->getDefaultStore()->getCode()), 'label' => Mage::helper('mturbo')->__('Server name') . ':'));
     /* every store has one select determines whether enabled is */
     foreach ($website->getStores() as $store) {
         if ($store->getIsActive()) {
             $layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'value' => '1', 'options' => array(0 => Mage::helper('mturbo')->__('No'), 1 => Mage::helper('mturbo')->__('Yes'))));
         }
     }
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:25,代码来源:Form.php


示例7: _addWebsiteFieldset

 /**
  * Method add website fieldset to the form.
  * @param Mage_Core_Model_Website $website
  */
 private function _addWebsiteFieldset($website)
 {
     $prefixWeb = 'website-' . $website->getCode();
     /* make fieldset */
     $layoutFieldset = $this->form->addFieldset($prefixWeb . '_fieldset', array('legend' => $this->getMyHelper()->__($website->getName() . ' settings'), 'class' => 'fieldset'));
     /* add extra user control */
     $layoutFieldset->addType('html_element', Artio_MTurbo_Helper_Data::FORM_HTML);
     $layoutFieldset->addType('widget_button', Artio_MTurbo_Helper_Data::FORM_WIDGET_BUTTON);
     /* indicator whether website is enabled */
     $layoutFieldset->addField($prefixWeb . '-enabled', 'select', array('name' => $prefixWeb . '-enabled', 'label' => $this->getMyHelper()->__('Enable website') . ':', 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
     /* add field for base dir */
     $layoutFieldset->addField($prefixWeb . '-base_dir', 'text', array('name' => $prefixWeb . '-base_dir', 'label' => $this->getMyHelper()->__('Base directory') . ':'));
     /* add field for server name */
     $layoutFieldset->addField($prefixWeb . '-server_name', 'text', array('name' => $prefixWeb . '-server_name', 'label' => $this->getMyHelper()->__('Server name') . ':'));
     $layoutFieldset->addField($prefixWeb . '_dec1', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Enable/Disable Storeview') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
     /* every store has one select determines whether enabled is */
     foreach ($website->getStores() as $store) {
         if ($store->getIsActive()) {
             $layoutFieldset->addField($prefixWeb . '-store-' . $store->getCode(), 'select', array('name' => $prefixWeb . '-store-' . $store->getCode(), 'label' => $store->getGroup()->getName() . '<br />' . $store->getName(), 'options' => array(0 => $this->getMyHelper()->__('No'), 1 => $this->getMyHelper()->__('Yes'))));
         }
     }
     $layoutFieldset->addField($prefixWeb . '_dec2', 'html_element', array('label' => '<h4>' . $this->getMyHelper()->__('Htaccess settings') . '</h4>', 'code' => '<div style="height:10px;border-bottom:1px solid #808080"></div>'));
     /* get htaccess state and set color by it */
     $htaccess = Mage::getModel('mturbo/htaccess')->setWebsiteCode($website->getCode());
     $state = '';
     $pathToHtaccess = $htaccess->getPathToBaseHtaccess();
     $color = Mage::helper('mturbo/functions')->get_file_state($pathToHtaccess, $state, 'ew') ? 'green' : 'red';
     $layoutFieldset->addField($prefixWeb . '_dec3', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess path'), 'code' => '<span>' . $pathToHtaccess . '</span>'));
     $edit = $htaccess->isEditedByMTurbo() ? 'yes' : 'no';
     $layoutFieldset->addField($prefixWeb . '_dec5', 'html_element', array('label' => $this->getMyHelper()->__('Edited by MTurbo'), 'code' => '<span><b>' . $this->getMyHelper()->__($edit) . '</b></span>'));
     $layoutFieldset->addField($prefixWeb . '_dec4', 'html_element', array('label' => $this->getMyHelper()->__('File .htaccess state'), 'code' => '<span style="color:' . $color . '">' . $this->getMyHelper()->__($state) . '</span>'));
     /* button 'rebuild' show only if htaccess is ready */
     if ($color == 'green') {
         $layoutFieldset->addField($prefixWeb . '_htaccess_button', 'widget_button', array('name' => $prefixWeb . '_htaccess_button', 'label' => $this->getMyHelper()->__('Rebuild .htaccess for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/htaccessbuild', array('websitecode' => $website->getCode())) . "')"));
     }
     $layoutFieldset->addField($prefixWeb . '_urllist_button', 'widget_button', array('name' => $prefixWeb . '_urllist_button', 'label' => $this->getMyHelper()->__('Generate URL list for this website'), 'onclick' => "setLocation('" . Mage::helper('adminhtml')->getUrl('*/*/generateurllist', array('websitecode' => $website->getCode())) . "')"));
 }
开发者ID:AmineCherrai,项目名称:rostanvo,代码行数:41,代码来源:Website.php


示例8: clearWebsiteCache

 /**
  *  Unset website by id from app cache
  *
  * @param null|bool|int|string|Mage_Core_Model_Website $id
  * @return void
  */
 public function clearWebsiteCache($id = null)
 {
     if (is_null($id)) {
         $id = $this->getStore()->getWebsiteId();
     } elseif ($id instanceof Mage_Core_Model_Website) {
         $id = $id->getId();
     } elseif ($id === true) {
         $id = $this->_website->getId();
     }
     if (!empty($this->_websites[$id])) {
         $website = $this->_websites[$id];
         unset($this->_websites[$website->getWebsiteId()]);
         unset($this->_websites[$website->getCode()]);
     }
 }
开发者ID:mswebdesign,项目名称:Mswebdesign_Magento_1_Community_Edition,代码行数:21,代码来源:App.php


示例9: _calculateSpecialPrice

 /**
  * Apply special price
  *
  * @param float $finalPrice
  * @param array $priceData
  * @param Mage_Core_Model_Website $website
  * @return float
  */
 public function _calculateSpecialPrice($finalPrice, array $priceData, Mage_Core_Model_Website $website)
 {
     $store = $website->getDefaultStore();
     $specialPrice = $priceData['special_price'];
     if (!is_null($specialPrice) && $specialPrice != false) {
         if (Mage::app()->getLocale()->isStoreDateInInterval($store, $priceData['special_from_date'], $priceData['special_to_date'])) {
             $specialPrice = $finalPrice * $specialPrice / 100;
             $finalPrice = min($finalPrice, $specialPrice);
         }
     }
     return $finalPrice;
 }
开发者ID:cnglobal-sl,项目名称:caterez,代码行数:20,代码来源:Index.php


示例10: setWebsite

 /**
  * Set Website scope
  *
  * @param Mage_Core_Model_Website|int $website
  * @return Mage_Eav_Model_Resource_Attribute_Collection
  */
 public function setWebsite($website)
 {
     $this->_website = Mage::app()->getWebsite($website);
     $this->addBindParam('scope_website_id', $this->_website->getId());
     return $this;
 }
开发者ID:relue,项目名称:magento2,代码行数:12,代码来源:Collection.php


示例11: updateDataFields

 /**
  * update data fields
  *
  * @param $email
  * @param Mage_Core_Model_Website $website
  * @param $storeName
  */
 public function updateDataFields($email, Mage_Core_Model_Website $website, $storeName)
 {
     $data = array();
     if ($store_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_STORE_NAME)) {
         $data[] = array('Key' => $store_name, 'Value' => $storeName);
     }
     if ($website_name = $website->getConfig(Dotdigitalgroup_Email_Helper_Config::XML_PATH_CONNECTOR_CUSTOMER_WEBSITE_NAME)) {
         $data[] = array('Key' => $website_name, 'Value' => $website->getName());
     }
     if (!empty($data)) {
         //update data fields
         $client = $this->getWebsiteApiClient($website);
         $client->updateContactDatafieldsByEmail($email, $data);
     }
 }
开发者ID:vdimitrovv,项目名称:dotmailer-magento-extension,代码行数:22,代码来源:Data.php


示例12: _removeOldIndexData

 /**
  * Remove old index data
  *
  * @param Mage_Core_Model_Website $website
  */
 protected function _removeOldIndexData(Mage_Core_Model_Website $website)
 {
     $this->_connection->delete($this->_resource->getTable('catalogrule/rule_product_price'), array('website_id = ?' => $website->getId()));
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:9,代码来源:Refresh.php


示例13: getGroupCollection

 public function getGroupCollection(Mage_Core_Model_Website $website)
 {
     return $website->getGroups();
 }
开发者ID:cewolf2002,项目名称:magento,代码行数:4,代码来源:Websites.php


示例14: _removeOldIndexData

 /**
  * Remove old index data
  *
  * @param Mage_Core_Model_Website $website
  */
 protected function _removeOldIndexData(Mage_Core_Model_Website $website)
 {
     $this->_connection->query($this->_connection->deleteFromSelect($this->_connection->select()->from($this->_resource->getTable('catalogrule/rule_product_price'))->where('product_id IN (?)', $this->_productId)->where('website_id = ?', $website->getId()), $this->_resource->getTable('catalogrule/rule_product_price')));
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:9,代码来源:Row.php


示例15: _processSegmentsValidation

 /**
  * Check if customer is related to segments and update customer-segment relations
  *
  * @param int|null|Mage_Customer_Model_Customer $customer
  * @param Mage_Core_Model_Website $website
  * @param Enterprise_CustomerSegment_Model_Resource_Segment_Collection $segments
  * @return Enterprise_CustomerSegment_Model_Customer
  */
 protected function _processSegmentsValidation($customer, $website, $segments)
 {
     $websiteId = $website->getId();
     if ($customer instanceof Mage_Customer_Model_Customer) {
         $customerId = $customer->getId();
     } else {
         $customerId = $customer;
     }
     $matchedIds = array();
     $notMatchedIds = array();
     $useVisitorId = !$customer || !$customerId;
     foreach ($segments as $segment) {
         if ($useVisitorId) {
             // Skip segment if it cannot be applied to visitor
             if ($segment->getApplyTo() == Enterprise_CustomerSegment_Model_Segment::APPLY_TO_REGISTERED) {
                 continue;
             }
             $segment->setVisitorId(Mage::getSingleton('log/visitor')->getId());
         } else {
             // Skip segment if it cannot be applied to customer
             if ($segment->getApplyTo() == Enterprise_CustomerSegment_Model_Segment::APPLY_TO_VISITORS) {
                 continue;
             }
         }
         $isMatched = $segment->validateCustomer($customer, $website);
         if ($isMatched) {
             $matchedIds[] = $segment->getId();
         } else {
             $notMatchedIds[] = $segment->getId();
         }
     }
     if ($customerId) {
         $this->addCustomerToWebsiteSegments($customerId, $websiteId, $matchedIds);
         $this->removeCustomerFromWebsiteSegments($customerId, $websiteId, $notMatchedIds);
         $segmentIds = $this->_customerWebsiteSegments[$websiteId][$customerId];
     } else {
         $this->addVisitorToWebsiteSegments(Mage::getSingleton('customer/session'), $websiteId, $matchedIds);
         $this->removeVisitorFromWebsiteSegments(Mage::getSingleton('customer/session'), $websiteId, $notMatchedIds);
         $allSegments = Mage::getSingleton('customer/session')->getCustomerSegmentIds();
         $segmentIds = $allSegments[$websiteId];
     }
     Mage::dispatchEvent('enterprise_customersegment_ids_changed', array('segment_ids' => $segmentIds));
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:52,代码来源:Customer.php


示例16: addStockStatusToSelect

 /**
  * Add stock status to prepare index select
  *
  * @param Varien_Db_Select $select
  * @param Mage_Core_Model_Website $website
  * @return Mage_CatalogInventory_Model_Resource_Stock_Status
  */
 public function addStockStatusToSelect(Varien_Db_Select $select, Mage_Core_Model_Website $website)
 {
     $websiteId = $website->getId();
     $select->joinLeft(array('stock_status' => $this->getMainTable()), 'e.entity_id = stock_status.product_id AND stock_status.website_id=' . $websiteId, array('salable' => 'stock_status.stock_status'));
     return $this;
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Status.php


示例17: _walkCollectionRelation

 /**
  * Walk Product Collection for Relation Parent products
  *
  * @param Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection $collection
  * @param Mage_Core_Model_Store|Mage_Core_Model_Website $store
  * @param array $attributes
  * @param array $prices
  * @return Mage_CatalogIndex_Model_Indexer
  */
 public function _walkCollectionRelation($collection, $store, $attributes = array(), $prices = array())
 {
     if ($store instanceof Mage_Core_Model_Website) {
         $storeObject = $store->getDefaultStore();
     } elseif ($store instanceof Mage_Core_Model_Store) {
         $storeObject = $store;
     }
     $statusCond = array('in' => Mage::getSingleton('catalog/product_status')->getSaleableStatusIds());
     $productCount = $collection->getSize();
     $iterateCount = $productCount / self::STEP_SIZE;
     for ($i = 0; $i < $iterateCount; $i++) {
         $stepData = $collection->getAllIds(self::STEP_SIZE, $i * self::STEP_SIZE);
         foreach ($this->_getPriorifiedProductTypes() as $type) {
             $retriever = $this->getRetreiver($type);
             if (!$retriever->getTypeInstance()->isComposite()) {
                 continue;
             }
             $parentIds = $retriever->getTypeInstance()->getParentIdsByChild($stepData);
             if ($parentIds) {
                 $parentCollection = $this->_getProductCollection($storeObject, $parentIds);
                 $parentCollection->addAttributeToFilter('status', $statusCond);
                 $parentCollection->addFieldToFilter('type_id', $type);
                 $this->_walkCollection($parentCollection, $storeObject, $attributes, $prices);
                 $this->_afterPlainReindex($store, $parentIds);
             }
         }
     }
     return $this;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:38,代码来源:Indexer.php


示例18: _getLocation

 /**
  * Get resource location
  *
  * @param Mage_Core_Model_Website $website
  * @return string URL
  */
 protected function _getLocation($website)
 {
     /* @var $apiTypeRoute Mage_Api2_Model_Route_ApiType */
     $apiTypeRoute = Mage::getModel('api2/route_apiType');
     $chain = $apiTypeRoute->chain(new Zend_Controller_Router_Route($this->getConfig()->getRouteWithEntityTypeAction($this->getResourceType())));
     $params = array('api_type' => $this->getRequest()->getApiType(), 'product_id' => $this->getRequest()->getParam('product_id'), 'website_id' => $website->getId());
     $uri = $chain->assemble($params);
     return '/' . $uri;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:15,代码来源:Rest.php


示例19: _initWebsiteStore

 /**
  * Init Website Store Elements
  *
  * @param Varien_Data_Form $form
  * @param Mage_Core_Model_Website $masterWebsite
  * @param Mage_Core_Model_Website $stagingWebsite
  * @return Enterprise_Staging_Block_Manage_Staging_Edit_Tabs_Website
  */
 protected function _initWebsiteStore($form, $masterWebsite, $stagingWebsite = null)
 {
     if (empty($masterWebsite)) {
         return $this;
     }
     if ($stagingWebsite) {
         $fieldset = $form->addFieldset('staging_website_stores', array('legend' => Mage::helper('enterprise_staging')->__('Store Views to Copy')));
     } else {
         $fieldset = $form->addFieldset('staging_website_stores', array('legend' => Mage::helper('enterprise_staging')->__('Select Original Website Store Views to be Copied to Staging Website')));
     }
     if ($stagingWebsite) {
         $_storeGroups = $stagingWebsite->getGroups();
         $_storeGroupsCount = $stagingWebsite->getGroupsCount();
     } else {
         $_storeGroups = $masterWebsite->getGroups();
         $_storeGroupsCount = $masterWebsite->getGroupsCount();
     }
     $noStores = true;
     foreach ($_storeGroups as $group) {
         if ($group->getStoresCount()) {
             $noStores = false;
             $_stores = $group->getStores();
             $this->_initStoreGroup($fieldset, $group, $stagingWebsite);
             foreach ($_stores as $storeView) {
                 $this->_initStoreView($fieldset, $storeView, $stagingWebsite);
             }
         }
     }
     if ($noStores) {
         if ($stagingWebsite) {
             $fieldset->addField('staging_no_stores', 'label', array('label' => Mage::helper('enterprise_staging')->__('There are no store views to be copied.')));
         } else {
             $fieldset->addField('staging_no_stores', 'label', array('label' => Mage::helper('enterprise_staging')->__('There are no store views for copying.')));
         }
     }
     return $this;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:45,代码来源:Website.php


示例20: isWebsiteAssignedToProduct

 /**
  * Validate is valid association for website unassignment from product.
  * If fails validation, then this method returns false, and
  * getErrors() will return an array of errors that explain why the
  * validation failed.
  *
  * @param Mage_Core_Model_Website $website
  * @param Mage_Catalog_Model_Product $product
  * @return bool
  */
 public function isWebsiteAssignedToProduct(Mage_Core_Model_Website $website, Mage_Catalog_Model_Product $product)
 {
     if (false === array_search($website->getId(), $product->getWebsiteIds())) {
         $this->_addError(sprintf('Product #%d isn\'t assigned to website #%d', $product->getId(), $website->getId()));
     }
     return !count($this->getErrors());
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:17,代码来源:Website.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Mage_Customer_Block_Widget_Abstract类代码示例发布时间:2022-05-23
下一篇:
PHP Mage_Core_Model_Store类代码示例发布时间: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