0

Actually i am trying to show product name in quick view but here product name is not coming i added the code below for product name purpose here please check

<referenceBlock name="page.main.title">
                <arguments>
                    <argument name="css_class" xsi:type="string">product</argument>
                    <argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
                </arguments>
            </referenceBlock>

script_quickview_catalog_product_view.xml

  <!--BEGIN quickview MEDIA-->
  <container name="quickview_media" htmlTag="div" htmlClass="quickview-media product media" before="quickview_tabs_area">
    <block class="Magento\Catalog\Block\Product\View\Gallery" name="product.info.media.image" template="Script_QuickView::product/view/gallery.phtml"/>
  </container>
  <!--END quickview MEDIA-->

  <!--BEGIN quickview MAIN-->
  <container name="quickview_tabs_area" htmlTag="div" htmlClass="quickview-tabs" htmlId="quickview-tabs">
    <block class="Magento\Framework\View\Element\Template" name="quickview_tabs" template="Script_QuickView::quickview.tabs.phtml" before="-" >
      <!--MAIN-->
      <block name="product.info.main" class="Magento\Framework\View\Element\Template" template="Script_QuickView::quickview.content.phtml" group="quickview_tabs">
        <!-- <arguments>
          <argument translate="true" name="title" xsi:type="string">Main</argument>
          <argument name="html_id" xsi:type="string">quickview-info-main</argument>
          <argument name="html_class" xsi:type="string">product-info-main</argument>
        </arguments> -->

        <container name="product.info.price" label="Product info auxiliary container" htmlTag="div" htmlClass="product-info-price" after="product.info.review">
         <!--Product Name Purpose-->
            <referenceBlock name="page.main.title">
                <arguments>
                    <argument name="css_class" xsi:type="string">product</argument>
                    <argument name="add_base_attribute" xsi:type="string">itemprop="name"</argument>
                </arguments>
            </referenceBlock>

          <block class="Magento\Catalog\Pricing\Render" name="product.price.final" before="product.info.sku">
            <arguments>
              <argument name="price_render" xsi:type="string">product.price.render.default</argument>
              <argument name="price_type_code" xsi:type="string">final_price</argument>
              <argument name="zone" xsi:type="string">item_view</argument>
            </arguments>
          </block>
          <container name="product.info.stock.sku" label="Product auxiliary info" htmlTag="div" htmlClass="product-info-stock-sku">
            <container name="product.info.type" before="-" />
            <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.sku" template="Script_QuickView::product/view/attribute.phtml" after="product.info.type">
              <arguments>
                <argument name="at_call" xsi:type="string">getSku</argument>
                <argument name="at_code" xsi:type="string">sku</argument>
                <argument name="css_class" xsi:type="string">sku</argument>
                <argument name="at_label" xsi:type="string">default</argument>
                <argument name="add_attribute" xsi:type="string">itemprop="sku"</argument>
              </arguments>
            </block>
          </container>
        </container>

        <block class="Magento\Catalog\Pricing\Render" name="product.price.tier" after="product.info.price">
          <arguments>
            <argument name="price_render" xsi:type="string">product.price.render.default</argument>
            <argument name="price_type_code" xsi:type="string">tier_price</argument>
            <argument name="zone" xsi:type="string">item_view</argument>
          </arguments>
        </block>

        <container name="alert.urls" as="alert_urls" label="Alert Urls" after="product.price.tier"/>

        <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="Magento_Catalog::product/view/options/wrapper.phtml">
              <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="Magento_Catalog::product/view/options.phtml">
                <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" name="product.info.options.default" as="default" template="Magento_Catalog::product/view/options/type/default.phtml"/>
                <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" name="product.info.options.text" as="text" template="Magento_Catalog::product/view/options/type/text.phtml"/>
                <block class="Magento\Catalog\Block\Product\View\Options\Type\File" name="product.info.options.file" as="file" template="Magento_Catalog::product/view/options/type/file.phtml"/>
                <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" name="product.info.options.select" as="select" template="Magento_Catalog::product/view/options/type/select.phtml"/>
                <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" name="product.info.options.date" as="date" template="Magento_Catalog::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="Magento_Catalog::product/view/options/wrapper/bottom.phtml">
              <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="Magento_Catalog::product/view/addtocart.phtml"/>
            </block>
          </block>
        </block>

        <container name="product.info.extrahint" as="extrahint" label="Product View Extra Hint">
          <container name="product.info.social" label="Product social links container" htmlTag="div" htmlClass="product-social-links" after="product.info.overview">

          </container>
        </container>

        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.overview" template="product/view/attribute.phtml" group="detailed_info" after="product.info.extrahint">
          <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>
      <!--END MAIN-->
      <!-- DETAIL -->
      <block name="product.info.detail" class="Magento\Framework\View\Element\Template" template="Script_QuickView::quickview.content.phtml" group="quickview_tabs" after="-">
        <arguments>
          <argument translate="true" name="title" xsi:type="string">More Info</argument>
          <argument name="html_id" xsi:type="string">quickview-info-detail</argument>
          <argument name="html_class" xsi:type="string">product-info-detail</argument>
        </arguments>
        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Script_QuickView::product/view/details.phtml" >
          <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">
            <arguments>
              <argument name="at_call" xsi:type="string">getDescription</argument>
              <argument name="at_code" xsi:type="string">description</argument>
              <argument name="css_class" xsi:type="string">description</argument>
              <argument name="at_label" xsi:type="string">none</argument>
              <argument name="title" translate="true" xsi:type="string">Details</argument>
            </arguments>
          </block>

          <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="product/view/attributes.phtml" group="detailed_info">
            <arguments>
              <argument translate="true" name="title" xsi:type="string">More Information</argument>
            </arguments>
          </block>
        </block>
      </block>
      <!--END DETAIL-->
      <!--REVIEWS-->
    <!--   <block name="product.reviews" class="Magento\Framework\View\Element\Template" template="Script_QuickView::quickview.content.phtml" group="quickview_tabs" after="-">
        <arguments>
          <argument translate="true" name="title" xsi:type="string">Reviews</argument>
          <argument name="html_id" xsi:type="string">reviews</argument>
          <argument name="html_class" xsi:type="string">reviews</argument>
        </arguments>
        <referenceBlock name="require-cookie">
          <arguments>
            <argument name="triggers" xsi:type="array">
              <item name="submitReviewButton" xsi:type="string">.review .action.submit</item>
            </argument>
          </arguments>
        </referenceBlock>
        <block class="Magento\Review\Block\Product\Review" name="reviews" as="reviews" template="Magento_Review::review.phtml" group="detailed_info">
          <block class="Magento\Review\Block\Form" name="product.review.form" as="review_form">
            <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/>
            <arguments>
              <argument name="jsLayout" xsi:type="array">
                <item name="components" xsi:type="array">
                  <item name="review-form" xsi:type="array">
                    <item name="component" xsi:type="string">Magento_Review/js/view/review</item>
                  </item>
                </item>
              </argument>
            </arguments>
          </block>
        </block>
      </block> -->
      <!--END REVIEWS-->
    </block>
  </container>
</container>

<referenceContainer name="quickview_area">
  <block class="Magento\Framework\View\Element\FormKey" name="formkey"/>
  <block class="Magento\Catalog\Block\Product\View\Additional" name="product.info.additional" as="product_additional_data"/>
  <block class="Magento\Cookie\Block\RequireCookie" name="require-cookie" template="Magento_Cookie::require_cookie.phtml">
    <arguments>
      <argument name="triggers" xsi:type="array">
        <item name="compareProductLink" xsi:type="string">.action.tocompare</item>
      </argument>
    </arguments>
  </block>

  <block class="Magento\Catalog\Block\Product\View" name="product_button" after="-" template="Script_QuickView::product/view/button.phtml" />
</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>

<referenceContainer name="product.info.media">
  <block class="Magento\ProductVideo\Block\Product\View\Gallery" name="product.info.media.video" after="product.info.media.image" template="product/view/gallery.phtml"/>
</referenceContainer>

<referenceContainer name="product.info.extrahint">
  <block class="Magento\CatalogInventory\Block\Qtyincrements" name="product.info.extrahint.qtyincrements" template="qtyincrements.phtml"/>
</referenceContainer>
<referenceContainer name="quickview_modal" remove="true" />

1 Answer 1

0

Add below line in your xml after <container name="product.info.price" label="Product info auxiliary container".... tag

<block class="Magento\Catalog\Block\Product\View" name="product.name" template="Script_QuickView::product/view/name.phtml" before="-" />

Now add one name.phtml with below content in your module folder in above path and clear cache.

<div class="productNamePopup"><?php echo $this->getProduct()->getName(); ?></div>

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.