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.
Hi all,
I am using Commerce Kickstart 7.x-2.13. This module works fine for me with the default Omega 3 theme but when I switch to my own Omega 4 theme the overlay does not work. The HTML looks ok and the js file is there but when I look the page source it seems the js file is not listed.
Any ideas please?
Comment | File | Size | Author |
---|---|---|---|
#14 | 2265253.alterable_overlay_settings.patch | 3.59 KB | rszrama |
#9 | commerce-add-to-cart-confirmation-omega-4.patch | 9.01 KB | nightlife2008 |
#2 | not-working-in-omega-4-2265253-2.patch | 12.05 KB | jjcarrion |
Comments
Comment #1
Juc1 CreditAttribution: Juc1 commentedComment #2
jjcarrionHi Juc1,
I had the same problem with a normal commerce (not kickstart) and omega 4. The problem is that omega 4 put the name of the class as 'messages--commerce-add-to-cart-confirmation' instead of 'commerce-add-to-cart-confirmation', so nothing works.
I have made a patch to solve this problem, but this patch is not valid for the module because it would break the rest of the themes that doesn't add that 'messages--' to the class.
Do someone knows which could be the right way to solve this problem? (maybe it's an omega 4's problem)
I hope it would be useful.
Comment #3
Juc1 CreditAttribution: Juc1 commented@ jjcarrion thanks for the patch. I asked fubhy (maintainer of Omega 4) about this on irc so here are my questions and his answers:
[13:13] fubhy: hi do you have any comments about this please? https://drupal.org/node/2265253
[13:15] Juc1, @see omega/theme/status-messages.theme.inc
[13:15] override that in your theme and put back the drupal core default class names
[13:15] or add the corresponding CSS to your own theme
[13:15] (and the .js)
[13:16] you can, for example, create a custom .js file in your theme
[13:16] and implement Drupal.behaviors.commerce_add_to_cart_confirmation_overlay
[13:16] that will override the implementation from the module
[13:18] fubhy: ok thanks so is the problem at the moment that the js file is not being called because the message class name is wrong?
[13:18] the js file is called but it does not find the div because the css class is different
[13:19] that's a problem with how drupal contrib usually writes css
[13:19] depending on class selectors is terribly wrong in most cases
[a patch like jjcarrion's] fixes it for omega, in the module but doesn't actually fix it globally
[13:28] fubhy: ok so would this be fixed globally by another patch I mean should this problem be addressed / fixed by the module ?
[13:30] not sure, it's a general problem with drupal
Comment #4
Juc1 CreditAttribution: Juc1 commented@ jjcarion I tried your patch - is it for 7.x-1.0-rc2 ?
Comment #5
jjcarrionHi Juc1
I had made the patch with the dev version downloaded with git. I think that the difference is that in the dev version we have:
$('body').append('<div class="commerce_add_to_cart_confirmation_overlay"></div>');
and in the rc2 version we have:
$('body').append("<div class=\"commerce_add_to_cart_confirmation_overlay\"></div>");
(the filter doesn't show the \", it's like this: class=\"commerce_add_to_cart_confirmation_overlay\")
You can change the patch with the right line before apply it. Anyway, if you need me to remake the pacth let me know.
Comment #6
Juc1 CreditAttribution: Juc1 commented@ jjcarrion - does this look ok http://pastebin.com/rxAmRgPt line 244? But anyway it does not seem to work so yes can you please remake the patch?
Thanks...
Comment #7
MrPaulDriver CreditAttribution: MrPaulDriver commentedAny developments with a suitable patch?
Comment #8
JosRuiz CreditAttribution: JosRuiz commentedHi,
Is there an upgrade for this patch?
It works partially in my case. I get the pop up window with all the info, but I cannot click on "Continue shopping" or "Go to check out" neither can i close the pop up window.
Thanks.
Comment #9
nightlife2008 CreditAttribution: nightlife2008 commentedAttached is the patch file for version 7.x-1.0-rc2 (the latest atm).
Comment #10
MrPaulDriver CreditAttribution: MrPaulDriver commented@nightlife2008 That's a big patch isn't it?
Will this be commited to the module or left for Omega 4 users to patch as needed?
Comment #11
creativepragmatic CreditAttribution: creativepragmatic commentedThe patch works well on the Product Display page but on product list views pages, the confirmation does not show until you click away from the views page to an entity page.
Does anyone have any idea on how to rectify for product list views?
Update: After further digging, I've come to realize that this question is unrelated to this thread.
Comment #12
cosolom CreditAttribution: cosolom commentedI think the best idea it's place status-messages.theme.inc in omega subtheme (mytheme/theme):
Comment #13
rszrama CreditAttribution: rszrama commentedThere are a couple issues that keep this module from working on Omega 4: the messages-- prefix on the messages div class as previously mentioned but also, in my experience with an Omega 4 subtheme, the selector used to determine the parent element for the overlay div.
It's unfortunate that Omega adds the prefix it does to the class on the messages div, but it's equally unfortunate that this module is abusing the status type argument passed to drupal_set_message(). The API clearly states what the supported values are, and this module only gets by on a technicality, abusing the fact that it gets added as a class on the messages div to format itself.
The module should instead be using a different selector or different CSS to function properly.
For properly positioning the overlay element, I propose a fix whereby an alterable settings array is passed from the module code to JavaScript, so the module's JS has module configurable classes / selectors to use. Patch incoming.
Comment #14
rszrama CreditAttribution: rszrama commentedAttached (and committed).
Moving back to "Active" so the module's abuse of the drupal_set_message() type parameter can be patched properly.
Comment #16
vbard CreditAttribution: vbard as a volunteer commentedlatest dev does not work with omega 4. It just adds the contents of a modal to the top of a page, where messages usually appears.
Comment #17
vbard CreditAttribution: vbard as a volunteer commentedFound that!
You need to copy omega/theme/status-messages.theme.inc to your subtheme/theme/status-messages.theme.inc. Than open it, and change
$output .= '<div class="messages messages--' . $type . '">';
to
$output .= '<div class="messages ' . $type . '">';
save file and clear cache.
Thanks cosolom #12!
Comment #18
deggertsen CreditAttribution: deggertsen commentedAssuming this is fixed as the patch has been committed.