Mage_SalesRule_Model_Rule_Condition_Product Class Reference

Inheritance diagram for Mage_SalesRule_Model_Rule_Condition_Product:

Mage_CatalogRule_Model_Rule_Condition_Product Mage_Rule_Model_Condition_Abstract Varien_Object Mage_Rule_Model_Condition_Interface

List of all members.

Public Member Functions

 validate (Varien_Object $object)

Protected Member Functions

 _addSpecialAttributes (array &$attributes)


Detailed Description

Definition at line 28 of file Product.php.


Member Function Documentation

_addSpecialAttributes ( array &$  attributes  )  [protected]

Add special attributes

Parameters:
array $attributes

Reimplemented from Mage_CatalogRule_Model_Rule_Condition_Product.

Definition at line 31 of file Product.php.

00032     {
00033         parent::_addSpecialAttributes($attributes);
00034         $attributes['quote_item_qty'] = Mage::helper('salesrule')->__('Quantity in cart');
00035         $attributes['quote_item_price'] = Mage::helper('salesrule')->__('Price in cart');
00036         $attributes['quote_item_row_total'] = Mage::helper('salesrule')->__('Row total in cart');
00037     }

validate ( Varien_Object object  ) 

Validate Product Rule Condition

Parameters:
Varien_Object $object
Returns:
bool

Reimplemented from Mage_CatalogRule_Model_Rule_Condition_Product.

Definition at line 45 of file Product.php.

00046     {
00047         $product = Mage::getModel('catalog/product')
00048             ->load($object->getProductId())
00049             ->setQuoteItemQty($object->getQty())
00050             ->setQuoteItemPrice($object->getPrice())
00051             ->setQuoteItemRowTotal($object->getRowTotal());
00052 
00053         return parent::validate($product);
00054     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:50 2009 for Magento by  doxygen 1.5.8