Expand order status notification

  • Posts: 45
  • Thank you received: 2
13 years 1 month ago #49423

Hi,

my aim is to expand the order status notification email (possible in HikaShop Business) like this:
a) add a specific text if status is changed to confirmed
b) add a specific text if status is changed to confirmed AND a specific product (product_name: "My first product") from a specific product_category was bought

So far I solved a) like this (or possibly the code existed in the mail before):

if($data->mail_status === 'bezahlt') {
    echo JText::sprintf('Confirming order number. %s on %s.',$url,HIKASHOP_LIVE);
    }
    else {
        echo JText::sprintf('ORDER_STATUS_CHANGED_TO',$url,$data->mail_status);
    }
}

To solve b) I am lacking the if condition for my product in the specific product category.
I would appreciate any helping sample code.

Best,

KB

Last edit: 13 years 1 month ago by klimmbimm.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
13 years 1 month ago #49466

Hello,

I think that you can use this sample code for your condition :

foreach($data->cart->products as $item){
   if($data->mail_status === 'bezahlt' && $item->order_product_name == 'My first product' ){
     echo '......';
   }
   else{
     echo '......';
   }
}

Furthermore, you will have to use your code in the file " media/com_hikashop/mail/order_status_notification.html.php ".

Last edit: 13 years 1 month ago by Mohamed Thelji.
The following user(s) said Thank You: klimmbimm

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum