Magento WordPress Related Products DocumentationRelated Products

« Back to Magento 2 Related Products

Table of Contents
  1. Installation
  2. Change Post Limit
Need Help?

info@fishpig.com

 
  • Installation

    Before installing Related Products, you must upgrade any installed FishPig modules to the latest version.

    You can install the module for Magento 2 using Composer or you can manually install it using FTP.

    • Run the following commands in your Magento 2 root directory to install the module using Composer.

      # Add the FishPig Composer repo
      composer config repositories.fishpig composer https://repo.fishpig.co.uk/
          
      # Install the module using Composer
      composer require fishpig/fishpig/magento2-wordpress-integration-relatedproducts:*
      
      # Enable the module in Magento 2
      php bin/magento module:enable FishPig_WordPress_RelatedProducts
      
      # Run the Magento upgrade system
      php bin/magento setup:upgrade
    • You can download the latest version of the module from the Downloads page.

      Extract the ZIP file and upload the files to your Magento site at the directory below:

      app/code/FishPig/WordPress_RelatedProducts

      When creating the folders, ensure you use the correct capitalisation.

      To complete the installation, run the following commands in a terminal.

      # Enable the module in Magento 2
      php bin/magento module:enable FishPig_WordPress_RelatedProducts
      
      # Run the Magento upgrade system
      php bin/magento setup:upgrade

    ↑ Back to Top

  • Change the Post Limit in Product Tab

    By default, only 5 related posts will display on the product page. You can increase this using the following XML in your custom theme.

    <?xml version="1.0"?>
    <!--
    /**
     * Create this file at:
     * app/design/frontend/YourVendor/YourTheme/FishPig_WordPress_RelatedProducts/layout/catalog_product_view.xml
     */
    -->
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
      <body>      
        <referenceBlock name="related_posts.tab">
          <arguments>
            <argument name="post_limit" xsi:type="number">20</argument>
          </arguments>
        </referenceBlock>
      </body>
    </page>

    ↑ Back to Top