Email, per status override not working

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard
2 years 9 months ago #338945

Hello,
I have a number of order statues and change these depending on when items are shiiped, recieved etc etc.

I am trying to change the order status notification email, but when I selelct the Per Status override and then try and selelct a different notification other than created from the pop up window to just change that specific email for the required order notification I cannot. The dropdown allows me to pickt he order status, but then reverts back to Created everytime, no matter which ststua I choose.

Please help!

Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #338950

Hi,

I was able to create a per status override with a status I first created in System>Order statuses.
I suppose it might be might to special characters in the namekey of the order statuses you created maybe ?
Could you provide more precise information on the situation ?
A screenshot of the settings of the status and your version of HikaShop, PHP, Joomla and your browser would be great.

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

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard
2 years 9 months ago #338965

Nicolas,
Using latest Joomla, Hikashop 4.4.2, Php 7.4.x.

You mentioned special character sin the namekey, and taking a look at what the client created there is a comma in the namekey. Could this be the issue. Is it possible for me to change this directly in the database table or would it affect other areas if I just chnage it there?

Thanks
Lee

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #338969

Hi,

The namekey of the custom field will be used directly in the name of the override file where the modifications are stored.
We use Joomla's JFile::makeSafe function so it should strip special characters and work fine.
I did try on my end with a comma in the namekey and I didn't have a problem either. I used the order status namekey "Test , with , commas" and the modification of the HTML section worked fine in the "per status override" popup:
i.imgur.com/HPVvjQ2.png
And I got the file media\com_hikashop\mail\order_status_notification.testwithcommas.html.php created on my test website. As you can see, the makeSafe function stripped the commas and spaces and force the lowercase.

If you change the namekey in the database via PHPMyAdmin, you will have two problems:
- the order_status of the orders with that status won't match anymore. So you should also run a query to update the order_status in the hikashop_order table so that they are still linked
- the enable state in the different columns of the System>Order statuses menu will be lost for that order status. So you'll have to reset them there.
But as I said above, I didn't have the problem with a comma on my end so it's likely coming from something else.

Also, the last issue we fixed with the per status override dates from HikaShop 4.0.1 ( www.hikashop.com/forum/orders-management...ing-sent.html#304024 ) so if you have the 4.4.2, you already have all the fixes on that end.

You also said "latest Joomla". On your screenshot, it looks like Joomla 3.x, not Joomla 4.0 so I suppose that you meant the latest Joomla 3.x. Otherwise, I would recommend updating HikaShop as the 4.4.2 has many bugs on Joomla 4 that we already fixed in later versions of HikaShop.

Finally, I guess we'll need a backend access and a FTP access to directly check on the issue since we can't reproduce it on our end.
Please provide these via our contact form along with a link to this thread for reference:
www.hikashop.com/support/contact-us.html

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339015

Hi,

Thank you for the access.
I think I found and corrected the issue.
I changed the line:
$this->order_status = hikaInput::get()->getCmd('order_status', '');
to:
$this->order_status = hikaInput::get()->getString('order_status', '');
in the file administrator/components/com_hikashop/views/email/view.html.php
We'll add the change on our end too.
I'm actually not sure why I'm not able to reproduce the issue on my end as I should have the same issue as getCmd should have the same filtering on both our websites. But oh well, it's fixed :)

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

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard
2 years 9 months ago #339445

Nicolas,
Thansk for the help, my client has stated that even with this specific email over ride for the change of order status, when he amends and order to this status the email that is recieved by the customer is not the custom override but still the 'standard' "This order is Paid" version.

Any idea how or why I can fix the issue so when the order status is changed the correct email will be sent to the customer?

Thanks

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339454

Hi,

The modification I gave is to be able to properly edit a "per status override" even with special characters.
It doesn't change anything to the sending of the emails.
So I'm not surprised if you found a new problem there.
I did some further investigation and there was a similar issue with special characters for the loading of the email when the email is being sent by HikaShop.
So I've added a second patch.
I've run a full test on your website and it seems to be working fine now.
We'll add that other patch on our end.

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

  • Posts: 231
  • Thank you received: 4
  • Hikaserial Standard
2 years 9 months ago #339459

Nicolas,
Thats great and thanks for your help, most appreciated.

So is it possible to send a specific email depedning on the order status being set? Or have I been confused and that is what this second patch you have added has now corrected and when an order status is changed the relevant email template over ride is used to send to the customer?

Thanks

Lee

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
2 years 9 months ago #339461

Hi,

The patches I made don't allow for that because this was already possible without the patches.
All the patches do is fix that capability when the order status being used includes special characters like a comma.

To do so, just click on the "per status override" button of the HTML section, select the order status for which you want to make your changes, change the HTML and save. Then rinse and repeat for each order status for which you want the email to be customized.

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

Time to create page: 0.075 seconds
Powered by Kunena Forum