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)
-   -   Extra Add to Cart Button - Top of Product Page (https://forum.x-cart.com/showthread.php?t=55270)

sharingsunshine 08-26-2010 12:47 PM

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

gb2world 08-27-2010 07:30 PM

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.

sharingsunshine 08-28-2010 01:47 PM

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

Mr. G 01-02-2011 08:13 PM

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!


All times are GMT -8. The time now is 11:27 PM.

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