Notice removed Draw attention by Holly
    Bounty Ended with Rakesh Jesadiya's answer chosen by Holly
6 added 11 characters in body
source | link

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains thisitem data like below:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains item data like below:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol
    Tweeted twitter.com/StackMagento/status/862193853935341570
5 added 4 characters in body; edited tags
source | link

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol
    Notice added Draw attention by Holly
    Bounty Started worth 50 reputation by Holly
4 added 10 characters in body
source | link

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

HowIn my theme, how can I override thisthe current price value in my themeused, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

How can I override this price value in my theme to display the line item price instead?

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol

In the Magento 2 mini cart I would like to display the line item subtotal rather than unit price.

So in the example below the price in the minicart should be $90 because I've added two watches to the cart.

enter image description here

I see this Magento displays this price from a KnockoutJS template

app/code/Magento/Checkout/view/frontend/web/template/minicart/item/default.html

with this piece of code:

<!-- ko foreach: $parent.getRegion('priceSidebar') -->
    <!-- ko template: {name: getTemplate(), data: item.product_price, as: 'price'} --><!-- /ko -->
<!-- /ko -->

The item object contains this data:

canApplyMsrp:false
is_visible_in_site_visibility:true
item_id:"155"
product_has_url:true
product_id:"2"
product_image:Object
product_name:"Test Product"
product_price:"↵↵    <span class="price-excluding-tax" data-label="Excl. Tax">↵            <span class="minicart-price">↵            <span class="price">$45.00</span>        </span>↵↵        </span>↵"
product_price_value:30
product_sku:"01002"
product_type:"simple"
product_url:"http://dev.example.com/test-product.html"
qty:2

In my theme, how can I override the current price value used, product_price, to display the line item sub-total price instead? Properly formatted with the correct currency symbol.

So far I've tried the below:

<!-- ko template: {name: getTemplate(), data: item.product_price * item.qty, as: 'price'} --><!-- /ko -->  // returns a NaN

<!-- ko template: {name: getTemplate(), data: item.product_price_value * item.qty, as: 'price'} --><!-- /ko -->  // returns the correct price but without the currency symbol
3 added 768 characters in body
source | link
2 added 166 characters in body
source | link
1
source | link