简体   繁体   English

禁用主动运输大礼包

[英]Disable active shipping spree

I am creating an e-commerce store using Rails and Spree Commerce. 我正在使用Rails和Spree Commerce创建一个电子商务商店。 It took 10 minutes for me to setup everything and run. 我花了10分钟来设置所有内容并开始运行。 My country and state are listed in the admin configuration settings. 我的国家和州在管理员配置设置中列出。 When I'm about to check out my carts, fill in the address and hit save and continue button, I get the following error message: 当我要检查购物车时,填写地址并点击保存并继续按钮,我收到以下错误消息:

Cannot find shipping fees for selected item 找不到所选商品的运费

In my case right now, I don't want to use active shipping gems or anything that verifies the address is available or not. 就我而言,我现在不想使用主动运送的宝石或任何可验证地址是否可用的东西。 I want to disable the checking function on the shipping address. 我想禁用送货地址上的检查功能。 I just want to let the customer fill in the shipping address only stored in the database. 我只想让客户填写仅存储在数据库中的收货地址。 Tax for shipping per distance isn't necessary in my case. 在我的情况下,无需按距离收取运输税。

you can do a 3 things in this case 在这种情况下,您可以做3件事

  1. Use free shipping Promotion as @michaelmichael suggested. 使用@michaelmichael建议的免费送货促销活动。

Or 要么

  1. Skip the delivery step from you checkout flow. 从结帐流程中跳过交货步骤。 Just override the order model as follows 只需重写订单模型,如下所示

     Spree::Order.class_eval do ... checkout_flow do go_to_state :address # go_to_state :delivery <== remove this line go_to_state :payment, :if => lambda { |order| order.payment_required? } go_to_state :confirm, :if => lambda { |order| order.confirmation_required? } go_to_state :complete remove_transition :from => :delivery, :to => :confirm end end 

    Or 要么

  2. Override this method to return true every time. 重写此方法以每次返回true。 (Will suggest don't use this option) (建议不要使用此选项)

     Spree::Order.class_eval do ... def ensure_available_shipping_rates true end end 

Without more information I can't give a conclusive answer to your questions, but I can give some general guidelines. 没有更多的信息,我无法为您的问题提供最终的答案,但是我可以提供一些一般性的指导。

I think it is very likely that you do not have zones, shipping methods, or shipping categories correctly set up. 我认为您很可能没有正确设置区域,运输方式或运输类别。

You must have zones, shipping categories, shipping methods, and a default stock location all set up properly before shipping will work. 您必须先正确设置区域,运输类别,运输方式和默认库存位置,然后才能进行运输。 Otherwise Spree will return the same error during checkout that you give above. 否则,Spree将在您结帐时返回与上述相同的错误。 Your comment that it took you 10 minutes to get the store up and running leads me to believe there's something in your setup that's missing. 您关于存储启动和运行花费了10分钟的评论使我相信您的设置中缺少某些内容。

Milind Phirake's answer above is good, but you should not have to override any of Spree's Order-related methods to get shipping to work. Milind Phirake的上述回答很好,但是您不必重写任何与Spree的Order相关的方法即可开始送货。 Just configure your store properly. 只需正确配置您的商店即可。

Refer to the Spree user guides on shipping for information on the parameters you will have to set up to get shipping to work. 有关为使运输正常工作而必须设置的参数,请参阅Spree的运输用户指南

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM