X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How do I add Buy Now button on product page (https://forum.x-cart.com/showthread.php?t=53709)

gallaghersean 05-12-2010 11:33 AM

How do I add Buy Now button on product page
 
Hi,

I've been searching on the forum and doing some trial and error myself but still can't seem to figure out how to add a Buy Now button to the product details page (product_details.tpl). Please share how to do this? Thanks!

X-Cart version is 4.3.1 with a few custom mods I built.

Shamun 05-12-2010 03:27 PM

Re: How do I add Buy Now button on product page
 
Admin area -> General settings -> Appearence settings -> Enable buttons "Buy Now" and "Add to wish list" in the products list

gallaghersean 05-13-2010 06:15 AM

Re: How do I add Buy Now button on product page
 
Yes, that will add the buttons to the product list page but what I'm looking for it adding the Buy Now button to the actual product page (aka product_details.tpl). This will require some coding I just don't know what exactly to add in order to add get that hooked up.

cflsystems 05-13-2010 08:37 AM

Re: How do I add Buy Now button on product page
 
Buy Now button should be already there - it's called Add To Cart

gallaghersean 05-13-2010 08:48 AM

Re: How do I add Buy Now button on product page
 
No you're misunderstanding. Add to cart button adds product to the cart and returns the user to the product page. I want a buy now button that adds the product to the cart and brings the user to the checkout page.

cflsystems 05-13-2010 08:53 AM

Re: How do I add Buy Now button on product page
 
This is a setting in admin - General Options - redirect customer to cart

gallaghersean 05-13-2010 01:41 PM

Re: How do I add Buy Now button on product page
 
Nope that's not it. What I want is to have both the "Add to Cart" and "Buy Now" buttons on the actual product page (aka product_details.tpl). Where "Add to Cart" button adds item to cart and brings user back to product page but if they click the "Buy Now" button then it adds item to cart and brings them to the checkout page.

gallaghersean 05-14-2010 10:30 AM

Re: How do I add Buy Now button on product page
 
I figured it out.... created my own mod for this... I did the following:
  1. Added line in cart.php to check if POST var "redirect" is set to true and if so then set $config["General"]["redirect_to_cart"] to Y.
  2. Added hidden input field "redirect"
  3. Added a HTML button to product_details.tpl
  4. Created some JavaScript so when that button is pressed it changes the hidden variable to true and then submits the form


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

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.