Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

standard x-cart "add-to-cart" Button of front page

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-26-2017, 03:36 PM
 
madhatter717 madhatter717 is offline
 

Member
  
Join Date: Oct 2016
Posts: 24
 

Default standard x-cart "add-to-cart" Button of front page

Hi X-cart team,

I have a question:

How do I place the standard x-cart button on the front page of my store and have it function exactly like if I had clicked the "add to cart" button on the product page?

I found this code and it seemed promising:

<form action="?target=cart" method="post" accept-charset="utf-8" class="custom-add2cart"> <input type="hidden" name="target" value="cart" /> <input type="hidden" name="action" value="add" /> <input type="hidden" name="product_id" value="5" /> <div class="add-button-wrapper widget-fingerprint-product-add-button"> <button type="submit" class="btn regular-button regular-main-button add2cart submit"> <span>Add to cart</span> </button> </div> </form>

It added the product to the cart but it didnt take you to the checkout page(/?target=cart)like the the add to cart on the product page does.

We are designing a custom front page and would like the "add to cart" button and functionality to appear there for certain products, similar to the featured products module just on the actual front page with a direct link to product being added not only to cart but you to be taken to the cart page as well.

any ideas or suggestions would be appreciated.

thanks in advance
__________________
x-cart business 5.2.14
Reply With Quote
  #2  
Old 01-27-2017, 12:27 AM
 
xim xim is offline
 

X-Cart team
  
Join Date: Nov 2004
Posts: 677
 

Default Re: standard x-cart "add-to-cart" Button of front page

For 533 version there will be special "Buy button" module which allows to add js code with buy button to any page.
__________________
Sincerely yours, Max Vydrin
Reply With Quote
  #3  
Old 01-27-2017, 08:18 AM
 
madhatter717 madhatter717 is offline
 

Member
  
Join Date: Oct 2016
Posts: 24
 

Default Re: standard x-cart "add-to-cart" Button of front page

Thanks Xim,

but my company plans to stay with version 5.2.16 for awhile.

Are there any solutions to my problem for Version 5.2?
__________________
x-cart business 5.2.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:31 PM.

   

 
X-Cart forums © 2001-2020