0

We would like to give a discount on a product in the cart, IF the customer has exceeded a specific quantity of that product in the cart. The complex part is, the specific quantity is custom per product - and set in a custom attribute.

Example:

  1. widget custom field for sale-threshold is 5 units

  2. If a customer has 4 widgets in cart, no discount is given

  3. If the customer has 5 or more in the cart, then they get a discount configured in the rule

(I tried using the code for the custom attribute in the rule itself "if quantity in cart equals or is greater than sale_threshold" - but that didn't work)

Is this possible?

1 Answer 1

0

It is possible to configure a custom attribute to be usable in cart price rules.

In BO you can do it in Catalog > Attributes > Manage Attributes > [find and select your custom attribute]. In the "Properties" menu, set "Use for Promo Rule Conditions" to "Yes"

You can also do it in a setup script :

/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer->updateAttribute(
    'catalog_product',
    'custom_attribute_code',
    'is_used_for_promo_rules', 
    1
);

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.