I had a situation where I need to give commerce discount depending on the products type. I found another issue discussing similar feature request here.

This is a screenshot of the functionality that it adds.

Commerce discount with product type as condition

The attached patch is against the dev version of the module.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pontus_nilsson’s picture

pontus_nilsson’s picture

Issue summary: View changes
pontus_nilsson’s picture

Title: Add a 'product has type' for commerce product discount condition » Add a 'product has type' as commerce product discount condition
jkuma’s picture

Status: Needs review » Fixed
FileSize
4.24 KB

Hello pontus_nilsson,

Thanks for the patch, it's well written, and it's working good to me. I've just added this line to allow granted users to easily update the product type criterion from the rule condition itself.

          'description' => t('Enter the product type to compare against the passed product line item.'),
          'options list' => 'commerce_product_type_options_list',

Pushed in 7.x-1.x branch. diff

pontus_nilsson’s picture

Nice catch! Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.