Open Product Page use Ajax - Fixed

  • Posts: 410
  • Thank you received: 15
4 years 11 months ago #305499

-- HikaShop version -- : 4.0.3

Hi, I have an idea and I need to use Ajax in this case. Is it possible to load a product page via Ajax? If possible, could you give an example to know what to do?

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

  • Posts: 81378
  • Thank you received: 13037
  • MODERATOR
4 years 11 months ago #305504

Sure.

Take the URL of the product page, and use the ajax function from jQuery to load it and retrieve it's HTML:
www.w3schools.com/jquery/jquery_ajax_load.asp
If you don't want the whole page but only the inside where there is the product page layout displayed by HikaShop, you can and ?tmpl=component or ?tmpl=raw to the URL.

The following user(s) said Thank You: neo191987

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

  • Posts: 410
  • Thank you received: 15
4 years 10 months ago #306580

Hi, I see that Hikashop has an Ajax function. Can you give me an example of how to load content. For example, New billing address or New shipping address in the User panel. I want to click on a button or a link to show content. The purpose is to be used on the product page and there is no need to enter any information.

As an example I will mention this code:

<a class="hikabtn hikabtn-success" href="#newAddress" onclick="return window.addressMgr.new('billing');"><?php echo JText::_('HIKASHOP_NEW_BILLING_ADDRESS'); ?></a>

Last edit: 4 years 10 months ago by neo191987.

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

  • Posts: 410
  • Thank you received: 15
4 years 10 months ago #306586

I understand how it works. I have to use Java. :)

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

Time to create page: 0.066 seconds
Powered by Kunena Forum