Closed (fixed)
Project:
Commerce Add to Cart Confirmation
Version:
7.x-1.0-rc2
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2017 at 02:48 UTC
Updated:
1 Feb 2018 at 18:19 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
deggertsen commentedIt's working for me. It should trigger a javascript event to close the popup window I think just like the X at the top right corner. Can you check your browser console to see if any errors are coming up?
Comment #3
dankoB commentedI've just noticed that it's only when logged in as the Admin. I think it's a Views edit overlay that's interfering.
The other issue is that clicking it just takes the user back to the last item being purchased. Is there a setting to change this to route to the main store page instead?
Comment #4
deggertsen commentedI'm pretty sure you could override the theme function theme_commerce_add_to_cart_confirmation_message() in your theme to change it. Here's the existing theme function:
Here's an article on how to override a theme function: http://redcrackle.com/blog/how-override-theme-functions-drupal-7
You would basically copy this function to your theme template.php file and change the href="#" to point to whatever page you want it to go to.
Comment #5
dankoB commentedI followed those steps, but no change. Placed the function text as above into the template.php file of my theme folder, changed function name to reflect my theme's name, changed a href to point to "/?q=products". Cleared caches and tested in a non-admin account. When I go to that point in an order I see a pointer finger icon when I hover over either button, but the Continue shopping button is gray and goes nowhere (no address visible in lower left corner of browser during hover) while the Go to checkout button is blue and indicates it is pointing to .../?q=cart. Using Chrome to inspect, shows Go to checkout for button checkout, but no href for button continue, just Continue shopping ==$0
Comment #6
deggertsen commentedThe continue shopping button is meant to be gray even when it is working. You would need to override the CSS if you want it to be a different color.
So I'm assuming you put something like this in your template.php file?
If that's what you've done, I'm not sure what else would fix if for you... Just make sure that where I've got "YOURTHEME" you are using the machine name for your theme.
Also, you should really consider setting up clean urls... https://www.drupal.org/docs/7/configuring-clean-urls/enable-clean-urls
Comment #7
dankoB commentedIt think the lack of CSS override could be related to using Commerce Kickstart but with a theme in sites>all>themes, similar to the problem described here: https://www.drupal.org/forum/support/post-installation/2013-05-10/css-ov...
I'm not certain how to get around that though. Tried creating a custom subtheme, but I haven't any experience with that and ended up with many more new problems while still not successfully addressing the initial one. So for now I'm back to where I started.
Thanks for the reminder about the clean urls. For some reason the site didn't let me enable them when I first tried, but now it's ok with it.
Comment #8
deggertsen commented@dankoB yeah, you will definitely need to know how to create a subtheme or your own theme in order to get any of my solutions here to work. I'd be happy to commit any patches to this module to give UI config options for setting the Continue Shopping link, but I will not be spending the time to do that myself without compensation.
Comment #9
dankoB commentedNo prob, I don't blame you. Creating a subtheme has created more problems than it's worth, so I may have to live with it as is.
Could the override problem be related to differences between rc2 vs rc3? I have Kickstart installed, containing your module rc2 within it. The module update page doesn't indicate that your rc3 is available. Is there a way to force an update or is that not recommended?
Comment #10
deggertsen commentedAhhh, I didn't notice that you're using rc2. rc3 introduces some major changes that help the module A LOT. I personally haven't worked with installation profiles much and don't really use them so I'm not sure if there is a way to override that or anything. I would assume that you can still go to the update page /admin/modules/update and download the rc3 version there. I would try it as it should work much better for you than rc2. It won't fix your Continue Shopping button other than that it should actually work to close the popup when clicked.
It looks like there is already an issue for this open in Commerce Kickstart: #2910644: Update Commerce add to cart confirmation
Comment #11
dankoB commentedUnfortunately the update page has a warning to not try to update individual components of a distribution. I'll have to wait for the next official Commerce Kickstart update. When I decided to use Kickstart I thought it was simply the latest Drupal with a nicely selected group of modules to go with Commerce. I didn't realize it would have a different installation structure and associated limitations.
Comment #12
nigelcunningham commentedI've given rc3 a go and found that to get working close buttons, I needed to modify the javascript so it looks for a different class to .commerce-add-to-cart-confirmation. I've prepared a patch that lets me override the value in the theme, in pretty much the same way as other settings are supported. The only difference is that I haven't assumed the selector will always be a class (it might be an id) so I've put the full stop in the default value instead of prepending (ala overlayClass handling).
Regards,
Nigel
Comment #13
deggertsen commentedNigel, thank you for your patch. Could you provide some documentation as to how someone would use this patch to override the value in the theme? With that documentation I would feel more comfortable with committing this patch.
Comment #14
nigelcunningham commentedIt's just the same as the existing settings. In my template.php, I have a hook implementation:
$settings = array(
'commerceAddToCartConfirmation' => array(
'overlayClass' => 'commerce_add_to_cart_confirmation_overlay',
'overlayParentSelector' => 'body',
'overlayContentSelector' => '.messages--commerce-add-to-cart-confirmation',
),
);
And commerce_add_to_cart_confirmation_message.tpl.php in the templates directory.
Regards,
Nigel
Comment #15
nigelcunningham commentedComment #17
deggertsen commentedGreat, thank you NigelCunningham. I hope this will solve this issue for others as well.