be090129 / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

Removing all shipping rates results in multiple failures #88

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you remove all shipping rates through the admin panel, when you attempt
to save the shipping, you get a 500 error, even though you're able to
return later and see no shipping rates. When checking out an item, there
will be no shipping to select, and hitting the send button to continue
there will be a 500 error effectively preventing the customer from
completing a checkout.

Workaround: adding new shipping rates or adding a single 0 dollar shipping
rate will fix this issue.

Original issue reported on code.google.com by charles....@gmail.com on 14 May 2008 at 2:04

GoogleCodeExporter commented 8 years ago

Original comment by subim...@gmail.com on 16 Aug 2008 at 3:43

GoogleCodeExporter commented 8 years ago
I think I fixed this but now I need to figure out how to make a patch quick. 
all this does is prevent you from saving if you delete all the rates. I'll try 
to
come up with a more robust solution.

this is what I did:

 def save_shipping
    # Index is the shipping type ID.
    if(params[:shipping_types].nil?)
        flash[:notice] = "Please Add At least one Shipping rate."
        redirect_to :action => 'shipping'
    else
    params[:shipping_types].each do |id,type_attributes|
      type = OrderShippingType.find(id)
      type.update_attributes(type_attributes)
    end
    flash[:notice] = "Shipping Rates Saved."
    redirect_to :action => 'shipping'
    end
  end

Original comment by sclarkla...@gmail.com on 26 Aug 2008 at 9:45

GoogleCodeExporter commented 8 years ago
That work-around will work in preventing a crash from happening.  What about 
adding a
prompt so that the administrator can add a zero dollar shipping rate if they 
don't
want shipping? (you run into that with a website that sells only downloads, or 
runs
on donations)

Original comment by charles....@gmail.com on 27 Aug 2008 at 5:07

GoogleCodeExporter commented 8 years ago
Fixed in r150.

I ensured there is no error saving rates, and no errors happens on the store 
side
during checkout.

Still this poses an interesting design discussion. Perhaps we should be able to
eliminate the shipping step all together if there are no rates, or through 
preferences.

Original comment by subim...@gmail.com on 29 Aug 2008 at 4:29