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

I am missing the attribute data-item-has-taxes-included="true" for the buy button #20

Closed
handplant opened this issue Aug 21, 2020 · 2 comments

Comments

@handplant
Copy link

Hello, I need the following attribute data-item-has-taxes-included="true" for the Buy Button for a german shop. The attribute is described here. https://docs.snipcart.com/v2/setup/taxes

How can I implement this with the plugin?

@handplant
Copy link
Author

Okay, sorry. I got it.

    {{ entry.productDetails.getBuyNowButton({
        additionalProps: {
            'data-item-has-taxes-included': true
        }
    }) | raw }}

@mattstein
Copy link
Contributor

You beat me to it, @handplant!

You can pass an additionalProps object to getBuyNowButton() with any additional attributes you’d like to set on the element. In this case, if productDetailsFieldHandle is your Product Details field, your template could look like this:

{{ entry.productDetailsFieldHandle.getBuyNowButton({
    additionalProps: {
        'data-item-has-taxes-included': "true",
    }
}) | raw }}

Note I’m quoting "true" above, as your example would output a 1 instead.

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