I don´t know php, but i have my store in OpenCart 1.2.9
I sell perfumes and i am having a problem. Each perfume comes in differents sizes, like
1.7 ounces and 3.4 ounces.
I allready created the weight class and coversion, but if i have the both perfumes in stock
what i am doing is creating the product again, for example:
1 product: 212 perfume 1.7ounces
1 product: 212 perfume 3.4ounces
The ounces i am putting it in the camp for weight. But the problem is when a client see the product in the
store don't know wich one is because it doesn´t display weight even when they clic the product
the only information that says about the product is: Price, Availability, Model, Manufacturer and Average Rating.
The big question is: HOW CAN I MAKE THE WEIGHT BE DISPLAYED INTO DE PRODUCT INFORMATION???
OR ANY SUGESTION??
Wilma
(Don't speak english)
You could put it in the grey box that displays stock, model and rating average quite easily.
In cart/catalog/controller/product/product.php
after
Code: Select all
$this->data['text_wait'] = $this->language->get('text_wait');
Code: Select all
$this->data['text_weight'] = $this->language->get('text_weight');
Code: Select all
$this->data['average'] = $average;
Code: Select all
$this->data['weight'] = $product_info['weight'];
after
Code: Select all
$_['text_search'] = 'Search';
Code: Select all
$_['text_weight'] = 'Weight';
cart/catalog/view/theme/default/template/product/product.tpl
after
Code: Select all
<tr>
<td><b><?php echo $text_availability; ?></b></td>
<td><?php echo $stock; ?></td>
</tr>
Code: Select all
<tr>
<td><b><?php echo $text_weight; ?></b></td>
<td><?php echo $weight; ?></td>
</tr>
Scott
Scott Lawrence - Creative agency - Bespoke web and graphic design
Today I'am looking your answer I was waiting the answer to be received in my mail.
And today I check here and found your HELP, thanks.
It works perfectly!!!
Now another question, that weight can be shown down the name and model
in the page that list all the manufacturer products?? I don´t know if I’m explaining
myself right, so I give an example: When you select a manufacturer the web page
shows all the products it has, but each product just presents: Name, Model and Price.
Can the weight be there two??? in perfumes this is really important because the image
is the same but the difference in price is the ounces it has.
Thank, Wilma
Wilma
(Don't speak english)
go to catalog\controller\product\manufacturer.php
and add
Code: Select all
'weight' => $result['weight'],
Code: Select all
$this->data['products'][] = array(
'name' => $result['name'],
'model' => $result['model'],
and add this
Code: Select all
<span style="color: #999; font-size: 11px;">
<?php echo $products[$j]['weight']; ?>
</span><br>
Code: Select all
<a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br />
Scott
Scott Lawrence - Creative agency - Bespoke web and graphic design
But its not shown when you clic the categories, just in manufacturers, can you add me that?
Sorry for asking so much.
Wilma
Wilma
(Don't speak english)
go to catalog\controller\product\category.php
and add
Code: Select all
'weight' => $result['weight'],
Code: Select all
$this->data['products'][] = array(
'name' => $result['name'],
'model' => $result['model'],
and add this
Code: Select all
<span style="color: #999; font-size: 11px;">
<?php echo $products[$j]['weight']; ?>
</span><br>
Code: Select all
<a href="<?php echo $products[$j]['href']; ?>"><?php echo $products[$j]['name']; ?></a><br />
Scott
Scott Lawrence - Creative agency - Bespoke web and graphic design
it's working but I guess there's something wrong. even if I've set different weight unit for each products, I always see the default weight unit for each product and not the right one. I've checked the weight class and seems to be ok..
and, another thing: how can I put and extra empty space between weight and unit?
many thanks!
Another question, wich files do I need to modify for this information appear in the Index page, in the section down the Welcome message, to the latest products??.
I already modify (with Scott insctruction):
catalog/controller/product/category.php
catalog/controller/product/manufacturer.php
catalog/controller/product/product.php
catalog/controller/product/search.php
catalog/controller/product/special.php
catalog/view/theme/default/template/product/product.tpl
catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/special.tpl
But is not workin just appear, product name, model and price.
Thanks in advance,
Wilma
Wilma
(Don't speak english)
But the other contribution about show the weight unit just after the weight is not working for me.
I have to be missing something.
Here I post my changes:
In: /catalog/controller/product/product.php
I add this:
$this->data['text_weight'] = $this->language->get('text_weight');
and this:
$this->data['weight'] = $product_info['weight'];
In /catalog/language/english/product/product.php
I add this:
$_['text_weight'] = 'Weight';
In /catalog/view/theme/default/template/product/product.tpl
I add this:
<tr>
<td><b><?php echo $text_weight; ?></b></td>
<td><?php echo $weight; ?></td>
</tr>
AND I MODIFY ALL THIS OTHER FILES:
with this on php: 'weight' => $result['weight'],
an this on tpl:
<span style="color: #999; font-size: 11px;">
<?php echo $products[$j]['weight']; ?>
</span><br>
catalog/controller/product/category.php
catalog/controller/product/manufacturer.php
catalog/controller/product/product.php
catalog/controller/product/search.php
catalog/controller/product/special.php
catalog/view/theme/default/template/product/product.tpl
catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/special.tpl
BUT TO ADD THE weight unit I JUST CHANGE IN PHP FILES:
this: 'weight' => $result['weight'],
for this: 'weight' => $this->weight->format($result['weight'], $result['weight_class_id'])
What am I missing please?? its working for you banane right? what i did wrong?
--------------------------------------
Do anybody knows something about this question?
http://forum.opencart.com/viewtopic.php?f=24&t=5665
Wilma
(Don't speak english)
FIND:
Code: Select all
$this->data['model'] = $product_info['model'];
Code: Select all
$this->data['weight'] = $product_info['weight'];
EDIT: view/theme/default/template/product/product.tpl
FIND:
Code: Select all
<tr>
<td><b><?php echo $text_model; ?></b></td>
<td><?php echo $model; ?></td>
</tr>
Code: Select all
<tr>
<td><b>Weight:</b></td>
<td><?php echo $weight; ?></td>
</tr>
Don't show anything. Is there any extra step?
Thanks in advance!!!
Wilma
Wilma
(Don't speak english)
edit catalog/controller/product/product.php
just before
Code: Select all
$this->data['model'] = $product_info['model'];
Code: Select all
$this->data['weight'] = $this->weight->format($product_info['weight'], $product_info['weight_class_id']);
add this:
Code: Select all
<tr>
<td><b><?php echo $text_weight; ?></b></td>
<td><?php echo $weight; ?></td>
</tr>
poduct.php and product.tpl, is there any other file that need to be modify, because there is no change in my web.
Anyone can see it here: http://www.waohzone.com
The weight is being shown, but still not presenting the unit (onz.).
Please if is working for you, can you explain if there are anyother steps that maybe a no newbi would now?
Wilma
(don't speak english)
Wilma
(Don't speak english)
Thanks QphoriaQphoria wrote:EDIT: catalog/controller/product/product.php
FIND:BEFORE, ADD:Code: Select all
$this->data['model'] = $product_info['model'];
Code: Select all
$this->data['weight'] = $product_info['weight'];
EDIT: view/theme/default/template/product/product.tpl
FIND:AFTER, ADD:Code: Select all
<tr> <td><b><?php echo $text_model; ?></b></td> <td><?php echo $model; ?></td> </tr>
Code: Select all
<tr> <td><b>Weight:</b></td> <td><?php echo $weight; ?></td> </tr>
Works like a charm
Users browsing this forum: Amazon [Bot] and 91 guests