Magento需要优惠券才能购买产品(Magento require coupon to purchase product)

编程入门 行业动态 更新时间:2024-10-28 16:28:53
Magento需要优惠券才能购买产品(Magento require coupon to purchase product)

在Google上搜索了很长一段时间后,我发疯了。 我的问题: 你能否配置Magento需要优惠券代码来购买特定产品

这是我的雇主正在进行的促销,基本上我们希望允许特定客户在我们的任何其他客户之前在我们的Magento商店购买特定产品。 谢谢你的建议。

After searching on Google for quite a while I am going crazy. My question: Can you configure Magento to require a coupon code to buy specific product?

This is for a promotion my employer is running, basically we want to allow specific customers to buy specific product in our Magento store before any of our other customers. Thank you for your suggestions.

最满意答案

我可以在这里给出一个简短的想法。

创建一个后端模块,该模块具有自己的数据库表,用于保存产品ID与特定优惠券,多个优惠券的链接,或者仅根据您的情况检查是否需要优惠券。 在本单元中,您应该能够定义产品与优惠券的链接。 由于客户在购物车页面上应用优惠券代码,因此我们会让客户将产品添加到购物车中。 然后编辑Mage_Checkout_Block_Onepage_Link类的isDisabled方法。 在那里,您将检查您的报价是否包含模块中定义的产品优惠券链接中的任何产品,并且优惠券尚未应用。 如果在Magento中启用了Multishipping方法,你可以做类似的事情。 因此,无论何时应用优惠券优惠券代码,页面都会刷新,按钮将启用。 同样检查你需要放入Mage_Checkout_OnepageController的indexAction。

A brief idea I can give here.

Create a backend module, which has own db tables to save linking of products ID to specific coupon, multiple coupon or just a check that coupon is required, depending on your case. From this Module you should be able to define such linking of product to coupon. Since customer apply a coupon code at cart page, so we will let customer add product into cart. Then edit isDisabled method of Mage_Checkout_Block_Onepage_Link class. where you will check if your quote has any product from the product-coupon linking defined in your module and coupon is not applied yet. Similar thing you can should do for Multishipping method if it is enabled in your Magento. So whenever coupon coupon code will be applied page will refresh and button will get enabled. Same check you will need to put in indexAction of Mage_Checkout_OnepageController.

更多推荐

本文发布于:2023-08-06 13:08:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1448458.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:优惠券   产品   Magento   require   product

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!