Last Updated a year ago
PShowUpsell User Manual
PShowUpsell User Manual
Modifying the standard appearance
By default, files from the/modules/pshowupsell/views/templates/hook/*.tpl
module directory are used.Any of these files can be overwritten according to PrestaShop docs, in the directory:
/themes//modules/pshowupsell/views/templates/hook/*.tpl
Manual placement of cross-sell products in template
By default, products that meet cross-sell rules are displayed on the product page (displayFooterProduct
) and under thelist of products on the shopping cart page (
displayShoppingCartFooter
). You can hide module from these places byremoving module from hooks - see PrestaShop docs.
Additionally, you can use the hooks from module - you can display products anywhere in the store that are available for
purchase after satisfying cross-sell rule conditions.
displayCrossSellProductsSelector
Hook is used to display products that meet cross-sell rules based on individual products.{hook h='displayCrossSellProductsSelector' product='' template=''}
- product (required) - id or object (
\Product
) of product - module will use this one only product to determine that
cross-sell rule conditions passed - template (optional) - string indicating the .tpl file to be used to generate the view
/themes//modules/pshowupsell/views/templates/hook/displayCrossSellProductsSelector_.tpl
Usage example 1.
{hook h='displayCrossSellProductsSelector' product=1 template='product_1'}
This use of the hook will search for rules whose conditions are satisfied by the product with ID 1. Then the list of
products is obtained from the rules and the appearance is generated using the file
/themes//modules/pshowupsell/views/templates/hook/displayCrossSellProductsSelector_product_1.tpl
Usage example 2.
{hook h='displayCrossSellProductsSelector' product=2}
This use of the hook will search for rules whose conditions are satisfied by the product with ID 2. Then the list of
products is obtained from the rules and the appearance is generated using the file
/themes//modules/pshowupsell/views/templates/hook/displayCrossSellProductsSelector_default.tpl
or if above file does not exist, the one from the module directory will be used
/modules/pshowupsell/views/templates/hook/displayCrossSellProductsSelector_default.tpl
displayCrossSellProducts
Hook is used to display products that meet cross-sell rules based on the entire shopping cart.{hook h='displayCrossSellProducts' product='' template=''}
- product (optional) - id or object (
\Product
) of product - if you use this, then module will simulate this product as
added in the shopping cart when calculating cross-sell rule conditions - template (optional) - string indicating the .tpl file to be used to generate the view
/themes//modules/pshowupsell/views/templates/hook/displayCrossSellProducts_.tpl
Usage example
{hook h='displayCrossSellProducts' template='my_template'}
This use of hook will search for rules whose conditions are already met. Then the list of products from the rules and
generates a layout using the file
/themes//modules/pshowupsell/views/templates/hook/displayCrossSellProducts_my_template.tp