X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   create "buy now" buttons for long product pages (https://forum.x-cart.com/showthread.php?t=10794)

belen 12-07-2004 07:11 AM

create "buy now" buttons for long product pages
 
I just implemented a pretty nifty mod for X-Cart and I wanted to share.

We are building a website for direct marketing products in 4x, and our product pages are very very long, as dictated by the genre and conversion data we have. We did not want to have the buy information at the top, as our customers respond better to reading through the content before being approached with price and options.

However, we did want to give buyers the option to click a "Get it Now" button placed periodically throughout the long description at strategic points that would automatically add the item to the cart with the default values set in the product options at the bottom of the page, where the full ordering area was.

The solution:

I created a file called ordersubmit_js.tpl and place it in /store/skin1/

with the code:
Quote:

{literal}
<SCRIPT type="text/javascript" language="JavaScript 1.2">
function submitorder()
{
document.orderform.submit();}
</SCRIPT>
{/literal}


in store/skin1/customer/main/product.tpl, after
Quote:

{include file="form_validation_js.tpl"}
paste:
Quote:

{include file="ordersubmit_js.tpl"}

Then, in the long product description, you can manually place code for a buy now button where ever you may want it with the following code:


I hope this is handy for anyone else in our situation! Our store is still in dev, so I can't show you how we are using it yet, but I'll keep you posted when it's live.

Belen
Designer/Developer
www.hypnosisnetwork.com
X-cart v4.08

Rayco 12-29-2004 03:43 PM

HI Belen. This looks like just what I've been looking for. I'd like to make my products "hidden but available for sale" and link to them with a "Buy Now" button from the description in the Category descr box.
But I'm not sure what to put in this link


Where would I get the "Link Text" for a particular product and have the cart go into the checkout process?
Thanks, Rayco

Rayco 01-19-2005 07:04 PM

Buy Now Buttons
 
Can anyone give me an example of the link text required to use this mod?
Thanks Ray

belen 01-19-2005 08:37 PM

I'm sorry it took me a while to get back to you on this, but you misunderstood my post.


This code can only be used on the product page itself to trigger the add to cart form to submit the default buy now info, which is quantity 1 of the product with default options - it makes no difference what you put between the A HREF tags. The text inside the link tags can say *anything* in place of IMG TAG OR TEXT LINK. It could say "Buy Now" or "Add to Cart" or have an image there.

If you want to add a product to the cart from another page, you would use the code:


where productid equals the id of the product you want to add to the cart.

I hope this makes more sense.

Rayco 01-19-2005 08:59 PM

Buy Now Buttons
 
Thanks for the quick reply belen.
I think I understand a little better. What I am trying to do is list the product options in a table with a Buy Now button for each one. For example a base product "Fishing Reel Brand X" at $50 ,but the same reel comes in different sizes. Bigger $60, Biggest $70. I want to have them in a table with a "Buy Now' button for each one. They all have a productid. So when I make the table and put in the buttons do I just use the second link you posted for the individual's html link? Hope this make sense. Thanks Ray

belen 01-20-2005 06:42 AM

That is exactly what you want to do :) I am using the same idea for downloadable versions of our CD products and it is working like a charm.


All times are GMT -8. The time now is 10:58 PM.

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