problem Redirect POST mode

  • Posts: 220
  • Thank you received: 8
7 years 6 months ago #282431

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.7.5
-- PHP version -- : 5.4.36

Hi,

I am testing updating Hikashop to the newest version 3.2.1 on my local XAMPP server.

After activating the option Redirect POST mode all categories only show 5 products. In the products options the maximum is 120 items.
Standard I don't use pagination. After enabling pagination, I see most more products have moved to the second page (see attachment).



The live website still uses Hikashop 2.6.5. Activating Redirect POST mode on the live site causes the same problem.

All works fine after deactivating the Redirect POST mode. Then all items show with maximum 120.

Moreover: Content modules loaded into a category description (via plugin Load module into Article) show an incorrect number of items. The Bestsellers module shows 9 products instead of the configured maximum of 5 products. A category content module also shows 9 products, instead of the configured maximum of 8 products.

I'm testing on a local XAMPP installation using a copy of the live website. To my big surprise this problem doesnot arise in older local copy of the website, using the same version of PHP, Joomla and Hikashop. Then all works fine after activating Redirect POST mode. I can't imagine why, it's a mystery to me.

Please advise.

Kind regards,
Udo

Attachments:
Last edit: 7 years 5 months ago by Udo. Reason: deleting double sentences

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 6 months ago #282433

Hi,

I don't see why it would do that either.
No one reported that with any version of HikaShop so far either.
I guess we would need to look more in depth into it directly on a copy of your website to be able to understand what's going on.

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

  • Posts: 220
  • Thank you received: 8
7 years 6 months ago #282511

Hi,

New information: I have discovered in which situation the problem arises!

It happens when a module is loaded in a category description by {loadposition}, {loadmodule} or {module}
I've done this for the Bestsellers module.
Then the maximum number of Bestsellers items (5) is overriding the maximum number of items in the category (120).


regards,
Udo

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 6 months ago #282517

Hi,

Ah I see.
But I have a hard time vizualizing why that would result in that.
Could you provide a link to a page with the issue so that we can look into it ?
Otherwise, as an easy solution, I would recommend to use the extension module anywhere instead of the loadposition system.
The loadposition system directly replaces the tags when the element is being displayed and thus it's possible that it messes with the variables in the view.
The module anywhere tags are processed right at the end of the page processing, so the modules won't normally influence the elements where they are displayed.

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

  • Posts: 220
  • Thank you received: 8
7 years 5 months ago #282611

Hi Nicolas,

I've tried Modules Anywhere but this doesnot make any difference, the problem persists.

Providing a link to a page with the issue is problematic It's undesirable to activate Redirect POST mode on the live site, since many products wouldn't display anymore

I've attached a screen shot of a category view on the local copy of the website where Redirect POST mode is activated.
I also activated the pagination so you can see what happens.
The maximum display of bestsellers is 5, and because of that the product listing below only shows 5 products instead of all products (with a maximum of 120).

This message contains confidential information


I hope this helps.

Regards,
Udo

Attachments:

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 5 months ago #282614

Hi,

So could you make a copy of the website so that we could look at the issue there in order to not impact your live website ?

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

  • Posts: 220
  • Thank you received: 8
7 years 5 months ago #282839

Hi,

I've found a way to show the issue at the live website without annoying impact.

I've activated Redirect POST mode AND I've temporarily stopped loading the Bestsellers module in all category descriptions except the main category. Now the openingspage of the shop is the only webpage with the issue.

This message contains confidential information


On that page 3 hikashop content modules are loaded in the category description (using the plugin Load Module in Article).

A- Products of category 'Aanbiedingen en tips', configuration: show maximum 8 products;
B- Bestsellers module, configuration: show maximum 5 products
C- Newest products module (carousel), configuration: show maximum 12 products

In reality when these three modules are loaded, all show maximum 8 products
When A is not loaded, B and C show maximum 5 products
So it looks like the first module loaded is overruling the maximum of the subsequent modules when Redirect POST mode is activated..

I hope you can find a way to stop this.

regards,
Udo

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 5 months ago #282886

Hi,

Thanks for the details.
I was able to reproduce the problem.
Change the line:

}elseif(isset($_REQUEST['limit']) && (empty($this->module) || hikaInput::get()->getVar('hikashop_front_end_main',0))){
to:
}elseif(isset($_REQUEST['limit']) && (empty($this->module) || (hikaInput::get()->getVar('task', 'listing') == 'listing' && hikaInput::get()->getVar('hikashop_front_end_main',0)))){
in the file components/com_hikashop/views/product/view.html.php and that will fix it.
It's a side effect of the handling of the pagination by the redirect post mode system on the listings which creates the issue when two modules are loaded in the main area of the template in a HikaShop view.
So it's really a corner case.

We'll add the patch on our end.

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

  • Posts: 220
  • Thank you received: 8
7 years 5 months ago #282894

Hi,

Thanks for your suggestion.
Alas, it doesnot help, nothing is changing.

However it does help to comment out the first of the two lines with this code (line 369).
Then the issue is gone.

Of course eliminating this line might be very unwise I'm afraid....

Regards,
Udo

Last edit: 7 years 5 months ago by Udo. Reason: typing error

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

  • Posts: 83779
  • Thank you received: 13567
  • MODERATOR
7 years 5 months ago #282897

Hi,

Well, the issue in that in your case, you're loading the modules in a view of a listing. What I was testing was to load the modules in the description of a product on a product page. And in that case, you can see that the code change proposed fix the issue.
In your case, you would have to change that line to:

}elseif(isset($_REQUEST['limit']) && empty($this->module)){
However, that means that the pagination might not work properly for the products listing of the categories of your menu item.

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

  • Posts: 220
  • Thank you received: 8
7 years 5 months ago #282949

Hi,

Indeed, the previous code fixes the issue when loading two modules in a product description.

My issue is about modules in a category description.
Your newest code fixes that issue, hurray.

As you said, the drawback is that the pagination of the product listing doesn't function anymore.
For me that's no problem, since I don't use it anyway.

Thanks for your awesome support.

Udo

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

Time to create page: 0.063 seconds
Powered by Kunena Forum