magento 立即购买跳转到结账页面
magento添加立即购买程序
-
apache+mysql+php
-
先找到该目录下的appdesignfrontenddefaultblanktemplatecatalogproductview
addtocart.phtml 文件
-
然后对这个文件做修改:
<button id=”checknow” type=”button” title=”<?php echo $this->__(‘立即购买’) ?>” class=”button btn-cart” >
<span>
<?php echo $this->__(‘立即购买’) ?></span>
</button>
<input type=”hidden” name=”return_url” id=”return_url” value=”” />
-
新增立即购买按钮,隐藏跳转地址。
再新增jQuery方法操作:
<script>
jQuery(“#checknow”).click(function(){
jQuery(“input#return_url”).val(“<?php echo $this->getUrl(‘checkout/onepage/’); ?>”);
productAddToCartForm.submit();
})
</script>
OK了。这样你点击立即购买就能直接跳到结账页面。点击加入购物车跳到购物车页面