Well the price is output in /catalog/view/theme/default/template/product/product.tpl, line 141, so you could put an if statement in here.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Guru Member
i use this code
but didn`t change anything ! ?
but didn`t change anything ! ?
Code: Select all
<?php if ($price) { ?>
<div class="price detail">
<ul class="list-unstyled">
<?php if (!$special) { ?>
<li>
<span class="price-new"> <?php echo $price; ?> </span>
</li>
<?php } else { ?>
<li> <span class="price-new"> <?php echo $special; ?> </span> <span class="price-old"><?php
if ($price==0){
echo "contact us"
}else {
echo $price;}
?></span> </li>
<?php } ?>
</ul>
</div>
<?php } ?>
I have a module which does exactly what you want to achieve:
Call for Price: https://www.opencart.com/index.php?rout ... on_id=4067
(the Call for Price text can be changed to any other text you want)
And here's another one, a little bit more advanced, which will replace the 0 price with Ask for Price text link (or any other text you want), which will open the Ask a Question form for that product:
Ask for Price: https://www.opencart.com/index.php?rout ... on_id=4139
If have any questions, or if you want to see a live demo, or if you need any help with the installation, feel free to write me a PM
Call for Price: https://www.opencart.com/index.php?rout ... on_id=4067
(the Call for Price text can be changed to any other text you want)
And here's another one, a little bit more advanced, which will replace the 0 price with Ask for Price text link (or any other text you want), which will open the Ask a Question form for that product:
Ask for Price: https://www.opencart.com/index.php?rout ... on_id=4139
If have any questions, or if you want to see a live demo, or if you need any help with the installation, feel free to write me a PM
See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart
use if statement in controller php file.
and must be compared to bare variable $result['price'], not formatted variable $price or $data['products']['price'].
and must be compared to bare variable $result['price'], not formatted variable $price or $data['products']['price'].
hi i used this but didn`t work
Code: Select all
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else{
$price = false;
}
if ($this->customer->isLogged() || !$this->config->get('config_customer_price') && $price= $this -> format ($this ->tax->calculate($result['price']==0))){
$price= $result['price']="call us";
}
Ups. I missed something.
hope this help.
file: /catalog/controller/product/product.php
hope this help.
file: /catalog/controller/product/product.php
Code: Select all
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
if ($product_info['price']) {
$data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$data['price'] = 'Call Us'
}
} else {
$data['price'] = false;
}
Hi all, I bought a plugin for this a while back so anywhere on the site with 00.00, I wanted to change to text "pick options" which it did nicely. However the problem I have is on check out anything 00.00 also changes so things like pricing for delivery, taxes come out as pick options which looks bad. Does anyone know how I can remedy this?
Hello,
Anyone found a solution for this? I tried above code but didn't work...(OC3)
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
if ($product_info['price']) {
$data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$data['price'] = 'Solicita Pret';
}
} else {
$data['price'] = false;
}
Thank you
Anyone found a solution for this? I tried above code but didn't work...(OC3)
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
if ($product_info['price']) {
$data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
} else {
$data['price'] = 'Solicita Pret';
}
} else {
$data['price'] = false;
}
Thank you
Who is online
Users browsing this forum: No registered users and 295 guests