In magento 2 How to customize a sidebar additional in product details page?












2















In custom theme how to customize a sidebar by our requirement in product detail page.



please refer the screen shot
enter image description here










share|improve this question





























    2















    In custom theme how to customize a sidebar by our requirement in product detail page.



    please refer the screen shot
    enter image description here










    share|improve this question



























      2












      2








      2


      1






      In custom theme how to customize a sidebar by our requirement in product detail page.



      please refer the screen shot
      enter image description here










      share|improve this question
















      In custom theme how to customize a sidebar by our requirement in product detail page.



      please refer the screen shot
      enter image description here







      magento2 product-view






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 30 at 6:02









      Rakesh Donga

      2,393316




      2,393316










      asked Jan 30 at 5:44









      divya sekardivya sekar

      35314




      35314






















          3 Answers
          3






          active

          oldest

          votes


















          3














          Use this code in your /app/design/frontend/[Vendor]/[Themename]/Magento_Catalog/layout/catalog_product_view.xml to add additional sidebar in your product details page



          <referenceContainer name="sidebar.additional">
          <block class="MagentoCatalogBlockProductView" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
          </referenceContainer>


          And customized it using following way



          <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
          <referenceBlock name="catalog.compare.sidebar" remove="true" />
          <referenceBlock name="wishlist_sidebar" remove="true" />





          share|improve this answer


























          • I will check and update you in few mins @aasim

            – divya sekar
            Jan 30 at 5:56











          • Please don't forget to clear cache after change in layout xml files

            – Aasim Goriya
            Jan 30 at 6:02











          • Its works @aasim thanks

            – divya sekar
            Jan 30 at 6:03



















          2














          There are different solution of customising sider of product page.



          First you need to create a module or check catalog catalog_product_view.xml in your module or theme frontend layout folder.



          Exact location layout files:



          For Module: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml
          For theme: appdesignfrontendVendorthemeMagento_Cataloglayoutcatalog_product_view.xml



          Now if you want to remove existing block from sidebar:



          <?xml version="1.0"?>
          <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
          <body>
          <referenceBlock name="catalog.compare.sidebar" remove="true" />
          <referenceBlock name="wishlist_sidebar" remove="true" />
          </body>
          </page>


          Now if you want remove block and add new phtml file for customization it will look like this.



          <?xml version="1.0"?>
          <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
          <body>
          <referenceBlock name="catalog.compare.sidebar" remove="true" />
          <referenceBlock name="wishlist_sidebar" remove="true" />
          <referenceContainer name="sidebar.additional">
          <block class="MagentoFrameworkViewElementTemplate" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
          </referenceContainer>
          </body>
          </page>


          You are also able to add static block to so that you are able to manage this block from admin for this you xml look like this.



          <?xml version="1.0"?>
          <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
          <body>
          <referenceBlock name="catalog.compare.sidebar" remove="true" />
          <referenceBlock name="wishlist_sidebar" remove="true" />
          <referenceContainer name="sidebar.additional">
          <block class="MagentoCmsBlockBlock" name="custom_block">
          <arguments>
          <argument name="block_id" xsi:type="string">custom_block</argument>
          </arguments>
          </block>
          </referenceContainer>
          </body>
          </page>


          Note: custom_block is block identifier (Admin->Content->Block) you need to create new block with this identifier.






          share|improve this answer































            1














            if file exist then open below file otherwise create




            /app/design/frontend/{Vendor}/{Themename}/Magento_Catalog/layout/catalog_product_view.xml




            and just add



            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />





            share|improve this answer
























            • its simple and works

              – divya sekar
              Jan 30 at 6:18












            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "479"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f259730%2fin-magento-2-how-to-customize-a-sidebar-additional-in-product-details-page%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            3














            Use this code in your /app/design/frontend/[Vendor]/[Themename]/Magento_Catalog/layout/catalog_product_view.xml to add additional sidebar in your product details page



            <referenceContainer name="sidebar.additional">
            <block class="MagentoCatalogBlockProductView" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
            </referenceContainer>


            And customized it using following way



            <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />





            share|improve this answer


























            • I will check and update you in few mins @aasim

              – divya sekar
              Jan 30 at 5:56











            • Please don't forget to clear cache after change in layout xml files

              – Aasim Goriya
              Jan 30 at 6:02











            • Its works @aasim thanks

              – divya sekar
              Jan 30 at 6:03
















            3














            Use this code in your /app/design/frontend/[Vendor]/[Themename]/Magento_Catalog/layout/catalog_product_view.xml to add additional sidebar in your product details page



            <referenceContainer name="sidebar.additional">
            <block class="MagentoCatalogBlockProductView" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
            </referenceContainer>


            And customized it using following way



            <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />





            share|improve this answer


























            • I will check and update you in few mins @aasim

              – divya sekar
              Jan 30 at 5:56











            • Please don't forget to clear cache after change in layout xml files

              – Aasim Goriya
              Jan 30 at 6:02











            • Its works @aasim thanks

              – divya sekar
              Jan 30 at 6:03














            3












            3








            3







            Use this code in your /app/design/frontend/[Vendor]/[Themename]/Magento_Catalog/layout/catalog_product_view.xml to add additional sidebar in your product details page



            <referenceContainer name="sidebar.additional">
            <block class="MagentoCatalogBlockProductView" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
            </referenceContainer>


            And customized it using following way



            <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />





            share|improve this answer















            Use this code in your /app/design/frontend/[Vendor]/[Themename]/Magento_Catalog/layout/catalog_product_view.xml to add additional sidebar in your product details page



            <referenceContainer name="sidebar.additional">
            <block class="MagentoCatalogBlockProductView" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
            </referenceContainer>


            And customized it using following way



            <move element="catalog.product.related" destination="sidebar.additional" after="product_view_custom_block"/>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jan 30 at 5:54

























            answered Jan 30 at 5:49









            Aasim GoriyaAasim Goriya

            4,0131938




            4,0131938













            • I will check and update you in few mins @aasim

              – divya sekar
              Jan 30 at 5:56











            • Please don't forget to clear cache after change in layout xml files

              – Aasim Goriya
              Jan 30 at 6:02











            • Its works @aasim thanks

              – divya sekar
              Jan 30 at 6:03



















            • I will check and update you in few mins @aasim

              – divya sekar
              Jan 30 at 5:56











            • Please don't forget to clear cache after change in layout xml files

              – Aasim Goriya
              Jan 30 at 6:02











            • Its works @aasim thanks

              – divya sekar
              Jan 30 at 6:03

















            I will check and update you in few mins @aasim

            – divya sekar
            Jan 30 at 5:56





            I will check and update you in few mins @aasim

            – divya sekar
            Jan 30 at 5:56













            Please don't forget to clear cache after change in layout xml files

            – Aasim Goriya
            Jan 30 at 6:02





            Please don't forget to clear cache after change in layout xml files

            – Aasim Goriya
            Jan 30 at 6:02













            Its works @aasim thanks

            – divya sekar
            Jan 30 at 6:03





            Its works @aasim thanks

            – divya sekar
            Jan 30 at 6:03













            2














            There are different solution of customising sider of product page.



            First you need to create a module or check catalog catalog_product_view.xml in your module or theme frontend layout folder.



            Exact location layout files:



            For Module: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml
            For theme: appdesignfrontendVendorthemeMagento_Cataloglayoutcatalog_product_view.xml



            Now if you want to remove existing block from sidebar:



            <?xml version="1.0"?>
            <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
            <body>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />
            </body>
            </page>


            Now if you want remove block and add new phtml file for customization it will look like this.



            <?xml version="1.0"?>
            <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
            <body>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />
            <referenceContainer name="sidebar.additional">
            <block class="MagentoFrameworkViewElementTemplate" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
            </referenceContainer>
            </body>
            </page>


            You are also able to add static block to so that you are able to manage this block from admin for this you xml look like this.



            <?xml version="1.0"?>
            <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
            <body>
            <referenceBlock name="catalog.compare.sidebar" remove="true" />
            <referenceBlock name="wishlist_sidebar" remove="true" />
            <referenceContainer name="sidebar.additional">
            <block class="MagentoCmsBlockBlock" name="custom_block">
            <arguments>
            <argument name="block_id" xsi:type="string">custom_block</argument>
            </arguments>
            </block>
            </referenceContainer>
            </body>
            </page>


            Note: custom_block is block identifier (Admin->Content->Block) you need to create new block with this identifier.






            share|improve this answer




























              2














              There are different solution of customising sider of product page.



              First you need to create a module or check catalog catalog_product_view.xml in your module or theme frontend layout folder.



              Exact location layout files:



              For Module: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml
              For theme: appdesignfrontendVendorthemeMagento_Cataloglayoutcatalog_product_view.xml



              Now if you want to remove existing block from sidebar:



              <?xml version="1.0"?>
              <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
              <body>
              <referenceBlock name="catalog.compare.sidebar" remove="true" />
              <referenceBlock name="wishlist_sidebar" remove="true" />
              </body>
              </page>


              Now if you want remove block and add new phtml file for customization it will look like this.



              <?xml version="1.0"?>
              <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
              <body>
              <referenceBlock name="catalog.compare.sidebar" remove="true" />
              <referenceBlock name="wishlist_sidebar" remove="true" />
              <referenceContainer name="sidebar.additional">
              <block class="MagentoFrameworkViewElementTemplate" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
              </referenceContainer>
              </body>
              </page>


              You are also able to add static block to so that you are able to manage this block from admin for this you xml look like this.



              <?xml version="1.0"?>
              <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
              <body>
              <referenceBlock name="catalog.compare.sidebar" remove="true" />
              <referenceBlock name="wishlist_sidebar" remove="true" />
              <referenceContainer name="sidebar.additional">
              <block class="MagentoCmsBlockBlock" name="custom_block">
              <arguments>
              <argument name="block_id" xsi:type="string">custom_block</argument>
              </arguments>
              </block>
              </referenceContainer>
              </body>
              </page>


              Note: custom_block is block identifier (Admin->Content->Block) you need to create new block with this identifier.






              share|improve this answer


























                2












                2








                2







                There are different solution of customising sider of product page.



                First you need to create a module or check catalog catalog_product_view.xml in your module or theme frontend layout folder.



                Exact location layout files:



                For Module: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml
                For theme: appdesignfrontendVendorthemeMagento_Cataloglayoutcatalog_product_view.xml



                Now if you want to remove existing block from sidebar:



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                </body>
                </page>


                Now if you want remove block and add new phtml file for customization it will look like this.



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                <referenceContainer name="sidebar.additional">
                <block class="MagentoFrameworkViewElementTemplate" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
                </referenceContainer>
                </body>
                </page>


                You are also able to add static block to so that you are able to manage this block from admin for this you xml look like this.



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                <referenceContainer name="sidebar.additional">
                <block class="MagentoCmsBlockBlock" name="custom_block">
                <arguments>
                <argument name="block_id" xsi:type="string">custom_block</argument>
                </arguments>
                </block>
                </referenceContainer>
                </body>
                </page>


                Note: custom_block is block identifier (Admin->Content->Block) you need to create new block with this identifier.






                share|improve this answer













                There are different solution of customising sider of product page.



                First you need to create a module or check catalog catalog_product_view.xml in your module or theme frontend layout folder.



                Exact location layout files:



                For Module: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml
                For theme: appdesignfrontendVendorthemeMagento_Cataloglayoutcatalog_product_view.xml



                Now if you want to remove existing block from sidebar:



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                </body>
                </page>


                Now if you want remove block and add new phtml file for customization it will look like this.



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                <referenceContainer name="sidebar.additional">
                <block class="MagentoFrameworkViewElementTemplate" name="product_view_custom_block" before="-" template="Magento_Catalog::product/view/custom_block.phtml"/>
                </referenceContainer>
                </body>
                </page>


                You are also able to add static block to so that you are able to manage this block from admin for this you xml look like this.



                <?xml version="1.0"?>
                <page layout="2columns-right" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
                <body>
                <referenceBlock name="catalog.compare.sidebar" remove="true" />
                <referenceBlock name="wishlist_sidebar" remove="true" />
                <referenceContainer name="sidebar.additional">
                <block class="MagentoCmsBlockBlock" name="custom_block">
                <arguments>
                <argument name="block_id" xsi:type="string">custom_block</argument>
                </arguments>
                </block>
                </referenceContainer>
                </body>
                </page>


                Note: custom_block is block identifier (Admin->Content->Block) you need to create new block with this identifier.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 30 at 6:06









                Aman AlamAman Alam

                953519




                953519























                    1














                    if file exist then open below file otherwise create




                    /app/design/frontend/{Vendor}/{Themename}/Magento_Catalog/layout/catalog_product_view.xml




                    and just add



                    <referenceBlock name="catalog.compare.sidebar" remove="true" />
                    <referenceBlock name="wishlist_sidebar" remove="true" />





                    share|improve this answer
























                    • its simple and works

                      – divya sekar
                      Jan 30 at 6:18
















                    1














                    if file exist then open below file otherwise create




                    /app/design/frontend/{Vendor}/{Themename}/Magento_Catalog/layout/catalog_product_view.xml




                    and just add



                    <referenceBlock name="catalog.compare.sidebar" remove="true" />
                    <referenceBlock name="wishlist_sidebar" remove="true" />





                    share|improve this answer
























                    • its simple and works

                      – divya sekar
                      Jan 30 at 6:18














                    1












                    1








                    1







                    if file exist then open below file otherwise create




                    /app/design/frontend/{Vendor}/{Themename}/Magento_Catalog/layout/catalog_product_view.xml




                    and just add



                    <referenceBlock name="catalog.compare.sidebar" remove="true" />
                    <referenceBlock name="wishlist_sidebar" remove="true" />





                    share|improve this answer













                    if file exist then open below file otherwise create




                    /app/design/frontend/{Vendor}/{Themename}/Magento_Catalog/layout/catalog_product_view.xml




                    and just add



                    <referenceBlock name="catalog.compare.sidebar" remove="true" />
                    <referenceBlock name="wishlist_sidebar" remove="true" />






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jan 30 at 6:12









                    Rakesh DongaRakesh Donga

                    2,393316




                    2,393316













                    • its simple and works

                      – divya sekar
                      Jan 30 at 6:18



















                    • its simple and works

                      – divya sekar
                      Jan 30 at 6:18

















                    its simple and works

                    – divya sekar
                    Jan 30 at 6:18





                    its simple and works

                    – divya sekar
                    Jan 30 at 6:18


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f259730%2fin-magento-2-how-to-customize-a-sidebar-additional-in-product-details-page%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    MongoDB - Not Authorized To Execute Command

                    How to fix TextFormField cause rebuild widget in Flutter

                    in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith