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


PHP Mage_Eav_Model_Entity_Attribute_Abstract::getStoreId方法代码示例

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


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

示例1: createIndexData

 public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null)
 {
     $data = array();
     $data['store_id'] = $attribute->getStoreId();
     $data['entity_id'] = $object->getId();
     $data['attribute_id'] = $attribute->getId();
     $result = array();
     $values = $object->getData($attribute->getAttributeCode());
     if (!is_array($values)) {
         return $result;
     }
     foreach ($values as $row) {
         if (isset($row['delete']) && $row['delete']) {
             continue;
         }
         $data['qty'] = $row['price_qty'];
         $data['value'] = $row['price'];
         if ($row['cust_group'] == Mage_Customer_Model_Group::CUST_GROUP_ALL) {
             foreach ($this->_customerGroups as $group) {
                 $data['customer_group_id'] = $group->getId();
                 $result[] = $data;
             }
         } else {
             $data['customer_group_id'] = $row['cust_group'];
             $result[] = $data;
         }
     }
     return $result;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:29,代码来源:Tierprice.php

示例2: createIndexData

 public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null)
 {
     $data = array();
     $data['store_id'] = $attribute->getStoreId();
     $data['entity_id'] = $object->getId();
     $data['attribute_id'] = $attribute->getId();
     $data['value'] = $object->getData($attribute->getAttributeCode());
     if ($attribute->getFrontendInput() == 'multiselect') {
         $origData = $data;
         $data = array();
         $value = explode(',', $origData['value']);
         foreach ($value as $item) {
             $row = $origData;
             $row['value'] = $item;
             $data[] = $row;
         }
     }
     //return $this->_spreadDataForStores($object, $attribute, $data);
     return $data;
 }
开发者ID:jauderho,项目名称:magento-mirror,代码行数:20,代码来源:Eav.php

示例3: createIndexData

 public function createIndexData(Mage_Catalog_Model_Product $object, Mage_Eav_Model_Entity_Attribute_Abstract $attribute = null)
 {
     $data = array();
     $data['store_id'] = $attribute->getStoreId();
     $data['entity_id'] = $object->getId();
     $data['attribute_id'] = $attribute->getId();
     $data['value'] = $object->getData($attribute->getAttributeCode());
     if ($attribute->getAttributeCode() == 'price') {
         $result = array();
         foreach ($this->_customerGroups as $group) {
             $object->setCustomerGroupId($group->getId());
             $finalPrice = $object->getFinalPrice();
             $row = $data;
             $row['customer_group_id'] = $group->getId();
             $row['value'] = $finalPrice;
             $result[] = $row;
         }
         return $result;
     }
     return $data;
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:21,代码来源:Price.php

示例4: savePrices

 /**
  * Save Options prices (Depends from price save scope)
  *
  * @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
  * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Type_Configurable_Attribute
  */
 public function savePrices($attribute)
 {
     $newValues = $attribute->getValues();
     $oldValues = array();
     $valueIndexes = array();
     $select = $this->_getWriteAdapter()->select()->from($this->_priceTable)->where('product_super_attribute_id=?', $attribute->getId());
     $query = $this->_getWriteAdapter()->query($select);
     while ($row = $query->fetch()) {
         $key = join('-', array($row['website_id'], $row['value_index']));
         $oldValues[$key] = $row;
     }
     $delete = array();
     $insert = array();
     $update = array();
     foreach ($newValues as $value) {
         $valueIndexes[$value['value_index']] = $value['value_index'];
     }
     if ($this->getCatalogHelper()->isPriceGlobal()) {
         foreach ($oldValues as $row) {
             if (!isset($valueIndexes[$row['value_index']])) {
                 $delete[] = $row['value_id'];
                 continue;
             }
         }
         foreach ($newValues as $value) {
             $valueObject = new Varien_Object($value);
             $key = join('-', array(0, $value['value_index']));
             $pricingValue = $valueObject->getPricingValue();
             if ($pricingValue == '' || is_null($pricingValue)) {
                 $pricingValue = null;
             } else {
                 $pricingValue = Mage::app()->getLocale()->getNumber($pricingValue);
             }
             // update
             if (isset($oldValues[$key])) {
                 $oldValue = $oldValues[$key];
                 $update[$oldValue['value_id']] = array('pricing_value' => $pricingValue, 'is_percent' => intval($valueObject->getIsPercent()));
             } else {
                 if (!empty($value['pricing_value'])) {
                     $insert[] = array('product_super_attribute_id' => $attribute->getId(), 'value_index' => $valueObject->getValueIndex(), 'is_percent' => intval($valueObject->getIsPercent()), 'pricing_value' => $pricingValue, 'website_id' => 0);
                 }
             }
         }
     } else {
         $websiteId = Mage::app()->getStore($attribute->getStoreId())->getWebsiteId();
         foreach ($oldValues as $row) {
             if (!isset($valueIndexes[$row['value_index']])) {
                 $delete[] = $row['value_id'];
                 continue;
             }
         }
         foreach ($newValues as $value) {
             $valueObject = new Varien_Object($value);
             $key = join('-', array($websiteId, $value['value_index']));
             $pricingValue = $valueObject->getPricingValue();
             if ($pricingValue == '' || is_null($pricingValue)) {
                 $pricingValue = null;
             } else {
                 $pricingValue = Mage::app()->getLocale()->getNumber($pricingValue);
             }
             // update
             if (isset($oldValues[$key])) {
                 $oldValue = $oldValues[$key];
                 if ($websiteId && $valueObject->getUseDefaultValue()) {
                     $delete[] = $oldValue['value_id'];
                 } else {
                     $update[$oldValue['value_id']] = array('pricing_value' => $pricingValue, 'is_percent' => intval($valueObject->getIsPercent()));
                 }
             } else {
                 if ($websiteId && $valueObject->getUseDefaultValue()) {
                     continue;
                 }
                 $insert[] = array('product_super_attribute_id' => $attribute->getId(), 'value_index' => $valueObject->getValueIndex(), 'is_percent' => intval($valueObject->getIsPercent()), 'pricing_value' => $pricingValue, 'website_id' => $websiteId);
             }
             $key = join('-', array(0, $value['value_index']));
             if (!isset($oldValues[$key])) {
                 $insert[] = array('product_super_attribute_id' => $attribute->getId(), 'value_index' => $valueObject->getValueIndex(), 'is_percent' => 0, 'pricing_value' => null, 'website_id' => 0);
             }
         }
     }
     if (!empty($delete)) {
         $where = $this->_getWriteAdapter()->quoteInto('value_id IN(?)', $delete);
         $this->_getWriteAdapter()->delete($this->_priceTable, $where);
     }
     if (!empty($update)) {
         foreach ($update as $valueId => $valueData) {
             $where = $this->_getWriteAdapter()->quoteInto('value_id=?', $valueId);
             $this->_getWriteAdapter()->update($this->_priceTable, $valueData, $where);
         }
     }
     if (!empty($insert)) {
         foreach ($insert as $valueData) {
             $this->_getWriteAdapter()->insert($this->_priceTable, $valueData);
         }
//.........这里部分代码省略.........
开发者ID:jauderho,项目名称:magento-mirror,代码行数:101,代码来源:Attribute.php


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