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.
# Summary
Provides an "add to cart" confirmation dialog, shown after the customer has added a product to his cart. Adds an "add to cart confirmation" view mode to commerce_product entities, and uses it to show the newly added product in the confirmation dialog.
# Project URL
https://www.drupal.org/project/commerce_add_to_cart_confirmation
# Where is the code?
Developing is in progress
# Estimated completion date
Unknown
# Dependencies
Unknown
# Who's doing the port?
Unknown
# What help do they need?
Unknown
# D8 roadmap
Unknown
# Background and reference information
Unknown
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedAnyone deciding to port this module: I think relying on https://awkward.github.io/backbone.modal/ is probably the best option.
Comment #3
iyyappan.govindComment #4
niko- CreditAttribution: niko- as a volunteer commentedDraft D8 version implemented here https://github.com/onatalushko/commerce_add_to_cart_confirmation
Comment #5
bojanz CreditAttribution: bojanz at Centarro commented@niko-
Thanks! I'd be happy to give you commit access.
Let's fix the following first:
- commerce_add_to_cart_confirmation.html.twig -> has untranslated strings (not run through |t)
- CommerceAddToCartConfirmationMessage has a PHPstorm generated docblock, remove it. Event subscribers should be suffixed with Subscriber. Commerce is a redundant prefix. Suggested new name: ConfirmationMessageSubscriber.
- The event subscriber uses the order item matcher for no reason, the passed event already contains the destination order item.
- commerce_add_to_cart_confirmation.module has a hook with no docblock, and is missing a proper @file docblock instead of the phpstorm one.
- The shipped config should not contain UUIDs (currently on line 1 of each YAML
- commerce_add_to_cart_confirmation.js has a cyrilic comment.
Would also be great to get a screenshot.
Comment #6
niko- CreditAttribution: niko- as a volunteer commentedHi @bojanz
Thanks for your reply and happy New Year and Merry Christmas
About
- The event subscriber uses the order item matcher for no reason, the passed event already contains the destination order item.
For your understanding why I have used order item matcher please check \Drupal\commerce_cart\CartManager::addOrderItem.
As you see CartEntityAddEvent event calls only if $order_item is not availible in the cart. So if user add some product to cart twice (1 quantity on first add to cart and 1 for the second add to cart ) event will call only for first one. Not sure that this is Ok and how we should manage this situation.
If the $combine seted to TRUE I think we must call event like this
but now it calls with "empty" $order_item
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedThat's a Commerce bug, let's fix it: #2840357: CartEntityAddEvent doesn't get the combined order item
Comment #8
niko- CreditAttribution: niko- as a volunteer commentedAlso https://www.drupal.org/node/2638958#comment-11848499 is blocker for normal implementation for this module.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commented@niko-
That issue is about Views relationships, your problem is about view modes, you'll need to open a new bug report.
Comment #10
niko- CreditAttribution: niko- as a volunteer commentedHere is bug about view modes https://www.drupal.org/node/2840386
Comment #11
niko- CreditAttribution: niko- as a volunteer commentedRepo on github was updated according to #5 except #8 also theming is in progress now
Comment #12
niko- CreditAttribution: niko- as a volunteer commentedinitial css pushed to repo see screanshort http://prntscr.com/dqnxj5
we need fix this https://www.drupal.org/node/2840386 to fianlize cssing
Comment #13
niko- CreditAttribution: niko- as a volunteer commentedGithub repo was updated latest changes.
1. OrderOtherCount views area
2. OrderItemOrderTotal views area
3. multiple minor fixes
Comment #14
iyyappan.govindComment #15
init90Thanks all for work here! I've started using the module and added some improvements and fixes: https://github.com/init90/commerce_add_to_cart_confirmation
I think it ready for the dev release and will be good if someone can help with it.
Also, I can help maintain the module.
Comment #16
bojanz CreditAttribution: bojanz at Centarro commentedSure!
@niko-
Looks like I never granted you access. Would you like to co-maintain with init90?
Comment #17
niko- CreditAttribution: niko- as a volunteer commented@bojanz Yep sure I can co-maintain
Comment #18
bojanz CreditAttribution: bojanz at Centarro commentedOkay, both init90 and niko- now have access.
Comment #19
init90Thanks @bojanz!
Comment #20
init90I've added alpha release for the module.