Partial Attribute Combinations

Hace 2 semanas
We are having trouble trying to properly track inventory for one of our products. We have three attributes for this product ("Product Type", "Size", "Frame").

We need to track inventory by combination of only Type and size. Frame is an optional attribute that ideally would be associated to separate products. We have to keep all three attributes on the product.  

We setup the combination of product type and size with no values set for the frame. When the frame is not selected, availability is displayed with the correct number of items on hand.  Once a frame is selected availability becomes "In Stock".

The frame is an addon product not part of the artwork. However the client would like the customer to have the option to chose a frame in the attribute section, not somewhere else on the site.

Example Attributes
Product Type:
Ltd Edition
Original
Paper Print

Size:
28x25
32x40
36x45

Frame:
No frame
Black Frame
White Frame

Thank You

Hace 2 semanas
brandon71 wrote:
...We setup the combination of product type and size with no values set for the frame. When the frame is not selected, availability is displayed with the correct number of items on hand.  Once a frame is selected availability becomes "In Stock". ...


It's by design, although looking at the code, not necessarily well implemented...

The problem is that the feature of having "non-combinable" attributes was implemented using the below extension method IsNonCombinable().  But look at the comments.  They "assume that attributes which cannot have values ... are non-combinable", which is true, but that does not support your scenario where you explicitly exclude an attribute from any combination and still want to display the stock quantity for the valid combinations.

\Libraries\Nop.Services\Catalog\ProductAttributeExtensions.cs
public static bool IsNonCombinable(this ProductAttributeMapping productAttributeMapping)
{
    //When you have a product with several attributes it may well be that some are combinable,
    //whose combination may form a new SKU with its own inventory,
    //and some non-combinable are more used to add accessories

    if (productAttributeMapping == null)
        return false;

    //we can add a new property to "ProductAttributeMapping" entity indicating whether it's combinable/non-combinable
    //but we assume that attributes
    //which cannot have values (any value can be entered by a customer)
    //are non-combinable
    var result = !ShouldHaveValues(productAttributeMapping);
    return result;
}


You can see related posts here:
https://www.google.com/search?q=site%3Anopcommerce.com+noncombinable

So, I don't think that it's necessary to 'add a new "Combinable" property to product attribute mapping', but rather I would think that there should an "assumption" that if there is a defined combination that matches the user selections that it would be a  match.  I suppose an admin could then create various partial combinations and then which would "win", but I'd think that would be an error on the part of the admin.