1

I used this approach for the buy now button on product page

app/design/frontend/your_template/default/template/catalog/product/view.phtml

<script>
function setcheckoutLocation(location)
{
jQuery.ajax({
type:”GET”,
url:location,
success:function(data){
window.location.href = “http://www.your-site.com/checkout/onepage/”;
}
});

}
</script>

app/design/frontend/your_template/default/template/catalog/product/view/addtocart.phtml

    <button type=”button” title=”Buy Now” class=”button btn-cart” 
onclick=”setcheckoutLocation(‘<?php echo $this->getAddToCartUrl($_product) ?>’)”><span><span>Buy Now</span></span></button>
    <?php echo $this->getChildHtml(”, true, true) ?>

Refrence : link

But when an item has custom option or a configurable product, it doesn't prompt "required" entry like what the ADD TO CART does. Instead it will say "Shopping cart is Empty". Any solution for this? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.