No order email notification after Joomla 4 and Hikashop 5 upgrade

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355451

-- HikaShop version -- : 5.0.0
-- Joomla version -- : 4.3.4
-- PHP version -- : 8.1

**ignore title as i was unable to change after submit...should be "authorize.net php deprecation warnings"**

I am seeing a php error right after payment is submitted to authorize.net. Payment is collected successfully though.

[Wed Sep 27 14:03:31.081688 2023] [fcgid:warn] [pid 133211:tid 140657877489408] [client XXXX] mod_fcgid: stderr: PHP Deprecated:  mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/mojo6966/mojo_prod/plugins/hikashoppayment/authorize/authorize.php on line 242, referer: https://www.mojooutdoors.com/checkout/cid-3
[Wed Sep 27 14:03:31.081725 2023] [fcgid:warn] [pid 133211:tid 140657877489408] [client XXX] mod_fcgid: stderr: PHP Deprecated:  mb_substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/mojo6966/mojo_prod/plugins/hikashoppayment/authorize/authorize.php on line 253, referer: https://www.mojooutdoors.com/checkout/cid-3
[Wed Sep 27 14:03:31.081728 2023] [fcgid:warn] [pid 133211:tid 140657877489408] [client XXX] mod_fcgid: stderr: PHP Warning:  Undefined property: stdClass::$order in /home/mojo6966/mojo_prod/media/com_hikashop/mail/payment_notification.text.php on line 12, referer: https://www.mojooutdoors.com/checkout/cid-3
[Wed Sep 27 14:03:31.081743 2023] [fcgid:warn] [pid 133211:tid 140657877489408] [client XXXX] mod_fcgid: stderr: PHP Warning:  Attempt to read property "order_number" on null in /home/mojo6966/mojo_prod/media/com_hikashop/mail/payment_notification.text.php on line 12, referer: https://www.mojooutdoors.com/checkout/cid-3



Since the media/com_hikashop/mail/payment_notification.text.php file does not exist in the latest hikashop installer, i have removed this file.

The authorize issues seems to be related to the lack of company name attached to the order:
$vars["x_ship_to_company"]=mb_substr(@$order->cart->shipping_address->address_company,0,50);

After commenting the affected lines out, warning goes away. HOWEVER, there's something strange going on because on initial load, it shows a text copy of the thank you note, and it immediately reloads with the html copy.

Attachments:
Last edit: 1 year 1 month ago by mojooutdoors-holden.

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
1 year 1 month ago #355465

Hi,

We've made a patch for the deprecated messages.
Download again the install package of the 5.0.0 and install it on your website and it will fix the problem.

Regarding the thank you page, could you provide screenshots and the URLs at each point of the situation ?
Or maybe a screencast so that you can easily capture the changes ? ( For example with www.screencastify.com/pricing )

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

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355494

Below is a screen recording of the weird redirect.



It looks like it goes from domain.com/checkout/confirm -> domain.com/index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=68912&Itemid=883

The first confirm page is showing text from THANK_YOU_FOR_PURCHASE variable, but when it redirects, i'm seeing the html defined on after_end.php. I checked all checkout overrides and cannot figure out where THANK_YOU_FOR_PURCHASE is even used.

Attachments:

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

  • Posts: 82868
  • Thank you received: 13375
  • MODERATOR
1 year 1 month ago #355496

Hi,

Ok. Supposing that we're talking about the authorize.net payment plugin, I think I know what's going on.
I suppose that you must be using the authorize.net payment plugin in AIM mode. And in that case, the plugin will display its own thank you page with javascript to redirect to the after_end page.
That's indeed not nice (even though it was always like that, and it is not linked to the update).
I think we should be able to avoid this by changing the line:

$this->removeCart = true;
to:
$app = JFactory::getApplication();
$app->redirect($this->payment_params->return_url);
in the file plugins/hikashoppayment/authorize/authorize.php
Please confirm that this works so that we can include the change in future versions of HikaShop.

The following user(s) said Thank You: mojooutdoors-holden

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

  • Posts: 303
  • Thank you received: 18
1 year 1 month ago #355507

After making changes to authorize.php, everything seems to be functioning as expected. Thanks nicolas!

The following user(s) said Thank You: nicolas

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

Time to create page: 0.078 seconds
Powered by Kunena Forum