Magento 커뮤니티 에디션 1.4의 인덱스 관리에서 사용자 지정 인덱서를 만들려고하는데,이 사용자 지정 인덱서의 주된 목적은 일련의 계산을 기반으로 사용자 지정 제품 특성을 업데이트하는 것입니다.Magento CE 1.4 인덱서 - 인덱스 관리
나는 마젠토 핵심 코드를 조사하고 필요한 것과 비슷한 것을 만들었지 만 주제에 대한 충분한 문서를 찾을 수 없었습니다.
내가 지금까지 가지고이 : 나는 나의 새로운 사용자 정의 인덱서를 볼 수 있었다이 코드를 실행 한 후 모델
class MyModule_Custom_Model_Indexer_Price extends Mage_Index_Model_Indexer_Abstract
{
protected $_matchedEntities = array(
Mage_Catalog_Model_Product::ENTITY => array(
Mage_Index_Model_Event::TYPE_SAVE,
Mage_Index_Model_Event::TYPE_DELETE,
Mage_Index_Model_Event::TYPE_MASS_ACTION
)
);
/**
* Initialize resource model
*
*/
protected function _construct()
{
$this->_init('custome/indexer_price');
}
public function getName()
{
return Mage::helper('customizer')->__('Customizable Products');
}
public function getDescription()
{
return Mage::helper('customizer')->__('Index Customizable Product Prices');
}
public function matchEvent(Mage_Index_Model_Event $event) {
Mage::log("Should I match an event: ".$event->getEntity() . '|'. $event->getType());
return true;
}
protected function _registerEvent(Mage_Index_Model_Event $event) {
Mage::log("Should I register an event: ".$event->getEntity() . '|'. $event->getType());
}
protected function _processEvent(Mage_Index_Model_Event $event) {
Mage::log("Should I process an event: ".$event->getEntity() . '|'. $event->getType());
}
public function reindexAll() {
Mage::log('Do my processing to reindex');
}
}
을 만들어
config.xml에
<?xml version="1.0"?>
<config>
<!-- configuration -->
<global>
<index>
<indexer>
<custom_product_price>
<model>custom/indexer_price</model>
</custom_product_price>
</indexer>
</index>
</global>
<!-- configuration -->
</config>
을 다음 색인 관리 그리드에서 항목을 선택했지만 reindex 작업을 실행했을 때 reindexAll() 메서드가 방금 발생했습니다.
어떤 아이디어라도 도움이 될 수 있으며 미리 감사드립니다.
실제로 여기에서 무엇을 묻고 있는지 확실하지 않은가요? – edmondscommerce