Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wasn't really sure whether to make this a bug or a task. It is sort of both. A small but important thing, potentially confusing for customers (if the site admin does not notice).
Cart and checkout are not the same thing.
This module should say 'Go to cart', or better, it should actually go to the checkout. If a customer has not decided to 'continue shopping', plus they see the information in the popup box, then they probably want to go directly to checkout.
We must remember that the more clicks a customer makes, the less likely it is they will complete the process.
Comment | File | Size | Author |
---|---|---|---|
#11 | label_and_url_config-2346681-11.patch | 3.56 KB | deggertsen |
Comments
Comment #1
mikeaja CreditAttribution: mikeaja commentedFor those that see the issue here and want to fix themselves, it's very simple.
In thie file, commerce_add_to_cart_confirmation.rules.inc, line 36, change:
$message .= '<div class="button checkout">' . l(t('Go to checkout'), 'cart') . '</div>';
to
$message .= '<div class="button checkout">' . l(t('Go to checkout'), 'checkout') . '</div>';
or alternatively, change to 'Go to cart' to improve the logic.
Left Active as I see this as a fix stil needed in this module.
Comment #2
mikeaja CreditAttribution: mikeaja commentedComment #3
pslcbs CreditAttribution: pslcbs commented@mikeaja, not good idea to hack the code inside the module if you have clean alternatives to do the same.
Instead copy the function theme_commerce_add_to_cart_confirmation_message($variables) containing this code in your theme template.php, rename it as YOURTHEME_commerce_add_to_cart_confirmation_message($variables) and make your changes there.
Comment #4
guy_schneerson CreditAttribution: guy_schneerson commentedIdeally both the checkout label and the URL should be configurable as some systems like PayPal express checkout require you to go to the cart page as this is where the EC checkout starts while others prefer to go straight into checkout.
Comment #5
gokulnk CreditAttribution: gokulnk at Azri Solutions commentedBased on guy_schneerson's comment I just created a patch that add two config option in the rule admin interface. I agree that this will be very helpful for the non-coders. A must have feature according to me.
I have not tested the patch, but I hope it should work without any issues.
Comment #6
gokulnk CreditAttribution: gokulnk at Azri Solutions commentedComment #7
HazaI don't have a fresh install of commerce to test the patch.
Can someone test it with a special attention to the case when you apply the patch to an existing install. I just want to be sure I will still work when we change the rules part.
Thanks.
Comment #8
gokulnk CreditAttribution: gokulnk at Azri Solutions commentedHaza,
Did you get a chance to review this?
I created the patch for an existing inssance and didn't have any issues. Since we are adding default values to the settings, it should not cause any issues.
Comment #9
deggertsen CreditAttribution: deggertsen as a volunteer commentedI'm getting errors with the patch:
Parse error: syntax error, unexpected ';' in /sites/all/modules/commerce_add_to_cart_confirmation/commerce_add_to_cart_confirmation.module on line 75
and
Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /sites/all/modules/commerce_add_to_cart_confirmation/commerce_add_to_cart_confirmation.rules.inc on line 48
Also, it will be important that we include defaults in the commerce_add_to_cart_confirmation.rules_defaults.inc file for the LINK LABEL and TARGET URL so that the rule works upon enabling of the module.
Otherwise, I like where this is going! It's always nice when you don't have to hack the module.
Comment #10
deggertsen CreditAttribution: deggertsen as a volunteer commentedHere's a patch with the errors fixed that I mentioned above. Looks like everything is working great! Take a look and mark as RTBC.
Comment #11
deggertsen CreditAttribution: deggertsen as a volunteer commentedJust needed to fix a few whitespace issues.
Comment #12
gokulnk CreditAttribution: gokulnk at Azri Solutions for Aziteez commentedHi deggertsen,
As I had mentioned I had not tested the patch. I wrote it when I had a few minutes and didn't have access to the a commerce instance. Thanks for catching errors and polishing the patch.
I tried this out on a fresh install of Commerce and this module. I have tested two scenarios.
Comment #13
gokulnk CreditAttribution: gokulnk at Azri Solutions for Aziteez commentedI always forget to update the status :)
Comment #14
deggertsen CreditAttribution: deggertsen as a volunteer commentedYeah, we should be able to do a hook_update for this so that it will not break the rule for users that are updating. I think it would be something like this (I haven't tried this and have not written an update hooks with rules before so there are likely problems with it):
I think this will just create a new action though rather than overwrite the old one... Definitely needs work.
Comment #15
deggertsen CreditAttribution: deggertsen as a volunteer commentedI've included a temporary fix included in my patch (rework_CSS-1980658-6.patch) in #1980658: Completely redo CSS. I'll be using that until we can get the details worked out in this issue.