Shop_ComparisonList
The Shop_ComparisonList class allows you to manage a list of products added to the Compare Products list. This class has methods for adding products to the list, loading added products, removing specific products from the list and clearing the list. The Shop module also has a number of AJAX handlers which you can use for managing the product compare list:
Also, you may be interested in the shop:compare action, which allows you to build a Compare Products page.
Class methods
- add_product($product_id) - adds a product with a specified identifier to the product comparison list.
- list_products() - returns a list of products added to the list. The result is an object of the Db_DataCollection class. Each element of the collection is an object of the Shop_Product class.
- clear() - removes all products from the list.
- remove_product($product_id) - removes a product with specified identifier from the list.
Next: Shop_Country
Previous: Shop_CheckoutData
Return to Reference

