php 如何禁用 magento 在线销售功能?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2840441/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 07:50:37  来源:igfitidea点击:

How to disable magento online sales functionality?

phpmysqlmagento

提问by SIA

I am implementing Magento Community edition and want to disable the "add to cart" functionality temporarily until i am prepared to proceed with online orders.

我正在实施 Magento 社区版,并希望暂时禁用“添加到购物车”功能,直到我准备好处理在线订单。

I wanted to use Magento without checkout and add to cart functionality.

我想在没有结帐的情况下使用 Magento 并添加到购物车功能。

Please advice. SIA

请指教。新航

回答by Nick

The add to cart buttons are all held in their own file in template/catalog/product/view/addtocart.phtml. You could replace the buttons with a temporary message.

添加到购物车按钮都保存在自己的文件中template/catalog/product/view/addtocart.phtml。您可以用临时消息替换按钮。

You can disable the onepage checkout in the configuration (System >> Configuration >> Sales >> Checkout >> Checkout Options >> Disable Onepage Checkout). I've just tested this, however, and Google Checkout remains, so it's not a solid solution.

您可以在配置中禁用单页结帐(系统>>配置>>销售>>结帐>>结帐选项>>禁用单页结帐)。但是,我刚刚对此进行了测试,并且 Google Checkout 仍然存在,因此它不是一个可靠的解决方案。

回答by lphmedia

You could set the minimum order amount to 10million (or whatever) in the sales config - so when someone adds something to their cart you can have a custom message telling them the site is in test mode or whatever

您可以在销售配置中将最低订单金额设置为 1000 万(或其他) - 因此,当有人向他们的购物车添加商品时,您可以收到一条自定义消息,告诉他们该网站处于测试模式或其他任何方式

回答by macki

While there is no configuration switch to do just that, why don't you just comment out (php style) add to cart buttons from product/category pages and all links to checkout?

虽然没有配置开关可以做到这一点,但您为什么不从产品/类别页面和所有结帐链接注释掉(php 样式)添加到购物车按钮?

Note: it is not fully safe - someone can go to checkout URLs directly. Play with disabling shipping/payment methods so they cannot go through.

注意:它并不完全安全 - 有人可以直接去结帐 URL。玩禁用运输/付款方式,使他们无法通过。

If you have Enterprise Edition, you can use category permissions feature to disable Buy or Show Price functionality per category.

如果您有企业版,您可以使用类别权限功能禁用每个类别的购买或显示价格功能。

回答by shaune

There is an option to restrict the magento installation (including front end) with a whitelist of IP addresses. Login to the backend, go to System -> Configuration -> Advanced/Developer -> Developer Client Restrictions. Get your IP address by using a tool like thisand then put that in the field. That will make it so that the site only works for computers coming from that IP address.

有一个选项可以使用 IP 地址白名单来限制 magento 安装(包括前端)。登录后台,进入系统 -> 配置 -> 高级/开发者 -> 开发者客户端限制。使用这样的工具获取您的 IP 地址,然后将其放入该字段。这将使该站点仅适用于来自该 IP 地址的计算机。

I like this solution better than the others mentioned here because there aren't any code changes needed. The drawback, of course is that you can't just show your website off to the world before you are ready to go live.

我比这里提到的其他人更喜欢这个解决方案,因为不需要任何代码更改。当然,缺点是您不能在准备好上线之前就向全世界展示您的网站。