1

I need to add code the code below to display Yotpo Reviews Carousel in category pages. Where is the template for category pages in Magento located? We are using a custom theme from SwissUp

I need to insert the code below.

<div class="yotpo yotpo-reviews-carousel" 
 data-background-color="transparent" 
 data-mode="top_rated" 
 data-type="product" 
 data-count="9" 
 data-show-bottomline="1" 
 data-autoplay-enabled="1" 
 data-autoplay-speed="3000" 
 data-show-navigation="1">&nbsp;</div>

The mark in the image below shows where to place the carousel. enter image description here

Link to the category page. https://www.perfectmakeupmirrors.com/mirrors-shop-by-brand/jerdon.html

I want the carousel to be visible across all category pages of the site.

2
  • It would be great if you upload a screenshot and point out where you want to display the carousel.
    – Tu Van
    Commented Oct 6, 2022 at 13:14
  • Tu Van, added an image. Please see. Commented Oct 6, 2022 at 13:28

2 Answers 2

1

vendor/magento/module-catalog/view/frontend/templates/product/list.phtml

or <your custom theme>/Magento_Catalog/templates/product/list.phtml

These files contain div .products.wrapper in category pages which you should be edited.

Open <your custom theme>/Magento_Catalog/templates/product/list.phtml and put the code for the carousel below the last toolbar code:

toolbar code in magento version < 2.4.3: <?= $block->getToolbarHtml() ?>

toolbar code in magento version >=2.4.3: <?= $block->getChildBlock('toolbar')->setIsBottom(true)->toHtml() ?>

0

You must add the new XML file and a new phtml file.

  1. Add the catalog_category_view.xml to your custom extension or edit the catalog_category_view.xml in app/design/frontend/Your-Vendor/theme/Magento_Catalog/layout/catalog_category_view.xml
  2. Add the pthml file to your path with your html content.
4
  • Wang, could you please specify what contents should go in catalog_category_view.xml? I need to create this as my theme already doesn't have this. Please help me here. Commented Oct 6, 2022 at 18:11
  • I added it before, but it doesn't show in the answer
    – Aaron Wang
    Commented Oct 6, 2022 at 19:27
  • <referenceBlock name="category.products"> <block class="Magento\Framework\View\Element\Template" name="custom-yotpo-reviews" template="your template path" after="-" /> </referenceBlock>
    – Aaron Wang
    Commented Oct 6, 2022 at 19:29
  • Thank you. Wang Commented Oct 7, 2022 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.