Closed (duplicate)
Project:
Commerce Core
Version:
7.x-1.0
Component:
Rules integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2011 at 12:17 UTC
Updated:
3 Feb 2013 at 22:24 UTC
Hi,
I'm trying to achieve a rather simple task?
I have this:
- if total order price is below $100 then add $10 to total price.
- I do not use shipment module.
- I do not use payment module.
How can I do this using Rules? Or do I have to code it by my self?
Comments
Comment #1
amfis commentedFound this: #1307108: Add a fixed Price Component which is similar.. so I guess for now I can't do this?
Or can I hook into cart display and alter the data there? I need a simple and quick solution for this.
Comment #2
rszrama commentedYou'll have to have some sort of custom line item type that you use to add the $10 fee to the order. See the write-up about ioby.org for more information:
http://www.newsignature.com/blog/2011/05/06/drupal-7-commerce-in-action-...
Comment #3
amfis commentedOkay... found solution in case anyone is also interested in this.
I've installed commerce_shipping 7x-2.x-dev module and edited commerce_shipping_example module to fit my needs:
Comment #4
amfis commentedI think it wouldn't be too difficult to implement such action into Commerce module it self.
It would look like a few rules:
- commerce cart: on cart update
- condition: if cart total is less than X
- action: add shipping component with a price of Z
Comment #5
rszrama commentedRemember, the philosophy of Drupal Commerce is to provide a framework where you can build those sorts of things yourself without trying to include every possible feature in core. That's one of the reasons Commerce Shipping didn't even make it into core for 1.x. I don't think we'll be adding any sort of Rules like that to the core, but what's great is that it's fairly trivial to configure yourself if you need it on a site.
One thing you might consider is saving these configurations in Features modules for you to reuse on future sites. You'll basically build a library of configurations that make your job easier on subsequent Drupal Commerce site builds.
Comment #6
amfis commentedThanks Ryan.
Comment #7
candelas commentedthanks a lot @amfis for putting the example.
i was very confused about the module way and rules and with your example, i was able to understand!
i had to change this line of your code
for this because i was getting an error, because the currency was not given
thanks a lot :)