本文整理汇总了PHP中Mage_Catalog_Model_Resource_Eav_Attribute::isScopeGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Eav_Attribute::isScopeGlobal方法的具体用法?PHP Mage_Catalog_Model_Resource_Eav_Attribute::isScopeGlobal怎么用?PHP Mage_Catalog_Model_Resource_Eav_Attribute::isScopeGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Resource_Eav_Attribute
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Resource_Eav_Attribute::isScopeGlobal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadProductPrices
/**
* Load product tier prices
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
* @return array
*/
public function loadProductPrices($product, $attribute)
{
$select = $this->_getReadAdapter()->select()->from($this->getMainTable(), array('website_id', 'all_groups', 'cust_group' => 'customer_group_id', 'price_qty' => 'qty', 'price' => 'value'))->where('entity_id=?', $product->getId())->order('qty');
if ($attribute->isScopeGlobal()) {
$select->where('website_id=?', 0);
} else {
if ($storeId = $product->getStoreId()) {
$select->where('website_id IN (?)', array(0, Mage::app()->getStore($storeId)->getWebsiteId()));
}
}
return $this->_getReadAdapter()->fetchAll($select);
}
示例2: deleteProductPrices
/**
* Delete product tier price data from storage
*
* @deprecated since 1.3.2.3
*
* @param Mage_Catalog_Model_Product $product
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
* @return Mage_Catalog_Model_Resource_Product_Attribute_Backend_Tierprice
*/
public function deleteProductPrices($product, $attribute)
{
$websiteId = null;
if (!$attribute->isScopeGlobal()) {
$storeId = $product->getProductId();
if ($storeId) {
$websiteId = Mage::app()->getStore($storeId)->getWebsiteId();
}
}
$this->deletePriceData($product->getId(), $websiteId);
return $this;
}