Where can I find the code to modify WooCommerce Add to Cart Form?

I would like to manipulate how the WooCommerce Add to Cart Form shows up on a Layout. Where can I find that code? I found something in Pro>Cornerstone>includes>elements>definitions, but that doesn’t give me control over how the pieces of the form lay out. It references add_to_cart_form:design but I can’t find that code.

Is there any way for me to view and manipulate the Add to Cart Form? Like, which file would I copy to my child theme?

Hello @cheshiredave,

Thanks for writing to us.

Regretfully, it is not possible to override the element through the child theme. It would requires custom developement through action hooks and filter. I would suggest you contact a developer who can assist you with your concern. Please note that we don’t provide custom development support. It is out of the support scope.

Please have a look at the action and filter hook doc for reference.

Thanks for understanding

With everything you’re able to customize in Pro, and everything usually so well thought-out, it’s maddening to not have much ability to control how this form looks. It’s definitely lacking in Themeco’s usual panache. I was able to improve some parts of how the element displays the form by redefining in CSS how tables are formatted. But to get all this way with a WooCommerce design thanks to the Layout capability and then fall far short when it comes to the ordering mechanism is disappointing, to say the least.

The action and filter hook suggestion is sadly useless for me without any guide to how those actions/filters could help me customize the element. The hooks in the reference are only about where to place things. I wish you could tell me anything specific about the element I’m asking about.

1 Like

Oh, now I see the problem: the “element” is simply calling the native WooCommerce add variable item. That’s why it doesn’t look like Themeco designed it, because it didn’t. Why couldn’t you have just told me this?

OK, finally: I see that I can mess with the layout by customizing WooCommerce’s variable.php by copying it into my Pro Child theme in a directory woocommerce/single-product/add-to-cart/ and modifying it there.

1 Like

Hi @cheshiredave,

Glad that you are able to find the cause of your issue. Please let us know if you need any further help on this.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.