이 기능에 대한 사용자 지정 모듈을 만들 수 있습니다. 따라서 새 모듈에서는 Observer 이벤트 (checkout_onepage_controller_success_action)를 연결해야합니다. 그것은 특정 SKU에 따라 고객에게 이메일을 보낼 수 있습니다,이 sendEmailToCustomerForSales() 메소드에서,
<checkout_onepage_controller_success_action>
<observers>
<xxx_checkout_success>
<type>singleton</type>
<class>[Your Module Name]/observer</class>
<method>sendEmailToCustomerForSales</method>
</xxx_checkout_success>
</observers>
</checkout_onepage_controller_success_action>
을 그리고 : 당신은 다음과 같이 할 수 있습니다.
이 코드를 참조하십시오 :
public function sendEmailToCustomerForSales($observer) {
$orderId = (int)current($observer->getEvent()->getOrderIds());
$order = Mage::getModel('sales/order')->load($orderId);
$itemCollection = $order->getItemsCollection();
foreach($itemCollection as $item) {
$_product = Mage::getModel('catalog/product')->load($item->getProductId());
if($_product->getSku() == '[Your specific sku]') {
/*send an email to the customer*/
}
}
}
훌륭한 솔루션처럼 보인다. 전에 Magento 용 사용자 정의 모듈을 만들지는 않았지만 좋은 튜토리얼이있을 것입니다. 사용자 정의 속성을 사용할 때 위 코드를 어떻게 변경할 수 있습니까? 그건 분명히 갈 길 같습니다. –
도움이 정말 기쁩니다. 다음과 같이 사용자 지정 특성을 사용하려면 : if ($ product-> getSku() == ('123'| '234'|| '345')) {/// 이렇게하십시오. $ attrValue = $ product-> getResource() -> getAttribute ('your_attr_code') -> getFrontend() -> getValue ($ product); if ($ attrValue == '예') {/// – PixieMedia