Shipping does not appear on anonymous order information page even with option
"Hide shipping costs until an address is entered: No"

I'm using latest commerce dev and have a flat rate shipping method that works well on subsequent pages

It's important to be able to show the shipping cost in order to have shipping and payment panes on same page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

francois o created an issue. See original summary.

francois o’s picture

Issue summary: View changes
bojanz’s picture

Make sure you've followed all of the instructions in the module README. Let's eliminate that as a factor first.

francois o’s picture

From the read me:

2. Edit your product variation type and enable the 'Shippable' trait : YES

3. Edit your order type:
- Select one of the fulfilment workflows. WORKFLOW IS FULFILMENT
- Enable shipping and choose a shipment type. SHIPPING TYPE IS SET TO MY FLAT RATE SHIPPING
- Select the 'Shipping' checkout flow !! I DON"T SEE A SHIPPING CHECKOUT FLOW OPTION BUT IT IS SETUP TO MY OWN CHECKOUT FLOW WHERE I HAVE THE SHIPPING PANE CONFIGURED.

Overall shipping works fine, it just does not show the shipping cost in the first checkout page order summary.

bojanz’s picture

So the pane actually shows up and works, but when you proceed to the next (Review) page, you can't see Shipping in the order total summary? That's the issue?

francois o’s picture

No the opposite, I can't see shipping cost in the "order information" order total summary , once in "review" shipping cost appears.

bojanz’s picture

Category: Bug report » Support request
Status: Active » Fixed

There is no code that ajax-replaces the order summary when you select a shipping method.

Opened a feature request to track that: #2898118: Update the order summary via AJAX when a shipping rate is selected.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

golubovicm’s picture

I'm sorry I have to re-open this. I have latest version of D8 core and all the modules (core 8.7.1, commerce 8.x - 2.13, shipping 8.x - 2.0-beta 6
Didn't use commerce kick-starter (or what ever it's called) but installed everything with composer, without any issues reported. Using "Datatrans" payment method if that makes any difference. So everything is pretty much fresh installed.
Also:

1. In all my product variation types "shippable" is checked
2. I have 1 order type and inside it:
- "fulfillment" order type is selected (tried both of them, with and without validation)
- shipment is enabled and default (only one) shipment type is selected
- "shipping" checkout flow is selected
3. I'm experimenting with default drupal theme Bartik 8.7.1. (not modified)
4. Also tried changing "Hide shipping costs until an address is entered" to "no" at shipping checkout flow.
5. Using basic flat rate shipping rate, without any restrictions.

So in back-end everything seems to be ok, but none of the shipping information is ever displayed on front end. Not on order information page and not on any other page.

Any idea?

ben.hamelin’s picture

I had this issue as well, and wasn't able to see the shipping options or calculated costs until I added a "Package Type" and then assigned that package type to the shipping method.

selinav’s picture

Same problem as #9.
Test #10 but, it doesn't works for me. I've well the div #edit-order-fieldscheckout-shipments-wrapper but the select list is empty (only none) and the label is not translated.

Moreover on admin/commerce/config/order-types/default/edit, only the last shipment type appears. I can't change the select list because other values are not loading.

Drupal 8.7.9
Commerce 8.x-2.15
Shippping 8.x-2.0-beta7

JoshaHubbers’s picture

On the (form) display (/admin/commerce/config/order-types/default/edit/form-display and /admin/commerce/config/order-types/default/edit/display) the "Shipment" fields were in the "disabled" section. Maybe in your case too?

JoshaHubbers’s picture

selinav’s picture

no it is well enabled. I have selected entity returned.

21kPiyush’s picture

I am have the same problem any solution to solve this.

selinav’s picture

FileSize
96.98 KB

It is not display the good thinks on checkout order.

For example, on checkout/6/order_information
In the shipment list : I have the name of my previous shipping that I've done on admin/commerce/orders/3/shipments.

How to display on checkout order shipping methods set in admin/commerce/config/shipping-methods ?
ex : DHL 24h, TNT 48h, ...

See attached file.

Please can you help us ?
Thanks in advance.

golubovicm’s picture

Version: 8.x-2.0-beta3 » 8.x-2.x-dev

Tested this a bit with debugger:

When I add some item to empty cart and go to cart page shipping is not displayed at all (tried #10 and #12).
If I understood well this code inside process() method of EarlyOrderProcessor class is making that decision, should shipping costs be displayed or not:

  /**
   * {@inheritdoc}
   */
  public function process(OrderInterface $order) {
    if (!$this->shippingOrderManager->hasShipments($order)) {
      return;
    }

So at start this call just returns and does not "attach" shipping costs. That hasShipments() is checking if order has shipment fields and is it empty. At start it has the field but it's empty, it returns false and execution of that process() method ends.

At that point in database I do have record inside commerce_order table, but there is no record inside commerce_shipment related to that order.

However if I continue with checkout process, as soon as I'm redirected to offsite payment (Datatrans) record in commerce_shipment is created and it points to order record inside commerce_order table.

I return back from offsite payment before completing the process. So cart items are still there, but now shipment costs are displayed.

I'm not that familiar with the checkout process, but obviously, some action, which is triggered before very end of checkout process, immediately before user is redirected to offsite payment is creating that record and attaching it to the order. Imho that should happen much sooner, when cart page is visited for the first time or before, but I don't know where/when exactly and why is that not happening? Cold be that it's skipped for some reason unknown to me.

I read and double checked installation instructions many time, but I still don't exclude that I configured something wrong. But again there's a chance that we have a bug.

Please help. I'll gladly do any kind of tests, to solve this issue.

bojanz’s picture

@golubovicm
Shipments are created the first time you submit the Shipping Information pane (and its parent page). That explains the behavior you're seeing. Shipping costs are not shown until shipments are created, so not seeing costs on the cart page is also expected.

golubovicm’s picture

Solved the issue I had by implementing ShippingOrderProcessor written by @jsacksick

https://gist.github.com/jsacksick/fde031197df92236ef5a916775e17a2e

When adding it, just put some higher priority (I set 300) or shipping info won't appear after putting first item in cart. When done proper way shipping will be displayed on cart page and all following steps.

Some more info here: https://drupal.stackexchange.com/questions/297556/shippingorderprocessor...

Also, for me, conditional shipping (i.e. if cart total > $100) was also problematic, but promotions are working well.

TAREK GOUDA’s picture

FileSize
13.23 KB
19.84 KB
25.26 KB
25.48 KB

Hello,

Drupal 9.14 + Commerce 2.24 + Commerce Shipping 2.0-rc2

Solved for me with these steps:

1. Add any Shipping Method.

2. Product variation types "shippable" should be checked.

3. Order type "enable shipping for this order type" should be checked.

4. (IMPORTANT) Checkout flows > Shipping "shipping information" should be enabled and placed in "Order information" section.

all the other steps mentioned in the other replies are not mandatory for the solution.

mazze’s picture

@tarek you made my day, thank you for sharing:-)

hockey2112’s picture

#20 worked for me. I did not have "enable shipping for this order type" enables. D'oh!

tonytheferg’s picture

This is still an issue. fresh install, followed all the steps above, using the shipping checkout flow, and no shipping information was appearing on the order information page.

And though my chekout flow was set to shipping, I went to the default checkout flow, and enabled the the shipping information pane, and the changes to the default checkout flow took effect even though I am using the shipping checkout flow.

tonytheferg’s picture

Category: Support request » Bug report

This is a bug, and should be reopened.

jsacksick’s picture

And though my chekout flow was set to shipping, I went to the default checkout flow, and enabled the the shipping information pane, and the changes to the default checkout flow took effect even though I am using the shipping checkout flow.

Well, if the order was created prior to updating the checkout flow for that order type, that is expected. Once the checkout flow is resolved/determined, it's determined once for good and not resolved afresh everytime.

Since this is a pretty old issue. It's probably worth reopening a fresh bug report with reproducible steps, because I'm currently unclear what the actual problem is.

tonytheferg’s picture

Can do

wheelercreek’s picture

I had similar issue and found that order types was missing the default shipping field:
https://www.drupal.org/project/commerce_shipping/issues/3241197#comment-...