Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

Is there a way to enable/disable a products attribute options in the product page based on certain conditions? 
Jr. Member
Total Posts:  1
Joined:  2012-11-01

In my store an attribute exists for all products, this attribute makes a control of a recurrent shipping.

The attribute is called frequency. and has the following options: - Weekly - Every two weeks - One-time

By identifying these values ​​in the shopping cart, I have to limit what values ​​of this attribute that can be selected in the following products.

Lets say the first product added to cart is set to “weekly”, so the following products I view in the store may not have added the option of “One-time”.

I have identified products shopping cart by checking attributes using the array:

items Mage :: getSingleton ('checkout / session') -> getQuote () -> getAllItems ();

And I built a helper function to return me a value for each attribute, I have no problem with this.

The problem is that I can not find information on how I can selectively disable the options Based on the result of the function. How do I remove / disable one or two of the 3 possible options by code?. I can not delete the option for obvious reasons, I just need that those are not selectable while the opposite condition is selected for a product that is in the cart.

Forgive my bad english.

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top