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

Extra Add to Cart Button - Top of Product Page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-26-2010, 12:47 PM
 
sharingsunshine sharingsunshine is offline
 

Senior Member
  
Join Date: Aug 2005
Location: Palmyra, VA
Posts: 149
 

Default Extra Add to Cart Button - Top of Product Page

Hello,

I need to have an extra add to cart button with quantity at the top of the product page. I have played around with the add to cart button and can get it moved by using the code below. However, I am not sure what else needs to be moved with it to get it to work and add something to the cart.

Code:
{include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button add-to-cart-button"}

The code above doesn't show the quantity like it does at the bottom of the product page, normally.

Please tell me what code I need to insert at the top of the product.tpl page next to the following code:

Code:
<h1>{$product.producttitle}</h1>

Thanks,

Randal
__________________
***********************
Visit Our Other Web Sites!
∙ Nutritional Herbs and Supplements
<a href="http://www.theherbsplace.com"> The Herbs Place </a>
∙ Frugal Ideas and a Forum To Submit Your Questions
<a href="http://www.thefrugallife.com"> The Frugal Life </a>
∙ Healthy and Natural Pet Products
<a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a>
***********************

Joined 08/02/05
X-Cart Gold Version 4.3.2
Linux RedHat Enterprise
Reply With Quote
  #2  
Old 08-27-2010, 07:30 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Extra Add to Cart Button - Top of Product Page

One thing to consider is that you need to keep it inside the form. If you move it outside the form, it has nothing to submit.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #3  
Old 08-28-2010, 01:47 PM
 
sharingsunshine sharingsunshine is offline
 

Senior Member
  
Join Date: Aug 2005
Location: Palmyra, VA
Posts: 149
 

Default Re: Extra Add to Cart Button - Top of Product Page

Thanks for the reply. However, I saw the form and was trying to get it to work. In the following code I can get it to add to the cart but it won't display the quantity drop down box. Instead all that is displayed is a number one.

Can someone tell me what I am missing?

Code:
<div class="moveover_buynow"> {include file="customer/buttons/add_to_cart.tpl" type="input" additional_button_class="main-button add-to-cart-button"} <form name="orderform" method="post" action="cart.php" onsubmit="javascript: return FormValidation(this);"> <script type="text/javascript"> <!-- var min_avail = {$product.appearance.min_quantity|default:1}; var avail = {$product.appearance.max_quantity|default:1}; var product_avail = {$product.avail|default:"0"}; --> </script> <input type="text" id="product_avail_input" name="amount" maxlength="11" size="6" onchange="javascript: return check_quantity_input_box(this);" value="{$smarty.get.quantity|default:$product.appearance.min_quantity}"{if not $product.appearance.quantity_input_box_enabled} disabled="disabled" style="display: none;"{/if}/> <option value="{$product.appearance.min_quantity}"{if $smarty.get.quantity eq $product.appearance.min_quantity} selected="selected"{/if}>{$product.appearance.min_quantity}</option> <option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option> <input type="hidden" name="amount" value="1" /> <input type="hidden" name="slot" value="{$smarty.get.slot}" /> <input type="hidden" name="addproductid" value="{$product.productid}" /> </form></div>

Thanks,

Randal
__________________
***********************
Visit Our Other Web Sites!
∙ Nutritional Herbs and Supplements
<a href="http://www.theherbsplace.com"> The Herbs Place </a>
∙ Frugal Ideas and a Forum To Submit Your Questions
<a href="http://www.thefrugallife.com"> The Frugal Life </a>
∙ Healthy and Natural Pet Products
<a href="http://www.healthypetcorner.com"> Healthy Pet Corner </a>
***********************

Joined 08/02/05
X-Cart Gold Version 4.3.2
Linux RedHat Enterprise
Reply With Quote
  #4  
Old 01-02-2011, 08:13 PM
  Mr. G's Avatar 
Mr. G Mr. G is offline
 

eXpert
  
Join Date: Nov 2010
Posts: 386
 

Default Re: Extra Add to Cart Button - Top of Product Page

I definitely want exactly this too! Randal or anybody, do you know a solution? Any mods out there?

HNY!
__________________
4.7.6 Gold Plus
XCartMods.co.uk Ultra Template
X-Cart Abandoned Cart
BCSE PayPal DPM
CDSEO Pro 2.1.8
BCSE Drop Shipper Pro
Google Rich Snippets
Time and money-saving tips I've learned as a webstore owner at http://ShoppingCart-Program.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 12:42 AM.

   

 
X-Cart forums © 2001-2020