1

I have generated a feature which exports my tax rate rule component for Drupal Commerce. However, it is not importing the Conditions of the rule for the component of the tax rate. It creates the tax rate rule component, and it also creates the action to be taken, but just not the conditions. I have cleared the cache.

Could the problem be that it is trying to import a component configuration?

Field taxable if a field that I have created whose data I am checking to determine taxability.

function bh_taxable_tax_rate_default_rules_configuration() {
  $items = array();
  $items['commerce_tax_rate_taxrate_taxable'] = entity_import('rules_config', '{ "commerce_tax_rate_taxrate_taxable" : {
  "LABEL" : "Calculate Taxable",
  "PLUGIN" : "rule",
  "OWNER" : "rules",
  "TAGS" : [ "Commerce Tax", "sales_tax" ],
  "REQUIRES" : [ "rules", "commerce_tax" ],
  "USES VARIABLES" : { "commerce_line_item" : { "label" : "Line item", "type" : "commerce_line_item" } },
  "IF" : [
    { "entity_has_field" : { "entity" : [ "commerce-line-item" ], "field" : "commerce_product" } },
    { "entity_has_field" : {
        "entity" : [ "commerce-line-item:commerce-product" ],
        "field" : "field_taxable"
      }
    },
    { "data_is" : {
        "data" : [ "commerce-line-item:commerce-product:field-taxable" ],
        "value" : "1"
      }
    }
  ],
  "DO" : [
    { "commerce_tax_rate_apply" : {
        "USING" : {
          "commerce_line_item" : [ "commerce-line-item" ],
          "tax_rate_name" : "taxrate_taxable"
        },
        "PROVIDE" : { "applied_tax" : { "applied_tax" : "Applied tax" } }
      }
    }
  ]
}
  }');
  return $items;
 }
2
  • Are you getting any error messages or log entries when you do the import? Is this a rule that was provided by another module and you modified it or is it a rule you created?
    – rooby
    Aug 19, 2015 at 9:34
  • There are no log errors. This is not a rule that I modified
    – angms.bh
    Aug 19, 2015 at 14:53

0

Your Answer

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

Browse other questions tagged or ask your own question.