1. Home
  2. Docs
  3. Leo Product Recommendations for WooCommerce
  4. Developer Docs
  5. Template Customization

Template Customization

All template files are available in templates folder inside plugin files. Templates files contain the markup and template structure for frontend popup modal.

When you open these files, you will notice filter and action hooks that will allow you to add/edit content.

You also can overwrite templates files like the WooCommerce templating from your theme. Create a directory as /wpr/templates/ and copy template file inside the directory.
Example: To override template-modal.php file by your theme then the file structure should be  wp-content/themes/yourtheme/wpr/templates/template-modal.php

Note: You need some development knowledge to overwrite template files or it may cause an error.

How to hide modal from archive page / single page / Gutenberg Posts block ?

To hide product recommendation from archive page add the code in your theme functions.php

add_filter('wc_pr_show_in_product_archives', false);

To hide product recommendation from single page add the following code in your theme functions.php

add_filter('wc_pr_show_in_singe_product', false);

To hide product recommendation from Gutenberg block add the following code in your theme functions.php

add_filter('wc_pr_show_in_gutenberg_product_block', false);
Was this article helpful to you? Yes No

How can we help?