1

Ok this is going to sound confusing but its not, I have 4 categories Single, Double, Double 4'6", Kingsize, SuperKing and I have one configurable product with the different sizes as associated products.

so my questions is how do I set default option when a user goes through bed --> 3" bed --> 3" price is auto selected in the drop down menu ?

enter image description here

enter image description here

1 Answer 1

1

You posted the same question on my extension.
I won't implement it for the extension mentioned above but here are some pointers on how you can do it. You can get the code for selecting a default option from the same extension and in addition do this:

First I would add a new category attribute for each product attribute that can be used for configurable products. Let's take size for example.
So I would add a size attribute for the category that has the same options as the size product attribute. Create a custom source model for this attribute that reads the values of the product attribute. See how you can do that.. This will somehow link the categories and the attributes.
Then I would change the method that gets the default configuration of the product to take into account the category and the newly created attribute. The method is Easylife_Switcher_Block_Catalog_Product_View_Type_Configurable_Config::getDefaultValues().
Instead of reading the default configuration attribute value, just set the values you set on the category entity. If there are no values set, just do it like it's done now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.