philman
philman

Reputation: 159

Woocommerce - override single add-to-cart

I am trying to override the single add to cart template from Woocommerce, which is located under /woocommerce/templates/single-product/add-to-cart/simple.php.

I have already tried copying it into /CHILD-THEME/templates/woocommerce/single-product/add-to-cart/simple.php without success.

When editing the file directly in the woocommerce template I can see the changes locally, but not from the child theme.

Also add_theme_support( 'woocommerce') is added to my functions.php

I am using elementor and jet-woo-builder, but I could yet not figure out if those are creating problems.

The reason why I want to edit the file is because I'd like to give the 'add-to-cart'-button some data-attributes from the product (e.g price), which I want to access later on in the ajax add-to-cart event.

Any ideas? Thanks in advance.

Upvotes: 0

Views: 1434

Answers (2)

Jxk427 Egamberdiyev
Jxk427 Egamberdiyev

Reputation: 3

Woocommerce files should be in woocommerce folder in your theme folder

yourtheme/woocommerce/single-product/add-to-cart/simple.php

Upvotes: 0

philman
philman

Reputation: 159

/CHILD-THEME/woocommerce/single-product/add-to-cart/simple.php was the right path.

Upvotes: 0

Related Questions