Problem/Motivation
The module causes /cart
to always redirect to /checkout
, except when the cart is empty.
Proposed resolution
In commerce_responsive_ui.pages.inc
, the function commerce_responsive_ui_commerce_cart_view
on line 21 has a 'viewname | display name' string compared with a 'viewname' string and fails, dropping through to 'Fallback to checkout.'
$view_name = variable_get('commerce_responsive_ui_cart_override', 'commerce_cart_form');
The proposed resolution, by Neo13 and RaphaelBriskie, is to add the following three lines:
if ($view_name != 'commerce_cart_form') {
$view_name = substr($view_name, 0, strpos($view_name, '|'));
}
Remaining tasks
Review and commit.
User interface changes
None (other than lack of unexpected redirection).
API changes
None.
Data model changes
None.
Original report by JDSaward
The module causes /cart to always redirect to /checkout, except when the cart is empty.
This is because, in commerce_responsive_ui_commerce_cart_view, a 'viewname | display name' string is compared with a 'viewname' string and fails, dropping through to 'Fallback to checkout'.
'viewname | display name' string: $view_name = variable_get('commerce_responsive_ui_cart_override', 'commerce_cart_form');
'viewname' strings: $enabled_views = views_get_enabled_views();
Comment | File | Size | Author |
---|---|---|---|
#7 | commerce_responsive_ui-fixes_cart_redirect_checkout-2641754_7.patch | 752 bytes | rootwork |
Comments
Comment #2
Neo13 CreditAttribution: Neo13 commentedI can confirm the issue. It can be fixed with substracting |default form the $view_name variable.
Comment #3
ropic CreditAttribution: ropic commented+1 Confirmed
Comment #4
RaphaelBriskie CreditAttribution: RaphaelBriskie commentedShould actually be:
So that if the default (non responsive) cart view is selected then it won't have the same redirect issue.
Comment #5
RaphaelBriskie CreditAttribution: RaphaelBriskie commentedOr possibly check to see if $view_name has a '|' instead.
Comment #6
DoubleGJ CreditAttribution: DoubleGJ as a volunteer commentedi used the #4 and it works, thank you JDSaward, Neo13 and RaphaelBriskie :)
Comment #7
rootworkHere is #4 in patch form.
Given the pretty significant unexpected behavior this bug introduces, I think it's reasonable to at least raise the priority to major.
Comment #8
rootworkUpdated issue summary just to make things a little clearer in the hopes of getting this committed.
Comment #9
oana.hulpoi CreditAttribution: oana.hulpoi as a volunteer commentedI confirm the issue. Thanks for the patch, it works :)
Comment #10
tyler.frankenstein CreditAttribution: tyler.frankenstein commented#7 also works for me.
Comment #11
rootworkIf/when this patch gets committed, credit should go to @Neo13 and @RaphaelBriskie. All I did was roll their fixes into a patch.
Comment #12
rv0 CreditAttribution: rv0 at Coworks.be commented+1 for this fix
Comment #13
HansKuiters CreditAttribution: HansKuiters commentedReviewed, tested and approved.