Page 1 of 1
[How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 12:51 am
by TigerMatze
Hi,
i wrote an instruction to include the weight and dimension settings on the product side.
You can see it in action on
http://waermeakkus.de
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 2:48 am
by i2Paq
Nice.
I fixt the title for you

Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 7:06 pm
by tirol3
Hi. i am using 1.4.0.0 i want to display only weight how can i do it? can you help me ? thanks
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 7:25 pm
by TigerMatze
tirol3 wrote:Hi. i am using 1.4.0.0 i want to display only weight how can i do it? can you help me ? thanks
You can change it in two different ways.
1. Edit catalog/view/theme/default/template/product/product.tpl and delete this code
Code: Select all
<!--Measurement -->
<?php if ($measurement) { ?>
<tr>
<td><b><?php echo $text_measurement; ?></b></td>
<td><?php echo $measurement; ?></a></td>
</tr>
<?php } ?>
2. Edit catalog/controller/product/product.php and change the code as follow
Code: Select all
//weight and measurement begin
$this->data['weight'] = "-";
$weight = substr($product_info['weight'], 0, strpos($product_info['weight'], "."));
$weight_text = $this->model_catalog_product->getWeightText($product_info['weight_class_id']);
if ($weight) {
$this->data['weight'] = $weight." ".$weight_text['unit'];
}
$this->data['measurement'] = "";
/*$length = substr($product_info['length'], 0, strpos($product_info['length'], "."));
$width = substr($product_info['width'], 0, strpos($product_info['width'], "."));
$height = substr($product_info['height'], 0, strpos($product_info['height'], "."));
$measurement_text = $this->model_catalog_product->getMeasurementText($product_info['measurement_class_id']);
if ($length && $width ){
$this->data['measurement'] = $length." X ".$width;
if ($height) {
$this->data['measurement'] .= " X ".$height;
}
$this->data['measurement'] .= " ".$measurement_text['unit'];
}*/
//weight and measurement end
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 7:44 pm
by tirol3
i downloaded Weight_and_Measurement_inProducts_InstallationInstruction.rar and i read in it. But it doesn't work 1.4.0.0
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 7:48 pm
by TigerMatze
tirol3 wrote:i downloaded Weight_and_Measurement_inProducts_InstallationInstruction.rar and i read in it. But it doesn't work 1.4.0.0
I developed it for 1.3.4 but i will test it for 1.4.0 in the next days. I think that i can provide a version for 1.4.0 during the next week.
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 8:01 pm
by tirol3
thanks i am waiting.
Re: [How to] Weight and Dimensions on product side
Posted: Thu Jan 14, 2010 10:13 pm
by allenshea
I also like to get one. Thanks!
Re: [How to] Weight and Dimensions on product side
Posted: Fri Jan 15, 2010 3:00 am
by TigerMatze
Here is the version for opencart 1.4.0
Edit: I added all original files from opencart 1.4.0 with only this changes.
Re: [How to] Weight and Dimensions on product side
Posted: Fri Jan 15, 2010 3:20 am
by tirol3
thanks alot. i am very very sorry but i didn't do it. can you share us modified documents. i know i want alot but i am sory.
for 1.4.0.0
Re: [How to] Weight and Dimensions on product side
Posted: Sat Jan 16, 2010 8:20 pm
by tirol3
thanks alot all
Re: [How to] Weight and Dimensions on product side
Posted: Tue Jan 19, 2010 6:21 pm
by afendio
i use opencart v1.3.4 and i follow exactly your instruction in version 1.3.4 but error occured as follow:
Parse error: parse error in D:\xampp\htdocs\opencart\catalog\model\catalog\product.php on line 358
anybody can help what is the problem?
thanks
Re: [How to] Weight and Dimensions on product side
Posted: Tue Jan 19, 2010 6:58 pm
by TigerMatze
It sounds like a problem with the explicit type converting.
You can remove the "(int)" in the database query. Therefore change the line into
Code: Select all
$measurement_class_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "measurement_class WHERE measurement_class_id = '" . $measurement_id . "' AND language_id = '" . $this->language->getId() ."'");
If it doesn't help insert
Code: Select all
print_r( $measurement_class_query );
after the line and post the output, please.
Re: [How to] Weight and Dimensions on product side
Posted: Tue Jan 26, 2010 5:21 pm
by afendio
sorry, its doesn't works..i also try modify code for v1.4 and doesn't woks as well..same error..