The current "add to cart" confirmation message is cool and we surely could move it into a custom module that can be contributed on drupal.org.

It will allow user to easily modify the style and content of that message !

Basically move those elements to a custom module :

  • The Rule
  • The view and the view mode configuration
  • The CSS style

Comments

bojanz’s picture

Sounds like a plan. We can name it commerce_add_to_cart_confirmation (or something similar).

bojanz’s picture

Issue tags: +RC blocker
haza’s picture

First pass to make this works as separate module.

When trying to use it in a vanilla commerce install, the "views_embed_view" in the reaction rules fails. Need to investigate why.

https://code.drupalcommerce.org/#/c/277/

guguss’s picture

Assigned: cookiz » haza
Status: Active » Needs work

That's a good start though ! Let's try to have it on the next release and commit it as a contributed module on d.org...

haza’s picture

I've create a sandbox about that : http://drupal.org/sandbox/haza/1728058

Still have an issue with it :
On a vanilla commerce install,
- If you create a product display with 2 or more products, it works.
- if there is only 1 product in the reference field, it fails. (somewhere in the "preview" function of views)

vasike’s picture

some research

1. on Kickstart profile
it does work no matter of number of products referenced

2. on a clean Drupal Commerce system
i can confirm this issue: if there is only 1 product in the reference field, it fails.

on this case i found in the Rules Logs that the Rule "Add to Cart message" it's not fired.
0.642 ms Not evaluating reaction rule Add to Cart message to prevent recursion.
it seems there is loop for After adding a product to the cart event on this case.

but why?
...

rei’s picture

hi,
why not to use this kind of message for overall site message so all message have consistent look. (especially replacing ugly drupal default message). I mean, if the confirmation message is cool, but other message is ugly, then it will reduce overall user interface.

vasike’s picture

it seems that "Add to cart" formatter in "Confirm message product display" view leads to a loop

new issue and patch to "Commerce add to cart confirmation" sandbox : #1783556: "Add to cart" formatter in "Confirm message product display" view leads to a loop
this uses other patch for Drupal Commerce : #1783462-1: "Rendered product" new formatter for Product reference

vasike’s picture

"Commerce add to cart confirmation" patch commited so i think it' s time to #1786420: Promote the project to a full project.

jsacksick’s picture

Tagging

bojanz’s picture

Automatically closed -- issue fixed for 2 weeks with no activity.