Kindly follow the following steps:
Check this code now:
Go the following location in server or Cpanel
public function getProducts($data = array())
Add the following lines above the lines:
public function getWeightClass($weight_class_id)
{
$sql="SELECT * FROM " . DB_PREFIX . "weight_class_description WHERE weight_class_id='".$weight_class_id."'";
$query = $this->db->query($sql);
if ($query->num_rows)
{
return $query->row['unit'];
}
}
Goto the catalog/controller/product/product.php
Check the following lines in
$this->load->model('tool/image');
Add the following lines above the lines($this->load->model('tool/image');):
if ($product_info['weight']) {
$data['weight'] = $product_info['weight'];
}
if ($product_info['weight_class_id']) {
$data['weight_class'] = $this->model_catalog_product->getWeightClass($product_info['weight_class_id']);
}
Goto the catalog/view/theme/default/template/product/product.twig
Check the following lines in
<li>{{ text_stock }} {{ stock }}</li>
Add the following lines above the lines($this->load->model('tool/image');):
<li>{{ text_weight }} {{ weight }} {{ weight_class }}</li>
Check this code now:
Go the following location in server or Cpanel
Language File Change
catalog/language/en-gb/product/product.php
Check this $_['text_year'] = 'year';.
Add the following lines to above lines
$_['text_weight'] = 'Weight';
In model Change :
Goto the catalog/model/catalog/product.php
Check the following lines inpublic function getProducts($data = array())
Add the following lines above the lines:
public function getWeightClass($weight_class_id)
{
$sql="SELECT * FROM " . DB_PREFIX . "weight_class_description WHERE weight_class_id='".$weight_class_id."'";
$query = $this->db->query($sql);
if ($query->num_rows)
{
return $query->row['unit'];
}
}
Goto the catalog/controller/product/product.php
Check the following lines in
$this->load->model('tool/image');
Add the following lines above the lines($this->load->model('tool/image');):
if ($product_info['weight']) {
$data['weight'] = $product_info['weight'];
}
if ($product_info['weight_class_id']) {
$data['weight_class'] = $this->model_catalog_product->getWeightClass($product_info['weight_class_id']);
}
Goto the catalog/view/theme/default/template/product/product.twig
Check the following lines in
<li>{{ text_stock }} {{ stock }}</li>
Add the following lines above the lines($this->load->model('tool/image');):
<li>{{ text_weight }} {{ weight }} {{ weight_class }}</li>
Comments
Post a Comment