I am new to Magento and now trying to find a way to show a message on a product page (preferably instead of the "Add to Cart" button), if the total price (based on several custom options) for a product goes over a certain limit, but I can't figure out a way to do so. I have tried searching for the variable responsible for the total price, to create a php "if" expression, but so far I have no luck. Is there a way to make this message appear? Or maybe someone could give me a hint where to look for the total price variable?
Solved! Go to Solution.
If you want to put condition on product detail page then go to below location:
open view.php file and go to line number 66 or search "echo $this->getChildHtml('addtocart')" text. In that place you can put your condition.
If you want to put condition on product list page then go to below location:
Open list.php file and go to line number 61 or search "Add to Cart" text and put condition accordingly.
If this post is fulfill your condition then please mark as accept.
Thank you for your reply and information given. Maybe you could also give me an advice on how can I address a variable which holds the total price so I could use it in the "if" condition?
If you want to get price on view.php file through variable find below code:
$_product = $this->getProduct();
$price = $_product->getFinalPrice();
If this post fulfill your solution then mark as accept.