Re: Add to cart link. Ajax or Stay same page POSSIBLE?

  • Posts: 4
  • Thank you received: 0
12 years 1 month ago #69690

Hi Folks,

I have followed you instructions and now I get this


<a href="index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1" onclick="try{ new Ajax('index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1', { method: 'get' }).request(); }catch(err){ new Request({url:'index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1', method: 'get'}).send(); } return false;">Add to cart</a>

and it does nothing.

I have made this code myself:

<a href="hikashop_html_add_to_cart_link"%20href="http:/www.leeds-solar.co.uk/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1"><input type="submit" class="button hikashop_cart_input_button" name="add" href="index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=1" value="Add to cart" onclick="var field=document.getElementById('hikashop_product_quantity_field_1');if(hikashopCheckChangeForm('item','hikashop_product_form')){ return hikashopModifyQuantity('1',field,1,'hikashop_product_form','cart'); } else { return false; }" /></a>

Which has a nice looking button and adds the item to cart however, it redirects to a page that looses the temple page layout. I would like the html for the add to cart button on this " www.leeds-solar.co.uk/shoplink/product/1-immersun " page so I can insert into articles and make the site look and feel smooth. Please Advise

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

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #69691

Hi,

Can you exactly tell me what you want to do ?

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

  • Posts: 4
  • Thank you received: 0
12 years 1 month ago #69693

I would like the add to cart button on this page:

www.leeds-solar.co.uk/energy-saving/immersun

to behave like the add to cart button on this page:

www.leeds-solar.co.uk/shoplink/product/1-immersun

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

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #69776

Ok,
So if you want to add an 'add to cart button' to a page, you'll have to go to your product page and use the HTML code of the 'add to cart HTML Link' button.
BUT, this link will always redirect your customer directly to the checkout.

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

  • Posts: 4
  • Thank you received: 0
12 years 1 month ago #69824

YES, this is fine. Unlike other people I am happy to have it pointing to the checkout as this makes sense however, I cannot find out how to turn it into a button with a border. IT just displays as a weblink in green. Is there any simple code I can use without learning javascript or ajax?

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

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #69833

you'll just have to add your "add to cart button like this" :
- Your add to cart HTML link :

<a class="hikashop_html_add_to_cart_link" href="http://localhost/Hikashop-Dir/hikastore19-09-2012/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=2">Add to cart</a>
- With the add to cart picture :
<a class="hikashop_html_add_to_cart_link" href="http://localhost/Hikashop-Dir/hikastore19-09-2012/index.php?option=com_hikashop&ctrl=product&task=updatecart&quantity=1&checkout=1&product_id=2"><img src="addtocart.jpg" alt="addtocartimage"/></a>

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

  • Posts: 4
  • Thank you received: 0
12 years 1 month ago #69862

Even when I use the second code it still brings up a checkout page where modules are not displaying correctly. Is there something else I need to do in Hikashop to achieve this? Could it be possible that I have a conflicting module? Have you seen anything like this before?

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

  • Posts: 82818
  • Thank you received: 13362
  • MODERATOR
12 years 1 month ago #70032

The modules "disapear" because they are no assigned to the current menu.
The solution is quite simple.
Just set the option "force a menu on checkout" to your products listing menu in the configuration page of HikaShop and it should do what you want.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum