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?
Magento 1.9.2.4
Best regards
Solved! Go to Solution.
Hi,
If you want to put condition on product detail page then go to below location:
\app\design\frontend\base\default\template\catalog\product\view.php
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:
\app\design\frontend\base\default\template\catalog\product\list.php
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.
Thanks,
Dibyajyoti
Hi,
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.
thanks,
Dibyajyoti
Hi,
If you want to put condition on product detail page then go to below location:
\app\design\frontend\base\default\template\catalog\product\view.php
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:
\app\design\frontend\base\default\template\catalog\product\list.php
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.
Thanks,
Dibyajyoti
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?
Best regards
Hi,
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.
thanks,
Dibyajyoti