如何自动选择opencart结账的选项? [英] How to automatically select checkout options in opencart?

查看:1433
本文介绍了如何自动选择opencart结账的选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我开发的店铺,用户只能看到的价格,将产品添加到购物车,只有当他们创建一个帐户。之后,他们可以将产品添加到购物车。选项​​账单详情和交货细节将自动填充与用户的地址。交付方式是免费的,支付方式是货到付款。

In the shop I'm developing, users can only see prices and add products to cart only if they create an account. After that, they can add products to cart. The options Billing Details & Delivery Details are automatically filled in with the user's address. The delivery method is free and the payment method is "cash on delivery".

我怎样才能自动选择这些选项,并隐藏他们那么剩下的唯一步骤是确认订单?

How can I automatically select these options and hide them so the only step left would be to Confirm the order?

我想我需要改变的模板文件为目录/视图/主题/默认/模板/结帐/ checkout.tpl ,但它几乎是一个1K线长和用途阿贾克斯,我不知道......

I assume the template file I need to change is catalog/view/theme/default/template/checkout/checkout.tpl but it's almost a 1k lines long and uses ajax which I don't know...

我一直在想这样做了几个小时,所以任何帮助将不胜AP preciated!

I've been trying to do this for a few hours so any help would be greatly appreciated!

非常感谢你!

推荐答案

在万一有人就这个问题绊倒,我找到了答案的此处。它适用于帐户选项,送货方式,付款方式,但它不会为第二步,结算方式工作(如果你试图点击继续第二步与jQuery按钮,它只是将它变成一个无限循环)。

In case someone stumbles upon this question, I found the answer here. It works for account option, shipping option, payment option but it doesn't work for step2-billing option (if you try to click the continue button in step2 with jquery it just sends it into an infinite loop).

解决方法:您基本上点击继续使用jQuery按钮,然后隐藏相应的步骤/步骤,CSS(/catalog/view/theme/default/stylesheet/stylesheet.css):

The solution: You basically click the Continue button with Jquery and then hide the respective step/steps with CSS (/catalog/view/theme/default/stylesheet/stylesheet.css):

#checkout, #payment-method {
    display:none;
}

以下是从 opencart社区论坛

The following is from the opencart community forum:

要跳过帐户选项只要复制粘贴此code。在目录/视图/主题/默认/模板/签/ login.tpl的顶部:

To skip the account option just copy paste this code on the top of the catalog/view/theme/default/template/checkout/login.tpl:

<script language="Javascript" type="text/javascript">
$(document).ready(function(){
  $('#button-account').trigger('click');
});
</script>

记得看看一些较旧的文章,我已经做了自动选择登录选项。

Remember to have a look to some older post I have done to autoselect login options.

要跳过送货选项只要复制粘贴此code。在目录/视图/主题/默认/模板/签/ shipping.tpl的顶部:

To skip the shipping option just copy paste this code on the top of the catalog/view/theme/default/template/checkout/shipping.tpl:

<script language="Javascript" type="text/javascript">
$(document).ready(function(){
  $('#button-shipping').trigger('click');
});
</script>

要跳过的付款选项只要复制粘贴此code。在目录/视图/主题/默认/模板/签/ payment.tpl的顶部:

To skip the payment option just copy paste this code on the top of the catalog/view/theme/default/template/checkout/payment.tpl:

<script language="Javascript" type="text/javascript">
$(document).ready(function(){
  $('#button-payment').trigger('click');
});
</script>

在这种情况下,在opencart 1.5,你也必须改变这个code(36行):

In these case, in opencart 1.5 you also will have to change this code (line 36):

<input type="checkbox" name="agree" value="1"/>

这一个:

<input type="checkbox" name="agree" value="1" checked="checked"/>

请记住,这些技巧只会工作,如果默认选项是你想要的(或者,如果你强迫opencart来自动选择一个具体的选项)。

Remember that these tricks will only work if the default option is the one you want (or if you force opencart to autoselect one concrete option).

这篇关于如何自动选择opencart结账的选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆