Skip to main content

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

14 years 3 weeks ago #69690 by Leeds Solar
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&quot;%20href=&quot;http:/www.leeds-solar.co.uk/index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=1&amp;checkout=1&amp;product_id=1"><input type="submit" class="button hikashop_cart_input_button" name="add" href="index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;quantity=1&amp;checkout=1&amp;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.

14 years 3 weeks ago #69691 by Mohamed Thelji
Hi,

Can you exactly tell me what you want to do ?

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

14 years 3 weeks ago #69693 by Leeds Solar
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.

14 years 3 weeks ago #69776 by Mohamed Thelji
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.

14 years 3 weeks ago #69824 by Leeds Solar
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.

14 years 3 weeks ago #69833 by Mohamed Thelji
you'll just have to add your "add to cart button like this" :
- Your add to cart HTML link :
Code:
<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 :
Code:
<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.

14 years 3 weeks ago #69862 by Leeds Solar
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.

14 years 3 weeks ago #70032 by nicolas
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.066 seconds
Powered by Kunena Forum