Closed (won't fix)
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Rules integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
12 Sep 2012 at 17:05 UTC
Updated:
21 May 2018 at 14:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
aaronbaumanThis patch adds the following events, which are hopefully self-explanatory:
Comment #2
strae commentedSubscribe, those events are very useful to implement a custom-rule based shipping costs, for example.
I applied the patch to commerce_kickstart profile, all seem ok for now.
Comment #3
strae commentedI tryed the "When viewing checkout page "Review"", it works;
But with "When viewing Shopping Cart" the event is triggerd after the main content is rendered, so if for example I add/remove line items in this step, the "your cart" block get updated with the edits, but not the "shopping cart contents" block (that is the main content).
So i added "Before viewing Shopping Cart" event that get invoked in line 37 of commerce_cart.pages.inc and it works
(sorry if i dont provide a patch, i dont know how to make it)
Comment #4
pun_pun commentedThank you!!! Now I can sleep calm ))
I've made a total order weight calculation, based on your events. So if you are interested - you are welcome. :)
Comment #5
rszrama commentedWhile I understand the reason behind the patch, I'm not sure I can support such a patch going into core - I'm not even sure using Rules for this sort of task (or the related "Content is being viewed" event) is a good idea.
The problem in our case is that it isn't dependable. For example, someone may be embedding the checkout form somewhere else or just using Views to create the shopping cart display (there's a recipe for that here in the queue). I do appreciate the time you've put into making this sharable, though!
For now my recommendation is to maintain a patched version of Commerce using the patch above or consider making it a separate module (or part of another module if a related one exists).
Comment #6
aaronbaumanMakes sense.
Thanks for the explanation, Ryan.
Comment #7
aaronbaumannecro-post, since i came across the need for this again.
all of this is super easy to put into a module, except for "viewing cart":
Comment #8
Andrew211 commentedCart page is easy too, here's da code if anyone want's it.
Let's call the module "checkout_events"
checkout_events.rules.inc
And in checkout_events.module
Comment #9
sorabh.v6Hi Guys,
I was facing the same issue as well but for the newer version this patch wasn't working, so I rerolled the patch. Attaching the latest patch and interdiff file.
Thanks guys
Comment #10
sorabh.v6Sorry, correct patch in the comment.
Thanks