Post by TigerMatze » Thu Jan 14, 2010 12:51 am

Hi,

i wrote an instruction to include the weight and dimension settings on the product side.

Image Image

You can see it in action on
http://waermeakkus.de

Attachments


User avatar
Newbie

Posts

Joined
Sun Jun 28, 2009 5:37 pm
Location - Flensburg

Post by i2Paq » Thu Jan 14, 2010 2:48 am

Nice.

I fixt the title for you :)

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by tirol3 » Thu Jan 14, 2010 7:06 pm

Hi. i am using 1.4.0.0 i want to display only weight how can i do it? can you help me ? thanks

Newbie

Posts

Joined
Thu Jan 14, 2010 7:00 pm

Post by TigerMatze » Thu Jan 14, 2010 7:25 pm

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

User avatar
Newbie

Posts

Joined
Sun Jun 28, 2009 5:37 pm
Location - Flensburg

Post by tirol3 » Thu Jan 14, 2010 7:44 pm

i downloaded Weight_and_Measurement_inProducts_InstallationInstruction.rar and i read in it. But it doesn't work 1.4.0.0

Newbie

Posts

Joined
Thu Jan 14, 2010 7:00 pm

Post by TigerMatze » Thu Jan 14, 2010 7:48 pm

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.

User avatar
Newbie

Posts

Joined
Sun Jun 28, 2009 5:37 pm
Location - Flensburg

Post by tirol3 » Thu Jan 14, 2010 8:01 pm

thanks i am waiting.

Newbie

Posts

Joined
Thu Jan 14, 2010 7:00 pm

Post by allenshea » Thu Jan 14, 2010 10:13 pm

I also like to get one. Thanks!

I know nothing about PHP and SQL, but I still try my best to understand it.


Active Member

Posts

Joined
Mon Dec 14, 2009 10:01 pm

Post by TigerMatze » Fri Jan 15, 2010 3:00 am

Here is the version for opencart 1.4.0

Edit: I added all original files from opencart 1.4.0 with only this changes.

Attachments

Last edited by TigerMatze on Fri Jan 15, 2010 4:20 am, edited 2 times in total.

User avatar
Newbie

Posts

Joined
Sun Jun 28, 2009 5:37 pm
Location - Flensburg

Post by tirol3 » Fri Jan 15, 2010 3:20 am

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

Newbie

Posts

Joined
Thu Jan 14, 2010 7:00 pm

Post by tirol3 » Sat Jan 16, 2010 8:20 pm

thanks alot all

Newbie

Posts

Joined
Thu Jan 14, 2010 7:00 pm

Post by afendio » Tue Jan 19, 2010 6:21 pm

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

New member

Posts

Joined
Wed Jan 13, 2010 3:43 pm
Location - Malaysia

Post by TigerMatze » Tue Jan 19, 2010 6:58 pm

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.

User avatar
Newbie

Posts

Joined
Sun Jun 28, 2009 5:37 pm
Location - Flensburg

Post by afendio » Tue Jan 26, 2010 5:21 pm

sorry, its doesn't works..i also try modify code for v1.4 and doesn't woks as well..same error..

New member

Posts

Joined
Wed Jan 13, 2010 3:43 pm
Location - Malaysia
Who is online

Users browsing this forum: No registered users and 4 guests