Closed (fixed)
Project:
Ubercart
Version:
8.x-4.x-dev
Component:
Orders
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2013 at 11:17 UTC
Updated:
21 Dec 2015 at 09:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
longwaveThe order grand total should technically include any discount, so what you need here is the subtotal of all products instead, which would ignore any discount (or indeed, any currently applied shipping quote). This is available as a token, but not as a an order property in Rules, so this is a feature request.
Comment #2
tinker commentedAttached patch provides rules conditions to compare order total and subtotal to a specified value.
Comment #3
tinker commentedUpdated patch - accidentally overwrote $value in foreach().
Comment #4
hanoiiIt's strange. I have used this patch before, but for some reason I was having the following error on a site:
Notice: Undefined property: stdClass::$total in uc_order_condition_total() (line 943 of /home/nubie/public_html/dev7/sites/all/modules/ubercart/uc_order/uc_order.rules.inc).
Only to find out that ->total is not actually a valid properly but rather order_total is.
Attached is a patch correcting this.
Comment #5
hanoiiUploading the interdiff with txt extension
Comment #6
hanoiiComment #8
hanoiiComment #10
tr commentedLooks good to me, but "comparision" should be "comparison"
Since the patch adds a new function uc_order_condition_value_operator_comparision(), I think that function should also be used to replace the switch statements in uc_order_condition_products_weight() and uc_order_condition_count_products().
Comment #11
tr commentedCan someone test this? It's the same as #4 but with my comments from #10 included.
Comment #12
tr commentedAnd one more, this time with the rule labels changed slightly for consistency with our other rules.
Comment #13
hanoiiJust providing an interdiff between 12 and 4.
Patch looks good!
Comment #14
tr commentedCommitted! Thanks all...
Comment #16
tr commentedMoving to 8.x-4.x so we remember to forward port this ...
Comment #17
longwaveCherry-picked it straight into the 8.x-4.x codebase, even if all the Rules conditions still need conversion at least it's in there.