con
(@conschneider)
Engineer
Hi there,
Maybe it is just a question of the correct filter giving you access. Here is a simple function to change the product loop add to cart button text
https://gist.github.com/claudiosanches/3d493aefd37beb5748de
Thanks for your reply Con.
However in your example where would I include the IF part of the query?
For reference in the /single-product/add-to-cart/simple.php I simply changed the code to:
<button type="submit" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" class="single_add_to_cart_button button alt">
<?php
if(get_field('ad_activate_deposit') == "yes")
{
echo 'PLACE £99 DEPOSIT';
} else {
echo 'ADD TO CART';
}
?>
</button>
con
(@conschneider)
Engineer
Hi again,
Snippets like these usually go into your functions.php file: https://conschneider.de/how-to-use-wordpress-custom-code-snippets/
I see you used a template overwrite instead. For the shop loop it should be /woocommerce/templates/archive-product.php
Hi @garywright
I hope that our reply helped guide you in the right direction.
I’m marking this thread as Resolved since we haven’t heard from you in a while, but if you have further questions, feel free to reach out to us here in the forums. We’re happy to help!