Add support for Commerce Product Tax field

Created on 15 August 2020, over 4 years ago
Updated 13 April 2023, over 1 year ago

Problem/Motivation

Add support for Commerce Product Tax field: https://www.drupal.org/project/commerce_product_tax

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇵🇹Portugal introfini

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇧🇧Barbados tyrese.hamblin

    Nice patch! Very useful. My use case requires me to use a custom tax type but the data format for the tax rate is "default|0b8726d5-70dd-4891-aa07-37e30f0ff158".

    Any insight on going about achieving a similar format to "default|standard" or is the generated key necessary for a custom tax type?

  • 🇳🇱Netherlands vincent rommelaars

    Hi @introfini,

    Came across your patch that should make the Commerce tax Field type available.
    I applied the patch with succes, but when looking at the mapper for my product variation I cannot see the Tax rate field available for mapping.
    I can see an extra /src/Feeds/Target/TaxRate.php file in my commerce_feeds module.
    Am I looking at the wrong place or can you point me in the right direction?

    Thanks in advance

    I'm using:
    feeds 3.x-dev@dev
    feeds_tamper 8.x-2.0-beta4
    commerce 8.x-2.40
    commerce_feeds 8.x-1.0-alpha5

  • 🇳🇱Netherlands ecvandenberg

    @vincent rommelaars, does your product variation type hold a field_btw. If not, I'm not sure how I got it there. I can't remember. But you can add a field of tax type. I guess that does the tric.

  • 🇳🇱Netherlands vincent rommelaars

    Hi @ecvandenberg,
    I use a field 'field_btw', that's correct.
    You can create these fields yourself and I added one to the product variation.
    For now I created a small module which extends 'commerce' and 'feeds' to map this field in the feeds mapper so I can populate it.
    Maybe it will help others.

    In case your field name is different, maybe you want to alter the 'field_types' on line 17 of src/Feeds/Target/TaxRate.php to match your fields system name.

Production build 0.71.5 2024