Template breaks after order is complete

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115745

I just upgraded to Hikashop 2.2.0 from 2.1.3. Now my template breaks every time an order is complete. I have seen it happen in Chrome, Firefox, and IE, and it is happening on several computers. Everything is fine until the order is processed and the Thank You page is displayed. The Thank You page displays broken. Then every page you browse to is broken, until you end your session by logging out or deleting the cookies for the website forcing the logout. At that point the website displays properly.

This is a pretty active e-commerce website and it is currently broken.

Does anyone have any ideas what is happening in this case?

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115752

An update: I have turned on debugging and found no errors. I have removed any customization I added to the layouts during checkout and on the thank you page. Those didn't help either. I have narrowed it down to something in the session cookie. If the session expires, I log out, or I delete the cookie, the view of the website is restored. So there is something in the session that is "breaking" the display of the website after the purchase is made. It has no effect on a logged in user before purchase. This only occurs after a purchase is made.

Anyone have any ideas what could be causing this issue? I am completely stumped.

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115757

Further update: I have tried several more things and found that it is indeed an issue with HikaShop. I swapped out the template a couple times. We are using a YooTheme template in production. I swapped it with a newer YooTheme template, and had the same issue. I used the standard Joomla Beez template and still had the issue. So it is not a specific template issue, as it is effecting all templates.

I was doing my tests purchases with a coupon code so I didn't actually spend money. I tried not doing that. Same issue. We are using AWOCoupon Pro in conjunction with HikaShop. I disabled that. Same issue.

It is definitely tied to the user session, post purchase. Everything is fine for a logged in user post purchase. The whole template formatting goes nuts post purchase, then returns to normal when the user is logged out.

Please does anyone have any thoughts or ideas. I don't know what else to try. I am at a total loss here.

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

  • Posts: 2334
  • Thank you received: 403
11 years 4 months ago #115801

Hi there,

What do you mean by messed up? Could you please post a screenshot of the given page as well as a link to your site so we can test it?
This information could help us to understand the issue.

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115866

Here are some screen shots. The first one is taken on the checkout page. The second one is taken at the "Thank you" page after I submit the order. Then I am stuck with the layout of the second screen shot until I logout or my session expires.

Any clues?

Attachments:

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115874

Don't know if this helps, but here is the page source of the home page before checkout and after checkout. After checkout it is missing a ton of javascript and stylesheets in the <head> section. In fact all the stylesheets that give the website its layout are missing.

Attachments:

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

  • Posts: 2334
  • Thank you received: 403
11 years 4 months ago #115893

Could you gave me the urls of these two page? Or at least what comes after the .com/

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115895

If you mean the URLs of the two pages I posted source code for, they are both the same page. The home home page of www.bestpub.com

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

  • Posts: 2334
  • Thank you received: 403
11 years 4 months ago #115900

Indeed, I though those errors were on different pages.
If you already tried to turn on the debug mode, could you take a look at your error log to see if you have any php errors.
This bug is really strange, I really don't see how Hikashop could affect your template this way.

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115907

There are errors in the error_log.
Things like:

[25-Jul-2013 20:13:46 UTC] PHP Warning: Attempt to assign property of non-object in /home/bestpub/public_html/administrator/components/com_hikashop/classes/currency.php on line 1833
[25-Jul-2013 20:13:46 UTC] PHP Warning: Attempt to assign property of non-object in /home/bestpub/public_html/administrator/components/com_hikashop/classes/currency.php on line 1834
[25-Jul-2013 21:55:42 UTC] PHP Warning: Division by zero in /home/bestpub/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 399
[25-Jul-2013 21:55:46 UTC] PHP Warning: Division by zero in /home/bestpub/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 399
[25-Jul-2013 21:55:46 UTC] PHP Warning: Division by zero in /home/bestpub/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 399
[25-Jul-2013 21:55:46 UTC] PHP Warning: Division by zero in /home/bestpub/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 399
[25-Jul-2013 21:55:50 UTC] PHP Warning: Division by zero in /home/bestpub/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 399
[25-Jul-2013 23:12:23 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12
[25-Jul-2013 23:12:31 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12
[25-Jul-2013 23:12:35 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12
[25-Jul-2013 23:12:40 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12
[25-Jul-2013 23:12:42 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12
[25-Jul-2013 23:13:44 UTC] PHP Fatal error: Class 'hikashopShippingPlugin' not found in /home/bestpub/public_html/plugins/hikashopshipping/usps/usps.php on line 12

Most of them are repeats of the first two lines.

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 4 months ago #115929

Eliot, I was just wondering if you or anyone else had any thoughts on this yet. It is still and issue, and I am not sure what else I can try on my end to fix this. If you want/need admin access to the website just let me know. I can PM it to you.

Thank you for everything.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
11 years 3 months ago #116121

Hi,

From what I can see, the issue is indeed that the CSS/JS of the template is missing from the page after the checkout.
It is added by the template itself after HikaShop processing so I don't see why HikaShop would create such problem since HikaShop doesn't intervene after the template.
What's even more strange is that no one else has the issue so it's not something directly in HikaShop.
It looks more like some kind of conflict.
So the tests you did to switch template etc are a good start. Maybe trying with unpublishing system plugins ? They are the only thing run after the template which could potentially remove the CSS/JS of the template.

Also make sure that the problem doesn't come from the return url parameter of your payment plugin. If that url goes to a menu where a non existing template is assigned to, it could potentially create such issue (the template might not find its settings anymore).

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 3 months ago #116143

I found the problem.

I just completed a lot more testing, trying to narrow down this issue. A couple days ago, I already tried disabling plugins that were "special" or not common, in trying to see if I could find a conflict. I didn't find one. I just did an exhaustive test though, disabling any plugin that isn't a standard Joomla plugin.

Once I disabled any of those, the checkout process was working fine. So I starting enabling them one by one. The plugin that broke the website was a simple one that just inserts Google Analytics code for me. I found an upgrade to the plugin, installed that and found it didn't help.

So I went the manual route and added the standard Google Analytics code the the template files myself. Done that tons of times in the past. Even doing it that way, the checkout still breaks the website.

So I tried disabling the HikaShop Google Analytics plugin. That did the trick. The checkout process works perfect now.

Did you folks change something in the HikaShop Google Analytics plugin? Anything that could be causing this?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
11 years 3 months ago #116245

That's great that you found out.

We actually added additional code to fix another conflict with Google Analytics code :
www.hikashop.com/en/forum/4-how-to/82698...conflict.html#106086

That's probably what led to the issue on your website.

Please change the line:

$body = preg_replace("#<script type=\"text/javascript\">.*'https://ssl' : 'http://www'\) \+ '\.google-analytics\.com.*</script>#siU",'',$body);
to:
$body = preg_replace("#<script type=\"text/javascript\">(?:(?!<script).)*'https://ssl' : 'http://www'\) \+ '\.google-analytics\.com.*</script>#siU",'',$body);
in the file plugins/system/hikashopanalytics.php and that should avoid the conflict.

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

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
11 years 3 months ago #116286

That fixes it. Thanks for the help. Glad this is resolved now.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum