19

I'm really losing the will to live and hope somebody can help me.

I want to trigger a 'free shipping' rule based on a product field value, but for the life of me can not expose the free shipping field to rules.

I have read about bringing items into scope and have created a component which has access to the field. But when I attempt to add the component as a condition of my rule I am prompted to enter data selector - none of which seem to lead anywhere. I think it was wanting a product ID, which does not make any sense to me.

What am I doing wrong?


MORE BACKGROUND

I have tried two scenarios, one of which is to create a shipping rule,based on the conditions below. The other is to create a component, as described above

Condition1 - Entity has field > Parameter: Entity: [commerce-order], Field: field_free_shipping

Condition2 - Date value is empty (also tried data comparison) > However this does not lead me to the field stated in Condition1

6
  • 1
    Does it work if you add the conditions directly into a rule, and don't use a component? That's the experience I've had in the past
    – Clive
    Jul 25, 2013 at 14:06
  • If you are trying to access the field value in any checkout rule, you have to set "Entity has value" first & check the same field before going for data comparison.. Don't know the exact situation, so that not putting this in answer..
    – RajeevK
    Jul 25, 2013 at 14:10
  • Please see More Background - above Jul 30, 2013 at 11:50
  • Can you tell me the Event which you are using for adding shipping ?
    – RajeevK
    Jul 31, 2013 at 4:56
  • You will have to give more details for help, like - Have you installed shipping Event which you are using, what kind of field value you are trying to access etc.. I have shipping configuration working for price comparison(total value less than something), payment method used(on COD), product type purchased. So can you tell me the scenario where you want to use & I will try that..
    – RajeevK
    Jul 31, 2013 at 5:02

2 Answers 2

2

I eventually managed to get this working by dropping the idea of having custom fields and replacing them with taxonomy terms. For whatever reason (probably inexperience) I could not expose my custom fields to the rules module in order to trigger the shipping rules that I wanted.

By leveraging the Commerce Rules Extra module I was able first to trigger my shipping rules based on taxonomy terms instead of custom fields and secondly to define additional conditions for firing these rules with the help of the modules maintainer @MarcElbichon as discussed here https://drupal.org/node/2087815

1

I did this -

I used flat rate shipping module and created a flat rate called free shipping price 0. Then I edited the component to only apply to the circumstances required and it works really well.

See attached.

FWIW I used flat rate for free shipping and commerce weight tariff for the rest which works ace for me.

flat rate component

1
  • Thank you for your suggestion. I had considered this approach but my client is insistent about having only one product type. Having learned more about his business I can understand his reasons for this. Nov 6, 2013 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.