Redirect your product direct to the checkout page with one add to cart product.. good working code.....
<form action="<?php echo $this->getUrl('checkout/cart/add')?>" method="post">
<input type="hidden" name="product" value="1" />
<div class="buy-now-btn">
<input name="qty" type="hidden" class="input-text qty" id="qty" maxlength="12" value="1"</span>
<a href=""><button class="form-button" onclick="productAddToCartForm.submit()"><img src="<?php echo $this->getSkinUrl('images/buy-now.jpg');?>" alt="Buy now" /></button></a>
<button class="form-button" onclick="productAddToCartForm.submit()"><a href=""><img src="<?php echo $this->getSkinUrl('images/add-to-cart.jpg');?>" alt="Buy now" /></a></button>
</div>
</form>
<script type="text/javascript">
var productAddToCartForm = new VarienForm('product_addtocart_form');
productAddToCartForm.submit = function() {
if(this.validator.validate()) {
this.form.submit();
}
}.bind(productAddToCartForm);
</script>
<form action="<?php echo $this->getUrl('checkout/cart/add')?>" method="post">
<input type="hidden" name="product" value="1" />
<div class="buy-now-btn">
<input name="qty" type="hidden" class="input-text qty" id="qty" maxlength="12" value="1"</span>
<a href=""><button class="form-button" onclick="productAddToCartForm.submit()"><img src="<?php echo $this->getSkinUrl('images/buy-now.jpg');?>" alt="Buy now" /></button></a>
<button class="form-button" onclick="productAddToCartForm.submit()"><a href=""><img src="<?php echo $this->getSkinUrl('images/add-to-cart.jpg');?>" alt="Buy now" /></a></button>
</div>
</form>
<script type="text/javascript">
var productAddToCartForm = new VarienForm('product_addtocart_form');
productAddToCartForm.submit = function() {
if(this.validator.validate()) {
this.form.submit();
}
}.bind(productAddToCartForm);
</script>
For more information checkout our official website.
No comments:
Post a Comment