GeoLocation with SET CURRENCY breaks gantry template homepage on first load!!!!

  • Posts: 36
  • Thank you received: 2
7 years 7 months ago #267865

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.16
-- Browser(s) name and version -- : Chrome, Firefox, IE (all browsers do it)
-- Error-message(debug-mod must be tuned on) -- : no specific error.

The page does not load the home template properly, breaking the page.

This only happens with the geo location plugin with SET CURRENCY ON.

Notice on the page linked, on a browser with no cache or after clear cache and refresh, the page does not load properly... it appears possibly that this plugin breaks the new version of gantry or this template specifically somehow.

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

  • Posts: 36
  • Thank you received: 2
7 years 7 months ago #267876

Also you can use this site to reproduce issue (to save clearing cache): www.locabrowser.com/

site is : URL REDACTED
(this is almost identical to our normal site but simply has currency/geolocation on and it have this issue!)

Last edit: 5 years 4 days ago by edzz83.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 7 months ago #267871

Hello,

Would it be possible to have more details about the issue ?
You gave us a link to the website home page ; but how can we see what is the error exactly ?
Do you have a page with the problem and another with the "normal design" ?

When you're using the geolocation plugin with the "set currency" feature, the plugin can load the HikaShop core in order to be able to load the HikaShop zone class and determine the user zone depending his IP address.
The plugin as HikaShop is general, is not compatible with "cache" because all the HikaShop content is entirely dynamic, starting from the customer cart, to the product "hit" counters, etc.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268039

Attached is two imnages of screenshots of the iste working and not working.

The broken one shows the top showcase area, and the 'contact us' are and footer and does not render the products or other sections of the site. Somehow, its causing my template to totally break its not displaying the items that should be displayed on the HOME menu item (any modules set to display ONLY on the homepage, are not displaying, its like it stops the site loading the correct template style.).

The second image shows the product listing that loads.

You can see this live too:
urls redacted

Attachments:
Last edit: 5 years 4 days ago by edzz83.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 6 months ago #268094

Hello,

In one site, you have HikaShop 2.6.4 and in the other you have HikaShop 3.0.1
I can see that the page is not loaded as the homepage by your template but it is difficult to know why.
Except loading the HikaShop core, the plugin is not doing a lot ; it might store some information in the user session in order to select the current user zone of the user default currency (depending how you have configured the plugin).
The important thing to know is why your template don't load the homepage data even if it knows that the current menu item ID is 1033.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268113

Hi,

This answer does not help me at all??

I know the hikashop versions are different, however, on both versions, the homepage deos not load when i turn on SET CURRENCY to ON (i have tried everything i can think of and it does not fix the issue).

I dont know how to fix this, and obvisouly this is an issue with hikas set currency conflicting with something as it only hapens when i set currency to on in that plugin.

I turned on al debugging and such and i can see no error or reason as to why this is happening, please help.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268131

Hi,

The difference between having that option on and that option off is that :
- HikaShop is loaded by the plugin -> that is done on all the pages where you have HikaShop, so if that was the problem you would have it on all the HikaShop pages of your website.
- the plugin contact the geolocation service to retrieve the information of the IP -> you can try changing the geolocation service in the settings of the plugin to see if it comes from the geolocation service being used.
- a few MySQL queries are run -> it can't come from that as otherwise you would have a big error message with an error message relative to the MySQL query.
- the currency is set in the user session for HikaShop to use it -> that can't be the problem and this works as otherwise, the problem would still be there if you refresh the page as it would try to get the currency again.

Also, the fact that the problem only occurs the first time means that the geolocation process went fine. And thus after that, the processing of the page continued and something else makes it not display the modules on your page.
The display of the modules depends from either your template or the loadposition system (based on how you configured them to be displayed). It's highly likely that it's your template.
So please understand that it's hard for us to tell you what to do because, as far as we understand the problem occurs after the process of the plugin and not in it, and thus in code that we didn't develop. Unfortunately, we cannot provide solutions for code that we don't know. The proper fix will probably be in the template since that the template which displays the modules, so my first recommendation would be to contact your template provider so that they can check on the issue.

PS: please also note that or support for HikaShop Business is only for valid subscription and your subscription has expired. You can renew it in the menu My account>My subscriptions.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268188

Hi,

I contacted my rockettheme developers, they advise they cannot help as they say the issue is not to do with their template, but to do with your plugin (eg, with your plugin 'SET CURRENCY' set to off the template works fine, its only when using your plugin the issue arises).

They advised the following:

"Not sure... unfortunately we cannot guarantee compatibility with all 3rd party components...


It seems something is interferring with the Routing... there's no errors in console; on the test subdomain the content is simply not being output at all.

It seems the error has been isolated to their currency plugin. I would highly encourage the Hikashop devs to enagage with our devs at github.com/gantry/gantry5 and post an issue describing the problem. "


Please can you help me resolve this issue, I really dont want to have to migrate a couple dozen clients, all whom all have valid subscriptions with you to another shopping system, all because we cant use multi currency with rockettheme. This is taking so long.... please... I have isolated the issue to your plugin setting?

Last edit: 7 years 6 months ago by edzz83.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268240

Hi,

Saying that the issue is isolated to this plugin option is easy for them. I could say the same that I have isolated the issue to their template system, since it works in all the different and thousands of other templates for Joomla.
Saying that they can't guarantee the compatibility of their template with all the 3rd party components is easy too. We could also say that we can't guarantee the compatibility of HikaShop with all the 3rd party extensions.
Bottom line, the problem happens in the display of the modules in the template and we don't know how this is done on their end. It might be triggered by something that the plugin does, but since we don't know what and don't know where to look, we can't say anything. The fix is actually probably something to be changed in gantry/the template itself.

Even if we were to debug the problem in their template:
- we don't have the template and thus we can't reproduce the problem
- we don't know how the modules are being displayed by the template (in which line or which file of the template ?)
- they say that something is interferring with the routing, but as I described in my previous message, the plugin doesn't do anything with the router. What is changed in the router ?
The problem is not that we don't want to help, but we don't know how and they have the keys to be able to help, but they don't want to.

Alright, then add the code:
$app->redirect(hikashop_currentURL());
after the code:
$app->setUserState( HIKASHOP_COMPONENT.'.currency_id',$toSetCurrency);
in the file plugins/system/hikashopgeolocation/hikashopgeolocation.php
That will add an extra redirection after the currency is set.
That will circumvent the problem in the template since it only happens when the plugin is setting the currency.
But that's not the proper way to fix that and we can't add that on our end for everyone just because they don't want to look at the problem.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268276

Thanks for your help so far.

I have relayed your message to the Rocket theme team. They are hoping to resolve the issue with your help (as its kind of a joint issue):

From Rocket Theme:
There's no errors in console; on the subdomain you provided the content is simply not being output at all...

I agree it doesn't make sense that disabling/enabling a plugin that purports to only geo-locate and set price accordingly would cause the entire contents of the Hikashop module to not output.

Gantry 5 is open source with a vibrant community and if the Hikashop devs can dig into this a little bit and post the issue on our Github I'm confident we can get some traction.

It seems however the error has been isolated to their currency plugin (eg, when we turn it off, things work as required). I would highly encourage the Hikashop devs to engage with our devs at github.com/gantry/gantry5 and post an issue describing the problem.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268287

Hi,

So did you try the modification I talked about ?
Did that, at least temporarily solved the problem ?

I've posted an issue on their github as they requested:
github.com/gantry/gantry5/issues/1972
Feel free to add extra information you might have to help resolve the issue.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268563

Hi,

An answer came back from gantry:
github.com/gantry/gantry5/issues/1972#issuecomment-298518052
Please follow the instructions there and report back your findings.
You can reply directly there, that will avoid the back and forth.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268672

Hi Nicolas,

Thanks for your help so far, i have replied on the GIT, however, i will add this response here as now we are faily sure it is a HIKASHOP issue as ive been able to replicate it on other templates (the default Joomla ones) per below:

Hi,

I have tried as you recommended (per here: github.com/gantry/gantry5/issues/1972 )
You are correct, this issue now seems to have nothing to do with gantry as far as I can tell as I can replicate on any template combination.

If I do the following template assignment:

Beez = Default Template Style
Created new HOME menu item and set this item to PROTOSTAR TEMPLATE.
Then, refresh page/browser cache and reload, the page first loads teh BEEZ template (should be loading PROTOSTAR) then on refresh the page loads the correct PROTOSTAR template.

There is obviously something wrong with the geolocation plugin per your advice. (per here: github.com/gantry/gantry5/issues/1972 )

Last edit: 7 years 6 months ago by edzz83.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268674

Also, i have tried the above issue replication on a completely separate installation with the same error/ result (a completely different website entirely which has hikashop installed)

Thanks for your help :)

Last edit: 7 years 6 months ago by edzz83.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268682

Hi,

Ok, then in the file of the plugin ( plugins/system/hikashopgeolocation/hikashopgeolocation.php ), change the line:
function onAfterInitialise(){
to:
function onAfterRoute(){
so that the geolocation is only done after the routing has been done be Joomla. That will prevent any possible conflict with it since the plugin will only be triggered after it.

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268716

Ok great I will try this shortly. Will you roll this fix our in your future release/version?

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

  • Posts: 36
  • Thank you received: 2
7 years 6 months ago #268717

This has fixed my issue. Thanks :)

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 6 months ago #268725

Hi,

Thank you for your feedback. We'll add an option to the geolocation plugin in the next version of HikaShop so that you can choose to trigger it after the initialisation or after the routing.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum