On the checkout pane in some situations shipping is shown at the top. These situations are:
1) you have shipping service on the checkout pane.
2) you have progressed partly through the checkout and then used the go back options or left the process and returned.
In both of these cases shipping is now showing on the checkout pane where you can change the shipping address but the shipping price stays the same until you move on and come back again. This seems like a silly notion because in scenario 2 you are showing shipping costs before they have selected a valid shipping service for their order & address. I haven't tried it on a service with a per item price but I imagine that would not update either. In scenario 1 you have 2 conflicting bits of info that need more ajax to fix. So my question is why do we have shipping price here at all? I assume it is because the same view is used on checkout pane as is on review pane where shipping should be shown. As a fix for myself I altered the view so under view footer where it had:
Commerce Order: Order total
It now has:
Commerce Line Item: Line item summary (Item quantity, Total)
Commerce Order: Order total
Then in the theme I had to use this hack to switch between the footers depending if it was on the review pane or not:
function andromeda_preprocess_views_view(&$vars) {
if($vars['view']->name === 'commerce_cart_summary') {
if(substr(current_path(), -7) === '/review') {
$vars['footer'] = preg_replace(';<div class="line-item-summary">.*(<div class="commerce-order-handler-area-order-total">);msui','${1}',$vars['footer'],1);
}
else {
$vars['footer'] = preg_replace(';<div class="commerce-order-handler-area-order-total">.*$;msui','',$vars['footer'],1);
}
}
}
I'm sure you can see why this makes me nervous. Any change in the markup or even the order of the footer options would break this hack. Does anyone know a better way around this?
Comments
Comment #1
svouthi commentedHello. I am having the same issue with version 7.x-2.0 and would love to see a real fix for this. Thank you for sharing your workaround, Daemon_Byte.
Comment #2
Daemon_Byte commentedNo problems. I'm actually working on a way to put the country drop down in the cart itself so then by checkout it won't be an issue for me as all postage is only based on country so I can share that when I get it to work but I suspect some deeper logic exists here that I don't understand enough to try to fix myself.
Comment #3
anybodyI think this can be cleanly solved using an additional rule. I'll create a separate issue for that because I had a similar issue with a more general solution.
Comment #4
anybodySorry for the delay. Here's the issue with the solution for the problem described: #2642336: Add rule default to delete shipping line items on shopping cart update. Please mark this issue as duplicate if the solution works for you. It should be general and written the Drupal Commerce way. :)
Comment #5
anybodyComment #6
googletorp commentedComment #7
anybody