0

Based off Product different prices and options per customer group say if you had

3 simple products

1 box - 700g
8 boxes - 700g
12 boxes - 700g

And 2 configurable products

Retail configurable product - All three simple products are associated 
Trade configurable product - Only 8 boxes - 700g is associated

Is it possible to hide the dropdown on the trade configurable product as there is only 1 option? I know you can use extensions such as https://github.com/tzyganu/Switcher to set defaults but I want to hide the dropdown completely as if they can only choose 1 option then its pointless.

I know some of you will say "well just use a simply product with no associated products" however the issue here is that we would need to manage 2 stock levels, 1 for trade and 1 for retail. In reality the stock is all the same and we dont have different levels for different customer groups

2 Answers 2

1

You can modify /app/design/frontend/XXX/YYY/template/catalog/product/view/type/options/configurable.phtml

There, you need to find out if you only have a single product associated with your configurable product
e.g.: Mage::getModel('catalog/product_type_configurable') ->getUsedProducts(null,$product);
and then count it. Then do an if/else condition on that. On the elsepart you'd have the usual process, and on the if part you'd have this :

<input type="hidden" name="super_attribute[<?php echo 'yourattributeID' ?>]" value="<?php echo "the value associated with this product for this attribute" ?>" />

And you should be OK, upon landing on the product page, people would only have the choice of modifying quantity and add to cart.

0

You just need to add a simple javascript to the configurable products page that does this.
If there is only one dropdown with only one value, autoselect the value and hide the dropdown and the label above it. You don't need any extension for that.

Your Answer

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

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