если вы хотите добавить свой пользовательский атрибут в сводку заказа, вы должны переопределить: (Layouts) 1) checkout_cart_index:
<referenceBlock name="checkout.cart.totals">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="block-totals" xsi:type="array">
<item name="children" xsi:type="array">
<item name="processingfee" xsi:type="array">
<item name="component" xsi:type="string">Dedicated_Processingfee/js/view/checkout/cart/totals/processingfee</item>
<item name="sortOrder" xsi:type="string">20</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Dedicated_Processingfee/checkout/cart/totals/processingfee</item>
<item name="title" xsi:type="string" translate="true">Processing Fee</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
2) checkout_index_index:
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="children" xsi:type="array">
<item name="sidebar" xsi:type="array">
<item name="children" xsi:type="array">
<item name="summary" xsi:type="array">
<item name="children" xsi:type="array">
<item name="totals" xsi:type="array">
<item name="children" xsi:type="array">
<item name="processingfee" xsi:type="array">
<item name="component" xsi:type="string">Dedicated_Processingfee/js/view/checkout/cart/totals/processingfee</item>
<item name="sortOrder" xsi:type="string">20</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Dedicated_Processingfee/checkout/cart/totals/processingfee</item>
<item name="title" xsi:type="string" translate="true">Processing Fee</item>
</item>
</item>
</item>
</item>
<item name="cart_items" xsi:type="array">
<item name="children" xsi:type="array">
<item name="details" xsi:type="array">
<item name="children" xsi:type="array">
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">Magento_Tax/js/view/checkout/summary/item/details/subtotal</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
3) sales_order_view:
<referenceContainer name="order_totals">
<block class="Dedicated\Processingfee\Block\Sales\Order\ProcessingFee" name="processingfee"/>
</referenceContainer>
затем добавьте пользовательский js, чтобы получить свой собственный атрибут, например, в своем модуле: at /view/frontend/web/js/view/checkout/cart/totals/processingfee.js:
define(
[
'Dedicated_Processingfee/js/view/checkout/summary/processingfee'
],
function (Component) {
'use strict';
return Component.extend({
/**
* @override
*/
isDisplayed: function () {
return true;
}
});
}
);
добавьте еще js для вычисления значения с общей суммой выставления счетов в: /view/frontend/web/js/view/checkout/summary/processingfee.js
define(
[
'Magento_Checkout/js/view/summary/abstract-total',
'Magento_Checkout/js/model/quote',
'Magento_Catalog/js/price-utils',
'Magento_Checkout/js/model/totals'
],
function (Component, quote, priceUtils, totals) {
"use strict";
return Component.extend({
defaults: {
isFullTaxSummaryDisplayed: window.checkoutConfig.isFullTaxSummaryDisplayed || false,
template: 'Dedicated_Processingfee/checkout/summary/processingfee'
},
totals: quote.getTotals(),
isTaxDisplayedInGrandTotal: window.checkoutConfig.includeTaxInGrandTotal || false,
isDisplayed: function() {
return this.isFullMode();
},
getValue: function() {
var price = 0;
if (this.totals()) {
price = totals.getSegment('processingfee').value;
}
return this.getFormattedPrice(price);
},
getBaseValue: function() {
var price = 0;
if (this.totals()) {
price = this.totals().base_fee;
}
return priceUtils.formatPrice(price, quote.getBasePriceFormat());
}
});
}
);
Этот набор вы найдете вам атрибут со значением Спасибо :)