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

create "buy now" buttons for long product pages

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 12-07-2004, 07:11 AM
 
belen belen is offline
 

Member
  
Join Date: Nov 2002
Posts: 12
 

Default 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
Reply With Quote
  #2  
Old 12-29-2004, 03:43 PM
 
Rayco Rayco is offline
 

Member
  
Join Date: Jul 2004
Posts: 21
 

Default

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
XCart 4.0.8 Dev
Mysql 4.0.20 Standard
Linux(i686) 2.4.27
Reply With Quote
  #3  
Old 01-19-2005, 07:04 PM
 
Rayco Rayco is offline
 

Member
  
Join Date: Jul 2004
Posts: 21
 

Default Buy Now Buttons

Can anyone give me an example of the link text required to use this mod?
Thanks Ray
__________________
Rayco
XCart 4.0.8 Dev
Mysql 4.0.20 Standard
Linux(i686) 2.4.27
Reply With Quote
  #4  
Old 01-19-2005, 08:37 PM
 
belen belen is offline
 

Member
  
Join Date: Nov 2002
Posts: 12
 

Default

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.
Reply With Quote
  #5  
Old 01-19-2005, 08:59 PM
 
Rayco Rayco is offline
 

Member
  
Join Date: Jul 2004
Posts: 21
 

Default 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
__________________
Rayco
XCart 4.0.8 Dev
Mysql 4.0.20 Standard
Linux(i686) 2.4.27
Reply With Quote
  #6  
Old 01-20-2005, 06:42 AM
 
belen belen is offline
 

Member
  
Join Date: Nov 2002
Posts: 12
 

Default

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.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not 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:51 AM.

   

 
X-Cart forums © 2001-2020