Magento 2 WordPress Integration Related Products Documentation

  • 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.

    Composer

    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.com/
    
    # Install the module using Composer
    composer require 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
    Manual

    You can download the latest version of the module by logging in to your account and selecting Account > Projects.

    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
    bin/magento module:enable FishPig_WordPress_RelatedProducts
    
    # Run the Magento upgrade system
    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