Custom field in order tables

  • Posts: 6
  • Thank you received: 0
3 years 8 months ago #330347

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.15

I want to put in a special place in email notifications a comment in order table. I cannot make {VAR:order.comment} appear in emails.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330349

Hi,

That tag seems correct.
Could you provide a screenshot of the settings of your custom field and a screenshot of the HTML of the email where you're adding the tag so that we can see what the situation is ?

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

  • Posts: 6
  • Thank you received: 0
3 years 8 months ago #330363

Hi, Actually I see that it works if orders come from the web. But we are trying to make it work for orders comming from Harmis app. In this case, some if clauses or some preloads dont work and give an empty result. Harmis is trying long time now without result, if you could suggest a fix for this.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330368

Hi,

So you're saying that the tag doesn't work when the order is created by the Harmis app.
We need to proceed methodically to understand where the problem comes from before we could suggest a fix.
1. Could you provide a screenshot of the settings of the comment custom field ?
2. Do you see the custom field "comment" filled in in the order details in the backend for an order coming from Harmis ?
3. Which email are you adding the tag to ? The "order status notification" ? The "order creation notification" ? another one ?
4. If you click on the "preview" button of the email when editing it via the System>Emails button and select an order from the Harmis app, do you see the tag being replaced by the content in the custom field ?
5. You said "some if clauses or some preloads dont work and give an empty result". Is this something the developer of Harmis told you ? Or something you figured out ? Could you elaborate ? Which if clauses or preload code gives an empty result ?

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

  • Posts: 6
  • Thank you received: 0
3 years 8 months ago #330391

I tried to add the tag because we couldnt make it work the usual way (to show it in additional info area). But the tag was empty.
So lets take the things from the beginning. When I make web order, the comment is shown. When I make app order the comment is in the table and we can see it in administrator view of the order. However, the emails sent to client and to admin, dont show this comment!

1. pls see comment1.jpg
2. yes
3. Order administrator notification & Order creation notification <- isnt this for the client?
4. I can see the cooment in its predefined position pls see image preview.jpg and compare with the email we receive for the same order with the preview admin_notification.jpg where yoy can see the additional info is empty!


5. This was my assumption

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330393

Hi,

Thanks for the information. Let's continue.
1. One possible reason this would happen would be if the comment was added to the order after the order was created. In that case, it would be normal that these emails do not contain the comment since they are sent when the order is created, and not when it is updated.
Could you provide a screenshot of the "history" section of that particular order (you can see it at the bottom of the page when you edit an order via the orders listing in the backend).
2. Could you also provide the PHP code used by harmis to create the order and add to it the comment custom field so that we can better understand what is happening ?
3. One thing you could try is to add the tag {VAR:order.comment} to the HTML of these emails. That will force the display of the content of the custom field in the email, regardless of the display options and restrictions of the custom field. So if the tag is replaced by nothing when the order is created by harmis, it will confirm that the order is created without the custom field provided and that its value is added afterwards, when these emails are already sent. That would explain why the preview on these emails for that order works fine but not the email sent when harmis creates the order.

Last edit: 3 years 8 months ago by nicolas.

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

  • Posts: 6
  • Thank you received: 0
3 years 8 months ago #330434

Hi, thanks a lot for your help.
1.


2. I asked harmis
3. Yes I tried many times in all emails admin, creation and status. When I do a preview it works, but the actual email is sent with this field empty.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 8 months ago #330447

Hi,

So from your last message additional information, I conclude that it has something to do with the PHP code used to create the order in the harmis integration. We'll need to look at the code to be able to understand what's wrong with it.

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

  • Posts: 6
  • Thank you received: 0
3 years 8 months ago #330466

As you said, problem was in php code. Harmis focused there and problem solved! Thanks a lot! :)

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

Time to create page: 0.089 seconds
Powered by Kunena Forum