Hi,
I am running a site on Opencart Version 2.3.0.2 and what i would like to do is display the measurements and weight of each product on the product page.
Is ths possible?
cheers
I am running a site on Opencart Version 2.3.0.2 and what i would like to do is display the measurements and weight of each product on the product page.
Is ths possible?
cheers
HIi
Go to admin panel catalog->product
Add New Product or edit the exiting one
Go To data Tab and check the bottom of that tab
You can add the size and weight of that product
Thanks
Sachin
Go to admin panel catalog->product
Add New Product or edit the exiting one
Go To data Tab and check the bottom of that tab
You can add the size and weight of that product
Thanks
Sachin
Not sure you understand what i mean, i have already added the weights and sizes on the product page in my admin area but i would like these weights and measurements to also show on the product page and my web site so customers can view them before they buy
Hii
Ok i got it
I will tell you the changes with file location and code 2marrow
Currently i just leave my laptop so i will sure tell you the solution dont warry . i know how to do this i have already done it in my localhost opencart
Thanks
Sachin
Ok i got it
I will tell you the changes with file location and code 2marrow
Currently i just leave my laptop so i will sure tell you the solution dont warry . i know how to do this i have already done it in my localhost opencart
Thanks
Sachin
Weight and size are only displayed in one place for visitors.
Product comparison page and the weight may even be in the delivery way.
Or you can show it individually with development
Product comparison page and the weight may even be in the delivery way.
Or you can show it individually with development
Webáruház készítés | GrenT Média.hu
Hii
it will be display on the product page just below the model,stock section
Thanks
Sachin
it will be display on the product page just below the model,stock section
Thanks
Sachin
Attachments
weight on the product page.png (206.89 KiB) Viewed 19425 times
Hi,sachin6609 wrote: ↑Tue May 16, 2017 1:53 pmHii
it will be display on the product page just below the model,stock section
Thanks
Sachin
How do i do this as i see a screenshot but no instructions?
cheers
Hii
Open the product controller file and search the below line
file location -> catalog / controller / product then open the product.php file
$data['points'] = $product_info['points'];
Then after this line add the below line
$data['weight'] = $product_info['weight'];
$data['length'] = $product_info['length'];
$data['width'] = $product_info['width'];
$data['height'] = $product_info['height'];
Then open the product.tpl file and serach for the below line
File Location-> catalog / view / theme / default or (Your_Theme_Folder_If_You_Use_any_theme) / template / product then product.tpl file
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
just after that line add the below code
<?php if($weight) { ?>
Weight : <?php echo number_format($weight,2); ?>
<?php } ?>
<br/>
<?php if($length || $width || $height) { ?>
L x W x H : <?php echo number_format($length,2)," x ", number_format($width,2) , " x " , number_format($height,2); ?>
<?php } ?>
All The Best
Thanks
Sachin
Open the product controller file and search the below line
file location -> catalog / controller / product then open the product.php file
$data['points'] = $product_info['points'];
Then after this line add the below line
$data['weight'] = $product_info['weight'];
$data['length'] = $product_info['length'];
$data['width'] = $product_info['width'];
$data['height'] = $product_info['height'];
Then open the product.tpl file and serach for the below line
File Location-> catalog / view / theme / default or (Your_Theme_Folder_If_You_Use_any_theme) / template / product then product.tpl file
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
just after that line add the below code
<?php if($weight) { ?>
Weight : <?php echo number_format($weight,2); ?>
<?php } ?>
<br/>
<?php if($length || $width || $height) { ?>
L x W x H : <?php echo number_format($length,2)," x ", number_format($width,2) , " x " , number_format($height,2); ?>
<?php } ?>
All The Best
Thanks
Sachin
I have done what you have put below but doesnt seem to work for me the details are not showing on the products pages?
sachin6609 wrote: ↑Tue May 16, 2017 4:28 pmHii
Open the product controller file and search the below line
file location -> catalog / controller / product then open the product.php file
$data['points'] = $product_info['points'];
Then after this line add the below line
$data['weight'] = $product_info['weight'];
$data['length'] = $product_info['length'];
$data['width'] = $product_info['width'];
$data['height'] = $product_info['height'];
Then open the product.tpl file and serach for the below line
File Location-> catalog / view / theme / default or (Your_Theme_Folder_If_You_Use_any_theme) / template / product then product.tpl file
<li><?php echo $text_stock; ?> <?php echo $stock; ?></li>
just after that line add the below code
<?php if($weight) { ?>
Weight : <?php echo number_format($weight,2); ?>
<?php } ?>
<br/>
<?php if($length || $width || $height) { ?>
L x W x H : <?php echo number_format($length,2)," x ", number_format($width,2) , " x " , number_format($height,2); ?>
<?php } ?>
All The Best
Thanks
Sachin
Thanks works now!, you can tell i am new to this!
yet another newbie
Can someone PLEASE help to achieve the same in OC3.0.2.0, I tried solution provided by sachin but just can't get it to show without decimal and weight class (ie gm). PLEASE PLEASE help
Solved... 24Mar
(1) file location -> catalog / controller / product then open the product.php file
search/find line
$data['points'] = $product_info['points'];
Then after this line add the below line
$data['weight'] = $this->weight->format(($product_info['weight'] ) , $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))
(2) File Location-> catalog / view / theme / default or (Your_Theme_Folder_If_You_Use_any_theme) / template / product then product.twig file
search/find line <li>{{ text_stock }} {{ stock }}</li>
Then after this line add the below line
<li>{{'Weight:'}} {{weight}}</li>
Now I need find way to show weight on search result page. any guidance ?
Can someone PLEASE help to achieve the same in OC3.0.2.0, I tried solution provided by sachin but just can't get it to show without decimal and weight class (ie gm). PLEASE PLEASE help
Solved... 24Mar
(1) file location -> catalog / controller / product then open the product.php file
search/find line
$data['points'] = $product_info['points'];
Then after this line add the below line
$data['weight'] = $this->weight->format(($product_info['weight'] ) , $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))
(2) File Location-> catalog / view / theme / default or (Your_Theme_Folder_If_You_Use_any_theme) / template / product then product.twig file
search/find line <li>{{ text_stock }} {{ stock }}</li>
Then after this line add the below line
<li>{{'Weight:'}} {{weight}}</li>
Now I need find way to show weight on search result page. any guidance ?
hi ive got this working but does not display grams this is what it show weight 299 there no g on the end please advise code change so looks like this weight 299g
open cart 2.3.0.2 & 3.0.2.0
OpenCart 3
Add in file: controller/catalog/product/product.php
after
this:
Next, in theme file catalog/view/theme/YOURTHEMENAME/template/product/product.twig
after:
Have a nice day!
Add in file: controller/catalog/product/product.php
after
Code: Select all
$data['points'] = $product_info['points'];
Code: Select all
if ($product_info['weight']>0) {
$data['weight'] = str_replace('.00','',$this->weight->format($product_info['weight'], $product_info['weight_class_id']));
} else {
$data['weight'] = '';
}
if ($product_info['length']>0) {
$data['length'] = str_replace('.00','',$this->length->format($product_info['length'], $product_info['length_class_id']));
} else {
$data['length'] = '';
}
if ($product_info['width']>0) {
$data['width'] = str_replace('.00','',$this->length->format($product_info['width'], $product_info['length_class_id']));
} else {
$data['width'] = '';
}
if ($product_info['height']>0) {
$data['height'] = str_replace('.00','',$this->length->format($product_info['height'], $product_info['length_class_id']));
} else {
$data['height'] = '';
}
after
Code: Select all
<li>{{ text_stock }} {{ stock }}</li>
Code: Select all
{% if length %}
<li>{{'Размеры (ДхШхВ):'}} {{length}} x {{width}} x {{height}}</li>
{% endif %}
Who is online
Users browsing this forum: No registered users and 97 guests