Conditionally Show Add-To-Cart

I have a client that wants to set a “hold” on a product. I have successfully added “ON HOLD” to the product feature list. I can display (or not) the value. Now they want it to REPLACE the Add to Cart button if a product is on hold. I cannot pass the value when it gets to rendering in the Product detail page.



how can I revise the ‘templates/buttons/add_to_cart.tpl’ to accept this value and allow me to override the display? I don’t want to turn on the PHP-option if it’s a security risk when passing a persistent value.



Thank you!

Please check the following article to learn how to override specific templates:



TPL Hooks — CS-Cart 4.2.x documentation



To find the required parameter in the $product array, please add the following code to the template:


{$product|fn_print_r}

Thank you! I'll check this out.