- Posts: 72
- Thank you received: 0
Custom HTML in confirm email if product present
- daveturner101
-
Topic Author
- Offline
I'm trying to edit the order confirmation email template to display a block of html but only if a certain product has been bought.
We achieved this in the past with hika starter by editing the 'order_status_notification.html.php' file using the following code:
how is this done in hika business edition?
many thanks
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Note that you'll still be able to do that by using your code through your "order status notification" email configuration page ("Hikashop->System->Emails").
Please Log in or Create an account to join the conversation.
- daveturner101
-
Topic Author
- Offline
- Posts: 72
- Thank you received: 0
Mohamed Thelji wrote: Hi,
Note that you'll still be able to do that by using your code through your "order status notification" email configuration page ("Hikashop->System->Emails").
hi, thanks for the reply.
i did try it on the template file but it didn't work. could the syntax have changed with moving the code into a new location?
thanks
Please Log in or Create an account to join the conversation.
You would have to edit the "preload" file of the email via the menu System>Emails (available in the latest version of HikaShop) in order to add your custom PHP code.
Please Log in or Create an account to join the conversation.
- daveturner101
-
Topic Author
- Offline
- Posts: 72
- Thank you received: 0
nicolas wrote: If you have a recent version of HikaShop, you can see that there is no PHP anymore in emails but only tags.
You would have to edit the "preload" file of the email via the menu System>Emails (available in the latest version of HikaShop) in order to add your custom PHP code.
thanks for the info. i've edited the preload file as such but i'm not seeing my code displayed. can you advise?
i've added the following into the preload file
and then added an extra line to the VARS array:
i've then used the 'GIFT_CERT' tag in the main email body:
is this the correct process?
many thanks
Please Log in or Create an account to join the conversation.
It's probably that you added the first piece of code outside of the foreach on the products and thus the $item variable doesn't exist.
Please Log in or Create an account to join the conversation.
- daveturner101
-
Topic Author
- Offline
- Posts: 72
- Thank you received: 0
nicolas wrote: Yes that's the correct process.
It's probably that you added the first piece of code outside of the foreach on the products and thus the $item variable doesn't exist.
thanks, i managed to get it working. put it at the bottom of the preload file and changed
to
is there a way to target a product whether it has any characteristics added to it or not? i'm realising that when i add and remove characteristics from a product (which will be quite often) i will have to go into the preload file and amend my product id number as this will keep changing won't it?
is there a unique id for a product that always stays the same whether there's a characteristic added to it or it's just stand alone?
hope i'm explaining myself OK.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- daveturner101
-
Topic Author
- Offline
- Posts: 72
- Thank you received: 0
OK thanks. i'll just have to go into the file and amend it when i need to.nicolas wrote: There is no unique id. The id will change if you regenerate the variants of the product and thus the product_id of the variants will change too.
on the subject of characteristics, i'm noticing that when i add an extra characteristic to a product on the back end it's not showing on the front end unless i go into the product, remove the characteristics, save, add the characteristics again and then save again.
is this normal? and will new product_id's be generated every time i remove the characteristics and then add them again?
Please Log in or Create an account to join the conversation.
And yes, the product_ids are regenerated in such case.
Please Log in or Create an account to join the conversation.
- daveturner101
-
Topic Author
- Offline
- Posts: 72
- Thank you received: 0
nicolas wrote: That's normal with old versions of HikaShop. With recent versions, the variants are regenerated automatically when you do that and you should see it directly on the frontend.
And yes, the product_ids are regenerated in such case.
thanks. that's not the case for me and i'm using the most up to date version of hikashop.
could it be that i've edited one of the 'views' files and the shop is still using older code? if so which one is likely to be the culprit?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.