Not sure if this should be reported in shipping or flat rate? I am using latest dev versions of both shipping and flat rate on commerce 1.4 & Drupal 7.20.

We have 4 shipping options set up, commerce UPS and 3 other flat rate options. I keep finding all shipping prices have disappeared on the review page after selecting - when shipping is either on the checkout pane or its own shipping pane, shipping line item not showing in the cart summary or lower down despite shipping service set to "Include this pane on the Review checkout pane." in a non collapsible pane.

I have "Calculate shipping rates via AJAX as addresses are updated on the checkout form." ticked and have the shipping on its own checkout pane. I have noticed that by moving the shipping to the previous pane and then back it does re-appear but not permanently. I thought it may be a permissions issue but there are no permissions to set on shipping from a view point.

Comments

ibuildit’s picture

I experience the same thing. Really weird!

ibuildit’s picture

Priority: Normal » Critical

I'm still having this issue. It stuck for a while but after some changes to the shipping settings it's now gone from the checkout which is well, bad.

My Watchdog is full of this:

Warning: htmlspecialchars() expects parameter 1 to be string, array given i check_plain() (rad 1559 av /Users/jakobnystrom/Sites/grow/includes/bootstrap.inc).

6 identical of these are generated when I try to save the order setting.

ibuildit’s picture

If I manually alter the database values, there is no change. When I click save in the drupal ui after changing the DB values, the values are changed back to disabled again.

ibuildit’s picture

and just as mysterous as it stopped working, it started to work again.

the only thing i did was to disable checkout login module. when enabling it again, the reordering still worked though.

but now really i don't want to touch anything, I'm supposed to launch tomorrow. :-D

ibuildit’s picture

Priority: Critical » Normal

just changing back from critical to normal

ibuildit’s picture

Priority: Normal » Critical

And there it broke again.

ibuildit’s picture

But its not related to flat rate. Same problem when flat rate is disabled. Should be moved to commerce_shipping, or maybe commerce?

ibuildit’s picture

Priority: Critical » Normal

False alarm. It happens because of module version incompatibilities. Not sure which ones just yet.

kevster’s picture

I have shipping on its own pane now and it seems to be behaving ok, its been on a busy live site and ive not had to touch it for a while! It adds an extra step to the checkout process which is a pain but its stable...

rszrama’s picture

Category: Bug report » Support request
Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Sorry you guys had issues, especially on live sites! And sorry we didn't see the support request sooner. I haven't experienced any problems with disappearing shipping line items, but I'll keep an eye out and let the maintainer of the UPS module know to keep an eye out as well. Hope you got this sorted out a long time ago. : )

PQ’s picture

Status: Closed (cannot reproduce) » Active

I'm having the same issue as above, and having debugged for a few hours, I've found that what seems to be happening is somewhere around when commerce_shipping_pane_checkout_form_validate() is called, the line_item_id value in the commerce_line_items table for the shipping item is increasing by one, so where the line item row had previously existed with an id of "1234", that has disappeared and been replaced with the same row but with an id of "1235".

The line items field on the order still references the old line_item_id which now points at nothing so the line item gets removed next time the order is saved.

I don't know if the line item is being deleted and recreated or if the table is being updated via a simple query. I haven't been able to track down the code that's doing that.

Any advise would be greatly appreciated.

PQ’s picture

Status: Active » Closed (cannot reproduce)

My bad, I had a custom submit handler that was getting the order from the submit handler, populating the value of a custom value and saving it. This was happening after commerce_shipping_pane_checkout_form_submit() had run which removes and re-adds shipping line items but the order in the form_state was out of date and still referenced the now deleted line item.

If it helps anyone else who's made the same mistake, the solution was to The solution was to change this:

  $order_wrapper = entity_metadata_wrapper('commerce_order', $form_state['order']);
  $order_wrapper->field_MY_CUSTOM_FIELD->set(MY_CUSTOM_FIELD_VALUE);
  $order_wrapper->save();

to this:

  $order = commerce_order_load($form_state['order']->order_number);
  $order_wrapper = entity_metadata_wrapper('commerce_order', $order);
  $order_wrapper->field_MY_CUSTOM_FIELD->set(MY_CUSTOM_FIELD_VALUE);
  $order_wrapper->save();

Restoring the issue status to "Cannot reproduce" to reflect the OP's issue.