2015-06-15 14:44
浏览 72


So I am trying to set up a site on my localhost. I have selected 2 payment gateways from admin end

  1. Online Payment (Free Shipping)
  2. Cash On Delivery(Free Shipping/Flat COD Charge INR 50 )

Now I have customized all the rules for them. I only need one more rule.

I wish to have a functionality wherein I can enter some pincode/postcode values (through admin panel or maybe in some array in a javascript file or directly into the database, does not matter) of locations where second method is available)

Whenever someone presses continue before confirming order, the checkout form is validated so as to check from the form data if the value entered in post code matches the data (from any of the above methods) and if yes, only then they can continue or I wish to show an error message that

Following payment gateway is not available in your location

If you give me a hint on how to proceed with this, perhaps, I might be able to take it further. I am a bit or a starter in opencart so not much idea about how to proceed. I have sound knowledge of PHP, JQuery and Javascript although. So any and all help will be appreciated.

图片转代码服务由CSDN问答提供 功能建议

所以我想在我的localhost上设置一个站点。 我从管理员端选择了2个支付网关

  1. 在线支付(免费送货)
  2. 货到付款(免运费/平面COD费用) INR 50)

    现在我已经为它们定制了所有规则。 我只需要一个规则。

    我希望有一个功能,我可以输入一些pincode / postcode值(通过管理面板或可能在一些javascript文件中的数组或直接进入 数据库,无关紧要)第二种方法可用的地方)

    每当有人在确认订单之前按下继续时,结账表格将被验证,以便从表格数据中检查是否输入了值 在邮政编码中匹配数据(来自任何上述方法),如果是,只有这样他们才能继续或我希望显示错误信息

    付款后 你的位置没有网关

    如果你给我一个关于如何继续这个的提示,也许,我或许可以进一步。 我在opencart中有点或者先发,所以不知道如何继续。 我对PHP,JQuery和Javascript有很好的了解。 所以任何和所有的帮助将不胜感激。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • doucha5080 2015-06-23 15:07

    There are a few different extensions that already exist to do what you want - allow you to restrict shipping methods by various criteria. This one is my personal favorite:

    打赏 评论
  • donglvchu9143 2015-06-23 03:16

    I managed it with JQuery for the time being. Edited the submit function in the cart.tpl file in catalog->view->theme->ancart (theme name) ->cart folder.

    Used a plugin called "Zipcode COD" to enter zipcodes. Edited the response JQuery to hide and show payment options.

    Lots of hard coding but does the trick. I will post the code if someone needs.

    打赏 评论

相关推荐 更多相似问题