주문이 가상 제품이 포함 된 경우 전자 메일 템플릿에 텍스트 추가

magento.stackexchange https://magento.stackexchange.com//questions/43222

  •  12-12-2019
  •  | 
  •  

문제

가상 제품 기능을 사용하여 티켓을 판매하는 것을 생각하고 있습니다.따라서 가상 제품이있는 경우에만 전자 메일 템플릿에 텍스트를 추가하고 싶습니다.이것이 가능합니까?

도움이 되었습니까?

해결책

쉽게 이동하는 방법 중 하나는 전자 메일에 pthml 파일을 포함하는 것입니다

이메일 템플릿에 텍스트를 표시 할 위치에 아래 코드를 추가

{{block type='core/template' area='frontend' template='<module_name>/orderemail.phtml' order=$order}}
.

템플리트 파일 / 디렉터리

$_order = this->getOrder()
$hasVirtual = false;

 $items = $order->getAllVisibleItems();
 foreach($items as $i){
    if( $i->->getIsVirtual()){
         $hasVirtual = true;
    }
 }

 if($hasVirtual){
    echo 'text here
 }
.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top