mini mode failed and page reloaded problem

  • Posts: 31
  • Thank you received: 0
9 years 5 months ago #205270

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.5
-- Browser(s) name and version -- : firefox 38.05

I have a popular products module and a cart module on the frontpage. The cart module was set to be "mini" mode. There are two problems. First, when i click the "add to cart" button on popular product module, the cart module turned to be a complete display, not a mini mode. Secondly, any time i performed any actions on the cart module ( such as update or change the product amounts or delete the products in the cart....), the page reload to the top of the frontpage and i have to scroll back to the cart module position. You can try it .... Any way to resolve this two problems ?
Thanks in advance..

Attachments:

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 5 months ago #205278

Hi,

1. That's because you've activated the "Use AJAX when possible for add to cart buttons" setting of the HikaShop configuration and you have several cart modules and the system randomly picks another one that the one you have there for the refresh.
So you have several solutions:
- remove the other cart modules if you don't use them
- configure them all to be mini carts
- turn of that AJAX option

2. The operations in the cart module are not ajax. So the whole page is reprocessed and your browser put you back at the top. That's the way it is and the normal behavior.
What you could try is to edit the file "cart" of the view "product" via the menu Display>Views and change the line:

<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>"/>
by:
<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>#hikashop_cart"/>
That should hopefully force the browser to scroll down to the cart module when displaying the page.

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

  • Posts: 31
  • Thank you received: 0
9 years 5 months ago #205380

Dear Sir:
I changed the code as you suggested, but no luck. It still jump to the top of the page, not stay in the position of cart module. Any idea ? You can try it , i have changed the code already.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 5 months ago #205445

Hi,

That modification was for the normal mode. With the mini cart mode that you have displayed, there is no quantity change or delete possible for a product in the cart module.

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

  • Posts: 31
  • Thank you received: 0
9 years 5 months ago #205478

Dear Sir:
1. I have changed to normal mode, but after deleting or changing products, it still not remain in the same position (although it did not jump to the top, it now jumped to middle of the cart module and we can only see half of the cart now and still need to scroll down .....)
2. Although in normal mode, the change of cart module did not jump to the top, but when i clicked "add to cart" button in the popular products module beside the cart module, it still jump to the top. This method seemed not to resolve the reload problem resulting from the action from another module, any method to resolve that ?

Really thank you for kindly reply.

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
9 years 5 months ago #205600

Hi,

1. That's because of the banner of your template at the top which hides the top of the page. Without it, it would display just fine.
Change the code to :

<input type="hidden" name="url" value="<?php echo $this->params->get('url');?>#tm-bottom-a"/>
And that should circumvent the problem.

2. My solution was for the cart module, and you didn't ask for the add to cart up until now, so yes, that's normal that it worked only for the cart module.
For the add to cart, you want to turn on the "Use AJAX when possible for add to cart buttons" option of the HikaShop configuration.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum