History | Log In     View a printable version of the current page. Get help!  
Issue Details (XML | Word)

Key: OSC-27
Type: Task Task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Harald Ponce de Leon
Reporter: Harald Ponce de Leon
Votes: 11
Watchers: 16
Operations

If you were logged in you would be able to see more operations.
osCommerce Core

Product Attributes Implementation

Created: 21/Oct/06 05:08 PM   Updated: 15/Mar/09 11:10 PM
Component/s: Core Framework
Affects Version/s: 3.0 Alpha 5
Fix Version/s: 3.0 Alpha 5


 Description  « Hide
The product attributes implementation will be updated to allow quantities to be defined, in addition to the input field to be used (radio, checkbox, pulldown menu, and text input field).

The attribute price will also allow for =, *, and / calculations, in addition to + and -.

 All   Comments   Change History      Sort Order:
Ryan Hobbs [07/Jan/07 08:22 PM]
Should also allow the ability to allow for a 0 in the price update or allow the option to leave it blank and default to 0. It currently doesn't allow for this in 3a pre4.

Eden B [21/Mar/07 09:07 AM]
Should also link multiple attributes together.

For example, if there is 2 attribute sets e.g. Size and Colour, then I assign green and red as an attribute, then out of the size set I assign 10, 12, 14, it should have the capability to do all the combinations as below:
Green 10
Green 12
Green 14
Red 10
Red 12
Red 14

That way it would be possible for the user to leave out combinations that are not possible, e.g. Size 12 is not available in Red. Currently it does not do this in 3.0a3.

Melinda Odom [09/Apr/07 06:20 PM]
The attributes need to have a sort order so if you have an option value like "none" it can be listed at the top of the list.

The attributes need to have one checkbox for a multiple of option values under one option name...example:
You are monogramming and have to list the 26 characters of the alphabet for each first initial, middle initial, and last name initial. This needs a way to not only be added easily but also to be checked on a product as a group instead of checking off 26 characters 3 times for each product. This would also need an option value as "none" at the top of the list for no monogramming.

fred doherty [19/Apr/07 03:25 PM]
I agree with Eden B about stock control with mixed attributes. Also attributes should be given unique product codes.

For instance if a product does not have attributes associated with it then use default code given for that item.
If attributes are associated then disregard default product code and use product code for selected attributes. i.e

Green 10 code:SP-G-10
Green 12 code:SP-G-12
Green 14 code:SP-G-14
Red 10 code:SP-R-10
Red 12 code:SP-R-12
Red 14 code:SP-R-14

This is because all the suppliers I know use different product codes for each variation of a product.

Scott Hook [10/May/07 09:55 PM]
I would really like to see a model number field attached. In the current 2.2 I have subproducts installed as well as easypopulate and am able to upload inventory to 20,000 items and subitems daily in a matter of minutes. I think a unique identifier for each attribute such as a model number would help people be able to code their way to updating their store via tab delimated files. Thank you for your considerations.

Elise [13/Jun/07 05:29 AM]
Most stores will have products with multiple sizes and/or colours. Unfortunately with the current attributes system, this means that inventory/stock capabilities cannot be used properly - as attributes are not assigned their own unique product ID number.
* attributees need their own unique ID number
* would be great to create attribute dependencies. ie, if you have multiple attribute sets for a product, then selecting a specific attribute, will change the list of attribute choices in the other attributes (this would be necessary when using stock).

So going back to my example of size and colour. An Item has a COLOUR and a SIZE Attribute dropdown.
If you have Black Items in Small, Medium and Large, but Red items in only Medium and Large, then should a customer select the RED Item in the COLOUR dropdown, the SIZE dropdown will need to refresh to reflect the available sizes, which are, only Medium and Large.

There needs to be the ability to select which products will have stock tracking enabled. Many shops have a mixture of stocked items, and items that are orderable for immediately delivery from their supplier. There needs to be a way to track 'actual' shop inventory as compared to items that are supplied from teh wholesaler on a per-purchase basis. QTPro (a current attributes and product stock system OSC contribution) performs alot of very good attributes functions, aswell as selectable stock tracking - some ideas can be borrowed from here perhaps??

Thomas B. [24/Jul/07 03:07 PM]
Sometimes products are discontinued and you cann't reorder missing sizes at your supplier. In these cases it would be great to mark a product that only attribute combinations can be ordered that are still in stock, even if the global settings allow orders, if stock is running out. For this, it's nessesary, to store stock quantities for each attribute combination.

In 2.2 this can be reached with the contributions QTPro and Limited stock by article, but I feel that the whole attribute system should be integrated into the core better than into a contribution as this effects also other areas i.e. import/export.

Julie Parenteau [23/Oct/07 08:23 PM]
YES! to all, especially being able to have a separate product code/model # for each attribute.

May switf fingers and the computer Gods be with you! ;c)
Thanks for your efforts!
jp

Jtm [15/Dec/07 08:31 AM]
For as long as I've used OSCommerce (3+years) I've added a '=' product attribute price modifier, which instead of adding or subtracting to the cost, it just sets the price.

Line 180ish of includes/classes/shopping_cart.php: (OSC 3 Alpha 4)

/* ORIG */
              if ($Qattributes->value('price_prefix') == '+') {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] += $Qattributes->value('options_values_price');
              } else {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] -= $Qattributes->value('options_values_price');
              }

/* MINE */
              if ($Qattributes->value('price_prefix') == '-') {
               $this->_contents[$Qproducts->value('products_id')]['final_price'] -= $Qattributes->value('options_values_price');
              } elseif ($Qattributes->value('price_prefix') == '+') {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] += $Qattributes->value('options_values_price');
              } else {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] -= $Qattributes->value('options_values_price');
              }

And lines 828-840-ish in the admin/templates/pages/products/edit.php theres a couple of edits to be made to show the new '=' option. Look for all osc_draw_pull_down_menu function calls and replace the
  array(array('id' => '-', 'text' => '-'), array('id' => '+', 'text' => '+'))
with
  array(array('id' => '=', 'text' => '='), array('id' => '-', 'text' => '-'), array('id' => '+', 'text' => '+'))

Its that easy. Please add it to trunk, kthxbai

Jtm [15/Dec/07 08:36 AM]
Well crap. Posted a broken edit of mine.

/* Revised */
              if ($Qattributes->value('price_prefix') == '-') {
               $this->_contents[$Qproducts->value('products_id')]['final_price'] -= $Qattributes->value('options_values_price');
              } elseif ($Qattributes->value('price_prefix') == '+') {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] += $Qattributes->value('options_values_price');
              } else {
                $this->_contents[$Qproducts->value('products_id')]['final_price'] = $Qattributes->value('options_values_price');
              }

Stephen Howells [21/Nov/08 03:45 PM]
Very quick comment as I am not involved (yet) with coding.
KonaKart which is nearly an identical product but using Java/JSP instead of PHP has product attributes with stock fields for every permutation:
It works perfectly in that respect and it might be worthwhile taking a look and using the same technique. Save reinventing the wheel?
Essentially they have the same tables with the same (cumbersome) style of nested values in the products_options field within the products_quantity table.
eg 29, '7{16}10{31}', 6, '0'

So it sounds like your choice is do it the same way or (as Eden & Fred say) give each product variant(s) permutation its own product_id.
I think allowing some permutations of 'blue' in 'size 12' to be missed its going to get very complex: And not very intuitive for customers anyway.
As long as the unavailable perm has a stock # of zero it can be handled (nearly) as well.
Just my immediate thoughts without even having run Alpha #5 yet!
Steve

Stephen Schmidt [13/Feb/09 02:40 AM]
I am looking for an implementation that could do the following:

I have an several items (mixing Blades).
  It comes in sizes rangeing from 2" to 40" diameter
  It can be made of different materials (304 Stainless steel, 316 S/S, etc)
  It can have various treatments (Surface Hardened, Chrome plated, etc)

It is simple to set up a product (F blade, G Blade, etc) for each style
  For diameter, I can set (2", 3",...40") and the respective prices (Prices do not vary linearly)
 But now I have a problem:
   If I set "Wear Treatment", Surface Hardened to $40.00
    It works when a customer selects a 2" blade for $53.00, + 40 for wear treatment.

BUT does not work for 20" blade, where the diference is $150.00.

An implementation in another (interchange) cart that I found interesting used another table called varients. In this table you listed acceptable combinations
  F-02-3 F blade 2" 304 Stainless Steel
  F-20-3H F Blade 20" 304 stainess steel, Surface Hardened

IN this way, the product sceen Had one drop down for diameter, with all the diameter about 15, 1 with material with 3 different materials, and one for treatment, with three choices

Since I cannot do a straight adder for my options, I presently need to put one drop down with 135 choices OR as I do now Just list the stainless options and list "By Quotation" after each of the material and treat,ment options, and call the customer to see if they are interested in ordering. (This many times is missed by the customer and I am sure other times causes customer to leave without ordering)

Stephen Schmidt [15/Mar/09 11:10 PM]
First, let me congratulate you on new Version 3a5. Your implementation of variants handles the case I mention above, extremely well.

You mention an implementation of attributes that will be completed. I am hoping that the attributes can be used to add futher options to the variants and adjust pricing if necessary.

One additional feature that I would find extremely usefull is a description field for the variants (and Options) that could be displayed in a window triggered by clicking an icon near the combobox for the variant, or as a mouse over.