Post by jc-piazza » Tue Nov 24, 2009 12:30 am

I'm in a bind looking to display the product attributes right up there with the SKU and price. Example: if you are buying a can of tomatoes, it is important to know it is 8 oz. or 16 oz. That information is stored in the Data tab, but not displayed. Why not?

for my store, people won't buy anything unless they know what the size or weight is. Other carts have attributes that you can define for the product or site-wide, or category. Example - if I sell wine, I need to display the vintage, the region, etc.

Any suggestions?

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Tue Nov 24, 2009 12:46 am

Why not use the name?

Product 1: Peas
Option 8oz can
Option 16oz can

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jc-piazza » Tue Nov 24, 2009 12:54 am

Because I only have one size per SKU. It's not an option of 8 oz. or 16 oz. but rather an attribute of the product - I could use Option if it were a single value, but the program wants me to set the quantity etc. and I've already done that in the Data tab. If I don't fill in all the fields, I get an error (and an unfriendly one at that!). Why not have the Data tab say "Use as Product Attribute?" next to Weight or Size.

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Tue Nov 24, 2009 12:56 am

I still don't get what you mean.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Xsecrets » Tue Nov 24, 2009 1:30 am

coming from the oscommerce world I believe what he is looking for would be something like product extra fields if you know what that is.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by jc-piazza » Tue Nov 24, 2009 9:40 am

try this - I have an item that costs $59.99. It is a can of sardines. Is that a good price or not? If it is for 5 gallons of sardines it might be a good deal. If it is 8 oz. of sardines, I would not want to buy it.

How do I tell the shopper it is 5 gallons? I could write that in the text field, but other carts give me a field to do that. Most carts have a size parameter like:

http://www.zingermans.com/Product.aspx?ProductID=O-ERI - note the 750ml. size as a product attribute

or

http://www.bloomingdales.com/catalog/pr ... y-ch.index which is defined in the product description rather than a separate field.

some carts have user-defined fields to display things like the vintage for a bottle of wine, or the size of a food item. Maybe this is unique to food & wine?

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Tue Nov 24, 2009 10:09 am

Ah.. ok.. I've replied to others that weren't quite sure how to use the product options for their store. Sounds like you could benefit from the same examples:
http://forum.opencart.com/viewtopic.php ... 174#p33174
http://forum.opencart.com/viewtopic.php ... all#p37386

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jc-piazza » Tue Nov 24, 2009 10:16 am

the products only come in one size.

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Qphoria » Tue Nov 24, 2009 1:27 pm

ehh...

Ok.. lets try again.

You are selling a can of tomatoes.
You are offering 8oz, 16oz, 32oz "options"
The 8oz can is $2.00
The 16oz can is $3.00
The 32oz can is $5.00

So you create your product:
Can o' Tomatoes and set the price at 2.00. This would obviously be the smallest size\ by default

Option Name: Size
Option Value 1: 8oz (no additional price. This is the "default" product size. above)
Option Value 2: 16oz (+2.00) <-- since it is $4.00 total you would add $2.00 to the base price of $2.00
Option Value 3: 32oz (+3.00) <-- sinct it is $5.00 total you would add $3.00 to the base price of $2.00

It really doesn't get simpler than the demo I linked in that other thread.
http://unbannable.com/v132/index.php?ro ... duct_id=49

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Jimle_uk » Tue Nov 24, 2009 7:17 pm

Hi, I've added custom fields to my product table such as lead time and how many photos that are required. Just simple vars/data I can pass and display on my product pages.

Quite simply, if you want to just display the weight (or dimension) fields on your product pages, do the following:

open the following php in your opencart install:

catalog -> product -> product.php

find "$this->data['model'] = $product_info['model'];"

anywhere below this, add the following line:

$this->data['weight'] = $product_info['weight'];

And That's it! Next, find:

catalog -> view -> theme -> [your theme] -> product -> product.tpl

and add "$weight" anywhere to display it.

Does that answer your question?
For custom fields, you'd need to do a bit more:
1. add fields to your products table
2. alter your admin catalog php files so you can add/edit the custom field info
3. do the above.

All the best,
Jim

Newbie

Posts

Joined
Fri Oct 30, 2009 7:51 pm

Post by jc-piazza » Wed Nov 25, 2009 10:11 pm

thanks! this seems to be the answer I need, but there seems to be an error in your path -- Store->Catalog->Product -- is that Store->Catalog->Controller->Product?

also, the weight needs a unit of measure. So I would display the value "0.8" and "pounds" or whatever on the same line.

New member

Posts

Joined
Mon Sep 07, 2009 3:23 am

Post by Jimle_uk » Wed Nov 25, 2009 11:24 pm

Yes, thanks for the correction!

if you want to unit of measure, do the following:

in catalog->model->catalog->product.php, add the following function:

Code: Select all

public function getProductWeightClass($product_weight_class_id){
		$query = $this->db->query("SELECT title FROM ". DB_PREFIX . "weight_class WHERE weight_class_id = '".$product_weight_class_id."' LIMIT 1");
		
		return $query->row['title'];
	}
in catalog->controller->product->product.php, find :

Code: Select all

$this->data['model'] = $product_info['model'];
and add the following:

Code: Select all

$this->data['weight_class'] = $this->model_catalog_product->getProductWeightClass($product_info['weight_class_id']);
then in your product.tpl, you can use the variable $weight_class.

Of course, there are many other ways to do this ie. using a join to the weight_class table in the getProducts function SQL query etc.

All the best,
Jim

Newbie

Posts

Joined
Fri Oct 30, 2009 7:51 pm

Post by Maaris » Thu Apr 28, 2011 5:13 pm

EDIT: Oh, that was an old post.. However, my problem (see below) is still looking for solution/advice.
EDIT2: Hmm.. maybe answer to my problem is in Tags?
EDIT3: Okay, forget about it. Looks like version 1.5 will have this included!
------------------------------
I have a slightly different, but related problem.

As for the above, I understand man wants those still be different products (not with options) as they all have different SKU's. Probably the easiest solution (and the one that makes sense to me) is adding size, weight, volume to a product title, like: "A Can Of Tomatoes - 16oz". It will be shown not only in product pages, but in category, brand and every other page, including invoice.

Now let's get to my problem.

I am selling allergen free food in my store and would love to have a possibility to add attributes like

"free from: gluten, nuts, dairy, celery.. and so on"

I guess it's not hard to use one of existing fields I'm not using and fill them something like "GNDC" where a letter states specific allergen. The it's not hard to call them out via mysql LIKE query and display if products are free from something.

However, it would be as easy to write just product is free from something in description (as I am doing it so far), but my main task for all this would be a possibility to filter them. Like, I check a box in sidebar Free From: Gluten and from now on site displays only those products that are free from gluten.

Any ideas for direction I would have to go?
maybe I'm just messing with that field and It's possible to do some other way? Or maybe there is already attribute mod somewhere available?

New member

Posts

Joined
Sun Jul 11, 2010 2:35 am

Post by Xsecrets » Thu Apr 28, 2011 8:30 pm

Yes this will be in 1.5, but it is available now in my product extra field contribution, plus it does work with the layered navigation for filtering. I am currently porting the layered navigation over to 1.5 to allow for filtering on the product attributes there as well.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by c4ll4n » Fri Apr 29, 2011 12:42 pm

is there a way to make a product option dependant on another option? eg:

option 1 is "make" ford/nissan/toyota
option 2 is "model" so if the select nissan then this list would contain nissan models, or if they select ford it will list ford models.

does that make sense?

Newbie

Posts

Joined
Fri Apr 29, 2011 8:20 am

Post by Maaris » Mon May 02, 2011 12:35 pm

Thanks Xsecrets!

Your Mod looks kinda something I'm looking for.

One question. I tried Demo for it and there was "filter by price" option where it allowed to filter by one range of price. eg.$0.00 - $199.00 OR $200.00 - $499.00

I'm wondering if it will be possible to filter by two custom fields in one time.
e.g. "gluten free" AND "lactose free"?

New member

Posts

Joined
Sun Jul 11, 2010 2:35 am

Post by Xsecrets » Mon May 02, 2011 8:18 pm

well I have two modules related to that. My filter module is Layered Navigation, and it has filtering by category/manufacturer/price/tags by default. Then I have the Extra Fields module which allows you to add extra fields to products. and the Layered Naviagtion module does integrate with it so it will filter by Extra Fields if you have it installed.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US
Who is online

Users browsing this forum: No registered users and 25 guests