shop:compare
The shop:compare action is a base action for the Compare Products page. The action loads a list of products, added to the product comparison list, and generates a corresponding PHP variable. You may also be interested in the following AJAX handlers:
Generated PHP variables
- $products - a list of products added to the comparison list. An object of the Db_DataCollection class. Each element in the collection is an object of the Shop_Product class.
- $attributes - a list (array) of product attributes of all products in the comparison list. You can manage product attributes on the Attributes tab of the Create/Edit Product page. To output an attribute value by its name, you can use the following code:
<?= h($product->get_attribute($attribute)) ?>
Next: shop:login
Previous: shop:checkout
Return to Reference

