0

I found this page

vendor/magento/module-checkout/view/frontend/web/ template/summary/item/details.html

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->

<!-- ko foreach: getRegion('before_details') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<div class="product-item-details">

    <div class="product-item-inner">
        <div class="product-item-name-block">
            <strong class="product-item-name" data-bind="html: $parent.name"></strong>
            <div class="details-qty">
                <span class="label"><!-- ko i18n: 'Qty' --><!-- /ko --></span>
                <span class="value" data-bind="text: $parent.qty"></span>
            </div>
        </div>
        <!-- ko foreach: getRegion('after_details') -->
            <!-- ko template: getTemplate() --><!-- /ko -->
        <!-- /ko -->
    </div>

    <!-- ko if: (JSON.parse($parent.options).length > 0)-->
    <div class="product options" data-bind="mageInit: {'collapsible':{'openedState': 'active'}}">
        <span data-role="title" class="toggle"><!-- ko i18n: 'View Details' --><!-- /ko --></span>
        <div data-role="content" class="content">
            <strong class="subtitle"><!-- ko i18n: 'Options Details' --><!-- /ko --></strong>
            <dl class="item-options">
                <!--ko foreach: JSON.parse($parent.options)-->
                <dt class="label" data-bind="text: label"></dt>
                    <!-- ko if: ($data.full_view)-->
                    <dd class="values" data-bind="html: full_view"></dd>
                    <!-- /ko -->
                    <!-- ko ifnot: ($data.full_view)-->
                    <dd class="values" data-bind="html: value"></dd>
                    <!-- /ko -->
                <!-- /ko -->
            </dl>
        </div>
    </div>
    <!-- /ko -->
</div>
<!-- ko foreach: getRegion('item_message') -->
    <!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->

How do I find where this "text: $parent.qty" getting value from?

enter image description here

  • What's your product type? Is it simple, configurable or bundle? – Abhishek Panchal Jan 28 at 20:49
  • its bundle, want to get the bundle product correct qty – Paul Fan Jan 28 at 20:57
1

The data you are looking for 'QTY' on Checkout page. That comes by knockoutJS in Magento 2. Knockout basically bind data to HTML template and serves dynamic content.

If you can check "Application" Tab (F12), In Local Storage > Mage-Cache-Storage > Cart (Section Data) driven from Knockout. You can see QTY, Options and all other parameters there.

If you want to check QTY data, please check below file.

vendor\magento\module-checkout\CustomerData\DefaultItem.php

I hope that helps. Let me know if you have another questions regarding this.

| improve this answer | |
  • Hello, if I want to find the value of qty? where should I look into? <span class="value" data-bind="text: $parent.qty"></span>. I did change the value, From the F12, it show qty:123 , however the frontend not showing the same, unless I get the wrong parameter. – Paul Fan Jan 29 at 18:23
  • How did you change the value? Can you please explain in detail? – Abhishek Panchal Jan 29 at 18:26
  • I just hard code the return value. It did show at the value that I hard coded at cache-storage (F12), but the frontend still showing the old value. so I believe that "$parent.qty" is not referring the value at the Mage-Cache-Storage->cart->items-> qty...now I have no idea where I should trace where that qty come from. – Paul Fan Jan 29 at 18:37
  • What do you want with QTY? – Abhishek Panchal Jan 29 at 18:38
  • I found out that my bundle products QTY not display correctly there, it always show 1 item, however, order and details summary is correct. I am also using ewave "Configurable Products In Bundles" extension as well, want to see where it goes wrong, it just like counting 1 bundle product, instead of their real qty – Paul Fan Jan 29 at 18:46

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.