Display Call Us By Phone Number On Opencart Product

In this tutorial will helps you display the contact us by telephone number instead product price when product price is zero on opencart product detail. We do it on the default theme of opencart, if you use another theme it may not work, please contact email garidinh006@gmail.com to support.
Here demo 


  • Please backup your data before doing this ( the sourcecode and database) 
  • Step 1: modify controller product.php 
- Open file product.php (in directory: catalog/controller/product), find code below :
$data['points'] = $product_info['points']; 
- Add below it the following code:
$data['get_price'] = $product_info['price'];
  • Step 2: modify view product.twig 
- Open file product.twig (in directory: catalog/view/theme/default/template/product), find code below:

- Replace with the following code :


- Chane 0123456789 to your phone number
  • Step 3: make css beautiful 
- Copy file banner call-us-now.png ( or your design) to directory catalog/view/theme/default/image
- Open file stylesheet.css (in directory: catalog/view/theme/default/stylesheet), paste end file the following code, you can modify it:
.call-us{ 
 padding: 25px 20px 30px 80px; color: #fff; 
 background-image: url("../image/call-us-now.png"); 
 background-repeat: no-repeat; 
.call-us span{ 
 font-size: 16px; font-weight: 600; 
}
  • Remember to save the file after modify.
Besides, you can use the module call-us.ocmod for quick installation



If you like my share, you can invite me for a cup of coffee, thanks very much !
Previous Post Next Post