1

I'm creating my custom theme, now I have a problem with links to my products, I can access to product only going to the category and the clicking on the products.

Then if I put the link on the homepage or I insert the link directly from a new tab on my broswer I get a white page with this error on exception.log:

main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'The element 'product.info.options' already has a child with alias 'default'' in /var/www/html/magento2/vendor/magento/framework/Data/Structure.php:611 main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'The element 'product.info.options' already has a child with alias 'text'' in /var/www/html/magento2/vendor/magento/framework/Data/Structure.php:611 main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'The element 'product.info.options' already has a child with alias 'file'' in /var/www/html/magento2/vendor/magento/framework/Data/Structure.php:611 main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'The element 'product.info.options' already has a child with alias 'select'' in /var/www/html/magento2/vendor/magento/framework/Data/Structure.php:611 main.CRITICAL: exception 'Magento\Framework\Exception\LocalizedException' with message 'The element 'product.info.options' already has a child with alias 'date'' in /var/www/html/magento2/vendor/magento/framework/Data/Structure.php:611

But I don't modify these block, here my layout xml: Magento_Catalog/layout/catalog_product_view.xml

<?xml version="1.0"?><page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="mage/gallery/gallery.css"/>
    <css src="css/macrocategoria.css" media="screen,projection" />
    <css src="css/product.css" media="screen,projection" />
</head>
<update handle="catalog_product_opengraph" />
<update handle="page_calendar"/>
<body>
    <attribute name="itemtype" value="http://schema.org/Product" />
    <attribute name="itemscope" value="itemscope"/>
    <referenceBlock name="head.components">
        <block class="Magento\Framework\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Catalog::js/components.phtml"/>
    </referenceBlock>
    <referenceBlock name="page.main.title" remove="true">
        <arguments>
            <argument name="css_class" xsi:type="string">product</argument>
            <argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
        </arguments>
    </referenceBlock>
    <referenceBlock name="root">
        <arguments>
            <argument name="add_attribute" xsi:type="string">itemscope itemtype="http://schema.org/Product"</argument>
        </arguments>
    </referenceBlock>
    <referenceContainer name="content">
        <container name="product-wrapper" label="Product wrapper" before="-" htmlTag="div" htmlClass="row no-margin">
            <container name="image-left-side" label="Image left side" htmlTag="div" htmlClass="col s12 m6 l6" before="-">
                <container name="product.info.media" after="product.info.main">
                    <block class="<Vendor>\<Custom_Module>\Block\MediaGallery" name="product.info.media.image" template="Magento_Catalog::product/view/gallery.phtml"/>
                </container>
            </container>
            <container name="product-info-main" label="Product info main" htmlTag="div" htmlClass="col s12 m6 l6" after="-">
                <container name="product.top.attributes" label="Product top attributes" htmlTag="div" htmlClass="top-attributes" before="page.main.title">
                    <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.codiceProdotto" template="Magento_Catalog::product/view/codiceProdotto.phtml" before="product.info.marchio">
                        <arguments>
                            <argument name="at_call" xsi:type="string">getCodiceProdotto</argument>
                            <argument name="at_code" xsi:type="string">codice_prodotto</argument>
                            <argument name="css_class" xsi:type="string">codice_prodotto</argument>
                            <argument name="at_label" xsi:type="string">Cod. </argument>
                            <argument name="add_attribute" xsi:type="string">itemprop="codiceProdotto"</argument>
                        </arguments>
                    </block>
                    <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.marchio" template="Magento_Catalog::product/view/attribute.phtml">
                        <arguments>
                            <argument name="at_call" xsi:type="string">getMarchio</argument>
                            <argument name="at_code" xsi:type="string">marchio</argument>
                            <argument name="css_class" xsi:type="string">marchio</argument>
                            <argument name="add_attribute" xsi:type="string">itemprop="marchio"</argument>
                        </arguments>
                    </block>
                </container>
                <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.name" template="Magento_Catalog::product/view/title.phtml">
                    <arguments>
                        <argument name="at_call" xsi:type="string">getName</argument>
                        <argument name="at_code" xsi:type="string">name</argument>
                        <argument name="css_class" xsi:type="string">product</argument>
                        <argument name="at_label" xsi:type="string">none</argument>
                        <argument name="add_attribute" xsi:type="string">itemprop="name"</argument>
                    </arguments>
                </block>
                <container name="product.bottom.attributes" label="Product bottom attributes" after="product.info.name" htmlTag="div" htmlClass="row no-margin">
                    <container htmlTag="div" htmlClass="col s12 m12 l12 no-padding">
                        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.shortDescription" template="Magento_Catalog::product/view/attribute.phtml">
                            <arguments>
                                <argument name="at_call" xsi:type="string">getShortDescription</argument>
                                <argument name="at_code" xsi:type="string">short_description</argument>
                                <argument name="css_class" xsi:type="string">overview</argument>
                                <argument name="at_label" translate="true" xsi:type="string">none</argument>
                                <argument name="title" translate="true" xsi:type="string">Overview</argument>
                                <argument name="add_attribute" xsi:type="string">itemprop="description"</argument>
                            </arguments>
                        </block>
                        <!--<block class="<Vendor>\<Custom_Module>\Block\Iconografie" name="product.iconografie" template="<Vendor>_<Custom_Module>::iconografie.phtml"/>-->
                    </container>
                </container>
                <container name="product.buy.box" label="Product buy box" after="product.bottom.attributes" htmlTag="div" htmlClass="row no-margin">
                    <container htmlTag="div" htmlClass="col s12 m12 l12 no-padding">

                        <block class="Magento\Catalog\Block\Product\View\Type\Simple" name="product-stock" template="Magento_Catalog::product/view/type/default.phtml"/>

                        <block class="Magento\Catalog\Block\Product\View" name="product.info" template="product/view/form.phtml" after="alert.urls">

                            <container name="product.info.form.content" as="product_info_form_content">
                                <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/>
                            </container>
                            <block class="Magento\Framework\View\Element\Template" name="product.info.form.options" as="options_container">
                                <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml">
                                    <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
                                        <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
                                    </block>
                                    <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
                                </block>
                                <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="product/view/options/wrapper/bottom.phtml">
                                    <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="product/view/addtocart.phtml"/>
                                </block>
                            </block>
                        </block>
                    </container>
                </container>
                <container name="container-rassicuration" label="Container rassicuration" as="container-rassicuration" after="-" htmlTag="div" htmlClass="row no-margin">
                    <block class="Magento\Framework\View\Element\Template" name="rassicuration" template="Magento_Catalog::product/rassicurazioni.phtml"/>
                </container>
            </container>
        </container>
        <container name="content-bottom" label="Content bottom" htmlTag="div" htmlClass="row no-margin light2-grey" before="product-details">

            <block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">
                <arguments>
                    <argument name="type" xsi:type="string">related</argument>
                </arguments>
            </block>
            <referenceBlock name="product.info.upsell" remove="true"/>

            <block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional" as="product_additional_data"/>
        </container>
        <container name="product-details" label="Product details" as="product-details" after="product-wrapper" htmlTag="div" htmlClass="row no-margin details-row">
            <block class="Magento\Catalog\Block\Product\View" name="details-block" template="Magento_Catalog::product/view/details.phtml"/>
        </container>
        <container name="product-videos" label="Product videos" as="product-videos" htmlTag="div" htmlClass="row no-margin white">

        </container>
        <referenceContainer name="product.info.main" remove="true"/>
    </referenceContainer>
    <referenceBlock name="product.info.details" remove="true"/>
    <referenceContainer name="content.aside">

    </referenceContainer>
    <referenceBlock name="product.info.addtocart">
        <block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons"/>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <block class="Magento\Catalog\Block\ShortcutButtons\InCatalog" name="addtocart.shortcut.buttons.additional"/>
    </referenceBlock>
</body></page>
  • Have you found any solution for this issue? – Jalpesh Patel Jan 10 '17 at 17:29
  • I found an alternative soluction, I enabled product link with category path (root/category_url_key/product_url_key.html) and It works, but I'd prefer to use the standard (root/product_url_key.html) – 3tech - Alessandro Staffolani Jan 11 '17 at 8:12
  • Alessandro, does your solution fix the exceptions in the log file (exception.log)? I'm getting the same exceptions, but I can already access my products directly. [link] magento.stackexchange.com/questions/158653/… – Jason Feb 8 '17 at 5:17

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.