Hi,
I want to put the price a particular product in the template header file (ie. /catalog/view/theme/default/template/common/header.tpl) so that this price is displayed on all pages. Does anyone know how I could do this?
In addition I would also like this price displayed on a separate html page is there some way this could be done?
Thank you
the price of a single chosen product on all pages, or on each product page, the price of that specific product to be displayed in header?
Hi,
I want to display the price of a chosen (one) product on the header of all pages.
For example beside the logo it would say "Home of the $x phone).
So now I want this $x to change when I change the price of the product on the control panel.
I want to display the price of a chosen (one) product on the header of all pages.
For example beside the logo it would say "Home of the $x phone).
So now I want this $x to change when I change the price of the product on the control panel.
In header.tpl, before the line:
add the code:
from the following line in the code above:
The in stylesheet.css arange the div #header-price as you wish
Code: Select all
<div id="welcome">
Code: Select all
<div id="header-price">
<?php
$this->load->model('catalog/product');
$product_header = $this->model_catalog_product->getProduct(x);
$header_price = $this->currency->format($this->tax->calculate($product_header['price'], $product_header['tax_class_id'], $this->config->get('config_tax')));
echo $header_price;
?>
</div>
replace the highlighted x with the id of the product you want to display the price for.$product_header = $this->model_catalog_product->getProduct(X);
The in stylesheet.css arange the div #header-price as you wish
Thank you so much florinsith it worked perfectly!
Any idea how I could include this information in a stand alone html file.
I was thinking if I could make a php file that would just display the price. I could use: <!--#include file="price.php" --> in any html file I wanted the price to be displayed in.
My question would be what do I put in the price.php file to get it to display the price?
Thank you
Any idea how I could include this information in a stand alone html file.
I was thinking if I could make a php file that would just display the price. I could use: <!--#include file="price.php" --> in any html file I wanted the price to be displayed in.
My question would be what do I put in the price.php file to get it to display the price?
Thank you
Who is online
Users browsing this forum: No registered users and 330 guests