my issue is that a part of my shipping method label isn't properly traducted, so I would like to find where the label is generated.
This comes from native : src/vendor/magento/module-checkout/view/frontend/web/template/cart/shipping-rates.html
<label class="label" data-bind="attr: {for: 's_method_' + carrier_code + '_' + method_code}">
<!-- ko text: $data.method_title --><!-- /ko -->
<each args="element.getRegion('price')" render="" />
</label>
Doing some digging I found (There it's colissimo but it's the same function called for each delivery methods): src/app/code/Colissimo/Shipping/view/frontend/web/js/view/checkout/sidebar/pickup.js
getShippingMethodTitle: function () {
var shippingMethod;
if (!this.isCalculated()) {
return '';
}
if (!this.address()) {
return '';
}
shippingMethod = quote.shippingMethod();
return shippingMethod ? shippingMethod['carrier_title'] + ' - ' + shippingMethod['method_title'] : '';
}
quote.js is the native : src/vendor/magento/module-checkout/view/frontend/web/js/model/quote.js
And from this location I'm lost, it seems that the data i'm looking for is in this array but I don't know how to find where it's really added in the array.
Thanks for your help.
EDIT : src/app/code/Colissimo/Shipping/etc/config.xml
<?xml version="1.0"?>
<!--
/**
* Colissimo Shipping Module
*
* @author Magentix
* @copyright Copyright © 2020 Magentix. All rights reserved.
* @license https://www.magentix.fr/en/licence.html Magentix Software Licence
* @link https://colissimo.magentix.fr/
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<carriers>
<colissimo>
<active>0</active>
<model>Colissimo\Shipping\Model\Carrier\Colissimo</model>
<title>La Poste : Colissimo</title>
<specificerrmsg>This shipping method is not available. To use this shipping method, please contact us.</specificerrmsg>
<active_rma>1</active_rma>
<is_online>1</is_online>
<weight_calculation>per_cart</weight_calculation>
<homecl>
<active>0</active>
<name>Domicile sans signature</name>
<specificcountry>FR</specificcountry>
</homecl>
<homesi>
<active>0</active>
<name>Domicile avec signature</name>
<specificcountry>FR,BE,NL,DE,GB,LU,ES</specificcountry>
</homesi>
<pickup>
<active>0</active>
<name>Point de retrait</name>
<specificcountry>FR,BE,NL,DE,GB,LU,ES</specificcountry>
<open>1</open>
<apply_default>0</apply_default>
<default_city>Paris</default_city>
<default_postcode>75001</default_postcode>
<default_country>FR</default_country>
<map_type>osm</map_type>
<remove_selection>0</remove_selection>
</pickup>
<international>
<active>0</active>
<name>Expert International</name>
<specificcountry>DK,DE,IE,EL,ES,IT,LU,NL,AT,PL,PT,FI,SE,UK</specificcountry>
</international>
<domtomcl>
<active>0</active>
<name>Outre-Mer sans signature</name>
<specificcountry>GP,MQ,GF,RE,PM,YT,TF,WF,PF,NC,BL,MF</specificcountry>
</domtomcl>
<domtomsi>
<active>0</active>
<name>Outre-Mer avec signature</name>
<specificcountry>GP,MQ,GF,RE,PM,YT,TF,WF,PF,NC,BL,MF</specificcountry>
</domtomsi>
<domtomeco>
<active>0</active>
<name>Outre-Mer Eco</name>
<specificcountry>GP,MQ,GF,RE,PM,YT,TF,WF,PF,NC,BL,MF</specificcountry>
</domtomeco>
</colissimo>
</carriers>
</default>
</config>