Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Price & Tax Values #104

Open
Lex50 opened this issue Apr 9, 2019 · 4 comments
Open

Inconsistent Price & Tax Values #104

Lex50 opened this issue Apr 9, 2019 · 4 comments

Comments

@Lex50
Copy link
Contributor

Lex50 commented Apr 9, 2019

Hi,

Depending on whether Configuration > Sales > Tax > Calculation Settings > Catalog Prices is set to Including Tax or Excluding Tax, this affects the tax, and prices (Ex tax & Inc tax), calculated in base/default/template/googletagmanager/data/product.phtml

When Configuration > Sales > Tax > Price Display Settings > Display Product Prices In Catalog set to Including and Excluding Tax, and

When Configuration > Sales > Tax > Calculation Settings > Catalog Prices set to Including Tax

Then the product page displays Excl. Tax: £83.33 and Incl. Tax: £100.00, and the dataLayer is as follows:

dataLayer
[{
    "productPrice": "116.67", (Incorrect value based on £100 Incl. Tax price)
    "productPriceExcludingTax": "100.00", (Incorrect value based on £100 Incl. Tax price)
    "productTax": "16.67", (Correct value based on £100 Incl. Tax price)
    "productTaxRate": 20
},
{
    "ecommerce":     {
        "detail":       {
            "products": [{
                "price": "100.00", (Correct value based on £100 Incl. Tax price)
                "priceexcludingtax": "83.33", (Correct value based on £100 Incl. Tax price)
                "tax": "16.67", (Correct value based on £100 Incl. Tax price)
                "taxrate": 20,
            }]
        }
    }
}]

Note the "productPrice" and "price" do not match, and "productPriceExcludingTax" and "priceexcludingtax" do not match.

When Configuration > Sales > Tax > Calculation Settings > Catalog Prices set to Excluding Tax

Then the product page displays Excl. Tax: £100.00 and Incl. Tax: £120.00, and the dataLayer is as follows:

dataLayer
[{
    "productPrice": "116.67", (Incorrect value £100 Excl. Tax price)
    "productPriceExcludingTax": "100.00", (Correct value £100 Excl. Tax price)
    "productTax": "16.67", (Incorrect value £100 Excl. Tax price)
    "productTaxRate": 20,
},
{
    "ecommerce":     {
        "detail":       {
            "products": [{
                "price": "100.00", (Incorrect value £100 Excl. Tax price)
                "priceexcludingtax": "83.33", (Incorrect value £100 Excl. Tax price)
                "tax": "16.67", (Incorrect value £100 Excl. Tax price)
                "taxrate": 20,
            }]
        }
    }
}]

Tested on fresh install with sample data of Magento 1.9.4.1 and Yireo_GoogleTagManager 1.5.4

Thanks

@jissereitsma
Copy link
Collaborator

Could you check if this is still an issue with the latest release 1.6.0? https://github.com/yireo/Yireo_GoogleTagManager/releases

@Lex50
Copy link
Contributor Author

Lex50 commented May 21, 2019

Hi Jisse,

Everything looks good, except prices for child products - they are identical.

e.g.

dataLayer = [({
"customerGroupId":"1",
"customerGroupCode":"GENERAL",
"productId":"404",
"productName":"Plaid Cotton Shirt",
"productSku":"msj006c",
"productPrice":"173.20",
"productPriceExcludingTax":"160.00",
"productTax":"13.20",
"productTaxRate":8.25,
"productGender":"Male",
"productChildren":[

    {"name":"Plaid Cotton Shirt",
    "id":"237",
    "price":"160.00",
    "priceexcludingtax":"160.00",
    "sku":"msj006"},

    {"name":"Plaid Cotton Shirt",
    "id":"238",
    "price":"160.00",
    "priceexcludingtax":"160.00",
    "sku":"msj007"},

    {"name":"Plaid Cotton Shirt",
    "id":"239",
    "price":"160.00",
    "priceexcludingtax":"160.00",
    "sku":"msj008"},

    {"name":"Plaid Cotton Shirt",
    "id":"503",
    "price":"160.00",
    "priceexcludingtax":"160.00",
    "sku":"msj006xs"},

Tested on fresh install with sample data of Magento 1.9.4.1 and Yireo_GoogleTagManager 1.6.0

@jissereitsma
Copy link
Collaborator

Could you see if 1.6.1 fixes this for you?

@Lex50
Copy link
Contributor Author

Lex50 commented May 21, 2019

Yeah! 1.6.1 fixes it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants