Flow Chart of Drupal Commerce Needed
I'm setting up the taxing system for a client and some products are taxable while others are not. I've created a field for this to each product. However, I'm unsure as to how I would add taxes within the commerce checkout system. I know how to do it otherwise, but commerce entities have me all confused.
Where I'm running into the issue is that some items in the same cart will need to have tax applied while others will not.
Is there a flow chart that can help me to understand how commerce line items(commerce-line-item) and orders are set up in relation to products? Thanks in advance!
Asked by: therealjjj77
on January 15, 2014
Clarification: Sometimes the billing client is a b2b sale of an item for resale and in such a case, they can't charge sales tax on that item. So I'm trying to set the tax component to calculate this. Here's my approach:
Action: Add a variable: Type: Integer, Name: variable_added
Loop: Parameter: List[commerce-line-item:order:commerce line items], List item: (list_item)
If: Entity has field, Parameter: list_item, Field: field_taxable
If: data comparison, parameter:list_item:field_taxable equals 1(yes)
Action: Calculate a value, list_item:total:amount * .06875 = item_tax
Action: Calculate a value, variable_added + item_tax:amount = total_tax
Action: Set data value: Set variable_added to equal total_tax
Apply a tax rate to a line item: Parameter:commerce-line-item, Tax rate: Sales Tax Minnesota, Provided variables: applied_tax
Set a data value: Set applied_tax:amount to variable_added
The Issue: When I try to make the second if statement, I can't find the field that I just called in. Any help would be appreciated. Thank you.