1
Magento 2.4.2-p1
Magento Porto theme

I use the default Magento check-out. I have gone into:

- Stores - Configuration - Advanced - Developer - Translate Inline - Enabled for Storefront = YES.

Then, I have gone through the check-out steps on the front end as follows:

  • open Magento front end
  • Add a product to the cart
  • Click on the icon of the Shopping bag on top right and GO TO CHECKOUT
  • The 1st of the 2 check-out steps load = Delivery Review & Payments DELIVERY ADDRESS
  • I click on the icon to change the text, the pop-up opens, I retype the text and click on SUBMIT (the first time, I have added the word Recipient's in front of all the fields here, for example 'Recipient's First Name')
  • Fill everything in
  • Click on NEXT
  • The 2nd of the 2 steps of the check-out loads = Review & Payments
  • Click in Credit Card
  • Untick 'My billing and shipping address are the same'
  • I once again click on the icon to change the text, the pop-up opens, I retype the text and click on SUBMIT (the first time, I have added the word 'Your' in front of all the fields here, for example 'Your First Name')

Afterwards, I ran the following:

php bin/magento setup:upgrade
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
bin/magento cache:clean translate

Now, both the DELIVERY and Billing addresses show exactly the SAME = it has the word YOUR in front of all the fields which we cannot have as the DELIVERY information is for the recipient NOT the person making the order as they are gifts.

I turned all Caches off, switched back from Varnish to Built-in Cache, Disabled Cache in Magento and deleted all Cache on the Magento Admin panel also. I deleted the Cache folder via FTP (var/Cache) but I am unable to put this back. I go through all the steps and remove the word YOUR which is now showing on all the lines of both Checkout steps, then run he commands up above but the word YOUR stays there and does not disappear.


Updated on November 7th, 2022:

This is what it looks like now and what I'm trying to change it to:

enter image description here

2nd step of the Checkout:

enter image description here

Here is my en_US.csv file in:

/public_html/app/design/frontend/Smartwave/porto/i18n

enter image description here


Further update:

I have changed the information in en_US.csv as follows but it makes NO difference on the front end (still shows Your First Name):

enter image description here


Updated again:

This is what it looks like when trying to In-line edit:

Why does the Original say: Your Last Name? Shouldn't it be 'Last Name' ?

enter image description here


Updated on November 8th, 2022:

I ran the SQL script as posted by Tu Van:

DELETE FROM `abcd_translation` WHERE `string` = 'Your First Name' OR  `string` = 'Your Last Name' OR  `string` = 'Your Middle Name/Initial' OR  `string` = 'Your Company'  OR  `string` = 'Your Street Address' OR  `string` = 'Your Country' OR  `string` = 'Your State/Province';

It gave the following response:

6 rows affected. (Query took 0.0016 seconds.) DELETE FROM abcd_translation WHERE string = 'Your First Name' OR string = 'Your Last Name' OR string = 'Your Middle Name/Initial' OR string = 'Your Company' OR string = 'Your Street Address' OR string = 'Your Country' OR string = 'Your State/Province'

I have then used a different browser where I deleted all Cache from All the time and Refreshed but the front end still shows on both the Delivery/Shipping Address and Billing Address:

Your First Name
Your Middle Name/Initial
Your Last Name
etc.

I also ran:

SELECT * FROM abcd_translation WHERE string LIKE 'Your %';

and it shows the following:

enter image description here

  1. The environment - I have enabled Development mode in order to be able to get into turning the In-line translations on.

The bounty is still not available. I will do the bounty tomorrow when it becomes available.


Reporting on the steps Tu Van updated:

  1. I ran the following in the database:

DELETE FROM abcd_translation WHERE string = 'Your Company' OR string = 'Your Street Address: Line 1' OR string = 'Your City' OR string = 'Your Zip/Postal Code' OR string = 'Your Phone Number';

It has given the following response:

5 rows affected. (Query took 0.0020 seconds.) DELETE FROM abcd_translation WHERE string = 'Your Company' OR string = 'Your Street Address: Line 1' OR string = 'Your City' OR string = 'Your Zip/Postal Code' OR string = 'Your Phone Number'

  1. I ran the following:

SELECT * FROM abcd_translation;

And it gave this response:

enter image description here

  1. Live Production site.

  2. I ran grep -r "Your First Name" app vendor in my root directory and this is what it gave me:

public_html]$ grep -r "Your First Name" app vendor app/design/frontend/Smartwave/porto/i18n/en_US.csv:Your First Name,"""First Name """

I have done all the steps above and the site still shows Your First Name, Your Last Name etc.


UPDATE for all who tried to help. Thank you very much. I was able to finally delete the 'Your' by running an SQL script as suggested by Tu Van in his post on this page:

DELETE FROM abcd_translation WHERE translate LIKE 'Your %';

This has returned this response:

10 rows affected. (Query took 0.0013 seconds.) DELETE FROM abcd_translation WHERE translate LIKE 'Your %'

And after clearing all Caches and running the following, the Your is now gone from the front end:

php bin/magento setup:upgrade
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento indexer:reindex
bin/magento cache:clean translate
php bin/magento cache:clean translate
bin/magento setup:static-content:deploy en_US -f

Something I have done in the course of troubleshooting this has, however, created 2 new problems in my Magento:

*1. When trying to update orders, I get the following Error:

The invoice can't be saved at this time. Please try again later.*

2. We have the Stripe extension from Amasty and we have 2 different Stripe accounts - one for each website/store. This worked fine for a long long time but now all orders from both stores are being billed to just 1 of the Payment Accounts.


Checking in the Admin panel of Magento, the primary store actually had the Publishable and Secret Key of of the 2nd store. I have no idea how that happened? When I removed that Publishable and Secret key and put in the correct one, it works correctly now = the payments go to correct Payment processor accounts. I am also no longer getting the 'The invoice can't be saved at this time. Please try again later' Error.



Removing 'Your' has been accomplished thanks to steps published by Tu Van.

Now moving to the ultimate goal of naming the Delivery/Shipping Address as 'Recipient's First Name', 'Recipient's Last Name' etc. and Billing address fields as 'Your First Name', 'Your Last Name' etc.

Phase 2.

Step 1.

I do not have the path mentioned first. The closest I get is:

/public_html/app/design/frontend/Smartwave/porto/Magento_Checkout/web/template

in here, I only have 1 folder and it's called minicart.

Next step then:

"If it does not exist, create a new one by copy the file vendor/magento/module-checkout/view/frontend/web/template/form/element/email.html"

For me, this was:

/public_html/vendor/magento/module-checkout/view/frontend/web/template/form/element

"to app/design/frontend///Magento_Checkout/web/template/form/element/email.html"

For me, this ends once again in:

/public_html/app/design/frontend/Smartwave/porto/Magento_Checkout/web/template

where the only folder was: minicart

I created the rest of the folders so it looked like this:

/public_html/app/design/frontend/Smartwave/porto/Magento_Checkout/web/template/form/element
  1. I modified the email.html file and uploaded to the folder above.

PART 2, Step 1:

I created this path:

/public_html/app/code/Vendor/Checkout

and placed the registration.php file in there.

Step 2: I created the following path:

and placed the module.xml file in there.

Step 3: I created di.xml file and once again placed in the following folder:

/public_html/app/code/Vendor/Checkout/etc

Step 4: I created the following directory structure:

/public_html/app/code/Vendor/Checkout/Plugin

and placed the ModifyCheckoutField.php file in there.

Step 5: I ran the following:

php bin/magento setup:upgrade
php bin/magento setup:di:compile 
php bin/magento setup:static-content:deploy -f

End result:

The Recipient's and Your on the address fields worked. The 'Your Email address' did not work - it still shows up as 'Email address'.


UPDATED on November 15th, 2022:

Here is the additional info for the Email address/Your Email address:

enter image description here

Not sure why the path is to Amazon_Payment? I do not have Amazon Payment.

Here is the code from the Response tab:

<!--
/**
 * Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
-->
<!-- ko foreach: getRegion('amazon-button-region') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->

<!-- ko ifnot: isCustomerLoggedIn() -->

<!-- ko foreach: getRegion('before-login-form') --> <!-- ko template: getTemplate() --><!-- /ko --> <!-- /ko --> <form class="form form-login" data-role="email-with-possible-login" data-bind="submit:login" method="post"> <fieldset id="customer-email-fieldset" class="fieldset" data-bind="blockLoader: isLoading"> <div class="field required"> <label class="label" for="customer-email"> <span data-bind="i18n: 'Email Address'"></span> </label> <div class="control _with-tooltip"> <input class="input-text" type="email" data-bind=" textInput: email, hasFocus: emailFocused" name="username" data-validate="{required:true, 'validate-email':true}" id="customer-email" /> <!-- ko template: 'ui/form/element/helper/tooltip' --><!-- /ko --> <span class="note" data-bind="fadeVisible: isPasswordVisible() == false"><!-- ko i18n: 'You can create an account after checkout.'--><!-- /ko --></span> </div> </div>

    &lt;!--Hidden fields --&gt;
    &lt;fieldset class=&quot;fieldset hidden-fields&quot; data-bind=&quot;fadeVisible: isPasswordVisible&quot;&gt;
        &lt;div class=&quot;field&quot;&gt;
            &lt;label class=&quot;label&quot; for=&quot;customer-password&quot;&gt;
                &lt;span data-bind=&quot;i18n: 'Password'&quot;&gt;&lt;/span&gt;
            &lt;/label&gt;
            &lt;div class=&quot;control&quot;&gt;
                &lt;input class=&quot;input-text&quot;
                       placeholder=&quot;Password&quot;
                       type=&quot;password&quot;
                       name=&quot;password&quot;
                       id=&quot;customer-password&quot;
                       data-validate=&quot;{required:true}&quot; autocomplete=&quot;off&quot;/&gt;
                &lt;span class=&quot;note&quot; data-bind=&quot;i18n: 'You already have an account with us. Sign in or continue as guest.'&quot;&gt;&lt;/span&gt;
            &lt;/div&gt;

        &lt;/div&gt;
        &lt;!-- ko foreach: getRegion('additional-login-form-fields') --&gt;
        &lt;!-- ko template: getTemplate() --&gt;&lt;!-- /ko --&gt;
        &lt;!-- /ko --&gt;
        &lt;div class=&quot;actions-toolbar&quot;&gt;
            &lt;input name=&quot;context&quot; type=&quot;hidden&quot; value=&quot;checkout&quot; /&gt;
            &lt;div class=&quot;primary&quot;&gt;
                &lt;button type=&quot;submit&quot; class=&quot;action login primary&quot; data-action=&quot;checkout-method-login&quot;&gt;&lt;span data-bind=&quot;i18n: 'Login'&quot;&gt;&lt;/span&gt;&lt;/button&gt;
            &lt;/div&gt;
            &lt;div class=&quot;secondary&quot;&gt;
                &lt;a class=&quot;action remind&quot; data-bind=&quot;attr: { href: forgotPasswordUrl }&quot;&gt;
                    &lt;span data-bind=&quot;i18n: 'Forgot Your Password?'&quot;&gt;&lt;/span&gt;
                &lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
    &lt;/fieldset&gt;
    &lt;!--Hidden fields --&gt;
&lt;/fieldset&gt;

</form> <!-- /ko -->


Second update on November 15th, 2022:

I was meant to copy

vendor/amzn/amazon-pay-module/view/frontend/web/template/form/element/email.html

to

app/design/frontend/Smartwave/porto_child/en_US/Amazon_Payment/template/form/element/email.html

and change Email to Your Email.

I have the first URL in my directory structure. I have downloaded and changed the email.html file.

The 2nd URL only exists up to:

/public_html/app/design/frontend/Smartwave/porto_child

I have created the other subdirectories, placed the file in there, done the clearing of the Cache, reindex, compile and deployed but still does not show on the front end.

Allysin
  • 250
  • 1
  • 23
  • 72
  • I had the same problem after upgrading to 2.4.3. What I needed to do was to change what needs to be translated directly in the DB or use the translation file under html/app/design/frontend/Smartwave/porto_child/i18n. – Jan-petter Havna Nov 07 '22 at 07:33
  • @Jan-petterHavna I went to the file path you specified and I don't have that last folder. I just have: etc, media, registration.php and theme.xml. How would I change it in here? And if that doesn't work, how would I change it in the database? – Allysin Nov 07 '22 at 11:12
  • Are you happy with starting a bounty for this issue? – Tu Van Nov 08 '22 at 01:03
  • @Tu Van - I will do! It tells me now: Question eligible for bounty in 9 hours. Just to reconfirm the current issue = it will NOT let me change the text anywhere with in-line translations. I can't even put it back to just what it says before = First Name, Last Name etc. – Allysin Nov 08 '22 at 14:50
  • I'm got your issue. I'm just asking for bounty because you recently raised questions (issues) but not feedback to the answerers to let them know and help other people who have the same issue to know whether your issue is resolved or not. – Tu Van Nov 08 '22 at 15:13

4 Answers4

1

And if you have not created a child theme you choose /smartwave/porto/i18n it should be there.

Do you use Porto_Child on your website?

  • No - I do not use Porto_Child. – Allysin Nov 07 '22 at 11:18
  • in /smartwave/porto/i18n, I have different items such as Column A: Your Checkout Progress, Card Verification Number, Items %1-%2 of %3, Regular Price etc. Column B: "Checkout Progress", "CVV", %3 items, "was"... but none of the First Name, Last Name etc. How to change that? – Allysin Nov 07 '22 at 11:22
  • So collum A is what you want to translate and collum B is what you what it to translate to. – Jan-petter Havna Nov 07 '22 at 11:35
  • So if you want to translate First Name to Recipient's first name you simply put first name to collum A and Recipients first name in collum B. Clear cache and have a look. Might be you need to renew the cache on your browser. So just do ctrl +Shift + r – Jan-petter Havna Nov 07 '22 at 11:44
  • Thank you for this. How would I differentiate between (delivery) First Name (the First Name that appears on our first step of check-out under Delivery with the (billing) First Name that appears on the 2nd Check-out step in the Payment section? Our customers always order gifts so the Delivery (Recipient's) First name will be different to the Billing (Your) First Name of the person making the order and paying for it. Ideally then, I would have Recipient's First name, Recipient's Last Name etc. on the 1st step and YOUR First Name, YOUR Last Name on the 2nd step. – Allysin Nov 07 '22 at 11:49
  • That will be in collum C and D, Not 100% sure what they are called. E.g. "Collum A = First Name" "Collum B = Recipients First Name" "Collum C = module" "Collum D magento_customer" (not 100% sure if that is the correct place for Collum D, is just for example) But if I remember correctly it should tell you when you use inline Translate where in Magento it is. – Jan-petter Havna Nov 07 '22 at 12:02
  • I don't understand that. Can I just at least change it back to First name, Last Name etc. by putting what it currently shows (Your First Name) in column A and 'First Name' in column B? Customers are placing orders and putting THEIR First name in the Delivery Address because it currently says: YOUR First Name. – Allysin Nov 07 '22 at 12:57
  • Could you show me an example or send me the url of your website so i can see for myself if posible? – Jan-petter Havna Nov 07 '22 at 12:59
  • I've uploaded additional pictures. I would think that the Shipping/Deliver Fist Name would have a different designation from Billing First Name so that people could give different labels to each? – Allysin Nov 07 '22 at 13:21
  • I will have a look at this in my stage environment today and see if can get translate those two differently. Do you use a 3rd party payment method or are you using a payment method from Magento? – Jan-petter Havna Nov 08 '22 at 07:53
  • I use Stripe Payments via the Stripe Payment app from Amasty. The issue now is that it will NOT let me change the text anywhere with in-line translations. I can't even put it back to just what it says before = First Name, Last Name etc. – Allysin Nov 08 '22 at 14:48
  • Could you check the i18n file under the Amasty folder? – Jan-petter Havna Nov 09 '22 at 07:34
  • The reason why I'm asking to check the translate file in Amasty, might be that that file has "your first name" in collum B. – Jan-petter Havna Nov 09 '22 at 10:46
1

I'll help you with 2 phases:

  • Phase 1: Revert your changes with inline translation with First Name, Last Name...
  • Phase 2: Translate your text as requested in the original post.

Phase 1:

  1. When doing inline translation on the checkout page, you don't need to (and SHOULD NOT) clear the cache because the checkout page does not cache, and don't need to run any commands, just hard reload (refresh) the browser.
  2. To revert your changes with inline translation with First Name, Last Name... run the following SQL query:
DELETE FROM `translation` WHERE `string` = 'Your First Name' OR  `string` = 'Your Last Name' OR  `string` = 'Your Middle Name/Initial' OR  `string` = 'Your Company'  OR  `string` = 'Your Street Address' OR  `string` = 'Your Country' OR  `string` = 'Your State/Province';
  1. Edit your post to add the result of the following SQL query to get records that contain 'Your ':
SELECT * FROM `translation` WHERE `string` LIKE 'Your %';
  1. Which environment (local/dev(test)/staging/production) you are doing this task in?

Update on November, 9th 2022:

  1. Run the following SQL query to remove existing "Your .." translation in your database:
DELETE FROM `translation` WHERE `string` = 'Your  Company' OR  `string` = 'Your Street Address: Line 1' OR  `string` = 'Your City' OR  `string` = 'Your Zip/Postal Code' OR  `string` = 'Your Phone Number';
  1. Run the following SQL query and add the result to your original question to let me know your total translation records at this time:
SELECT * FROM `translation`;
  1. For point 4 in the previous answer: "Which environment (local/dev(test)/staging/production) you are doing this task in?" I mean which environment you are working on, it can be local/dev(test)/staging site or production (live) site? Looks like you are doing this task on your production site, isn't it?
  2. Run the following command from your Magento root directory and put the result in your original question: grep -r "Your First Name" app vendor
  3. For the translation field labels in the delivery address and billing address, they use the same field, so you can't use the translation feature to change these labels. The solution for that is changing field labels. I'll write that solution soon.

Update on November, 9th 2022 part 2: Run the MySQL query to remove your inline translation for "Your ...":

DELETE FROM `translation` WHERE `translate` LIKE 'Your %';

Confirmed: Based on your previous SQL result, I confirm the above query is safe because you have a little inline translation at the moment and there are no translations related to Your ... except the checkout field labels. For others, please be careful with that query if you don't know your data in the translation table.

Update on November, 9th 2022 part 3

Phase 2: Change the delivery address field labels and the billing address field labels.

Your requirements is changing the delivery address field labels, the billing address field labels and they should be different labels (ie, the shipping field city label should different from the billing field city label).
Because these field labels use the same text so you can't use the translation feature, you should changing shipping and billing address field labels. Please take the following steps:

  1. Change the "Email Address" label:

Step 1:
** Case 1: For Magento version >= 2.4.4 which do not have Amazon_Payment module:**

Check if your theme has app/design/frontend/<Vendor>/<theme>/Magento_Checkout/web/template/form/element/email.html file or not. If it does not exist, create a new one by copy the file vendor/magento/module-checkout/view/frontend/web/template/form/element/email.html to app/design/frontend/<Vendor>/<theme>/Magento_Checkout/web/template/form/element/email.html

Case 2: For Magento version < 2.4.4 which have Amazon_Payment as build-in module or Magento version >= 2.4.4 installing Amazon_Payment as 3rd-party module:

Check if your theme has app/design/frontend/<Vendor>/<theme>/Amazon_Payment/web/template/form/element/email.html file or not.
If it does not exist, create a new one by copy the file vendor/amzn/amazon-pay-module/view/frontend/web/template/form/element/email.html to app/design/frontend/<Vendor>/<theme>/Amazon_Payment/web/template/form/element/email.html

Step 2. Open the file email.html mentioned in the above step to replace Email Address with Your Email Address.
Done.

Why don't I translate the text "Email Address" but override the html template file and change the text? It's because the text "Email Address" also appears in other places in Magento_Checkout module.

  1. Change the delivery address field labels and the billing address field labels.

You need to create a new custom module for that. Assume you named the vendor name Vendor, and the module name Checkout (You can change the vendor name and module name). Take the following steps:

Step 1: Create the registration.php file:
File path: app/code/Vendor/Checkout/registration.php

<?php

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Vendor_Checkout', DIR);

Step 2: Create the module.xml file:
File path: app/code/Vendor/Checkout/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Checkout">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
</config>

Step 3: Create di.xml file:
File path: app/code/Vendor/Checkout/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
        <plugin name="ModifyCheckoutField" type="Vendor\Checkout\Plugin\ModifyCheckoutField"/>
    </type>
</config>

Step 4: Create ModifyCheckoutField.php file.
File path: app/code/Vendor/Checkout/Plugin/ModifyCheckoutField.php

<?php
declare(strict_types=1);

namespace Vendor\Checkout\Plugin;

class ModifyCheckoutField { /** * Modify checkout field labels */ public function afterProcess( \Magento\Checkout\Block\Checkout\LayoutProcessor $subject, array $jsLayout ) { //Shipping Address if (isset( $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step'] ['children']['shippingAddress']['children']['shipping-address-fieldset']['children'] )) { $shippingAddressFieldset = &$jsLayout['components']['checkout']['children']['steps']['children'] ['shipping-step']['children'] ['shippingAddress']['children']['shipping-address-fieldset']['children']; $shippingAddressFieldset['firstname']['label'] = __('Recipient's First Name'); $shippingAddressFieldset['middlename']['label'] = __('Recipient's Middle Name/Initial'); $shippingAddressFieldset['lastname']['label'] = __('Recipient's Last Name'); $shippingAddressFieldset['suffix']['label'] = __('Recipient's Name Suffix'); $shippingAddressFieldset['company']['label'] = __('Recipient's Company'); $shippingAddressFieldset['street']['label'] = __('Recipient's Street Address'); $shippingAddressFieldset['street']['children'][0]['label'] = __('Recipient's Street Address: Line 1'); $shippingAddressFieldset['street']['children'][1]['label'] = __('Recipient's Street Address: Line 2'); $shippingAddressFieldset['country_id']['label'] = __('Recipient's Country'); $shippingAddressFieldset['region']['label'] = __('Recipient's State/Province'); $shippingAddressFieldset['region_id']['label'] = __('Recipient's State/Province'); $shippingAddressFieldset['city']['label'] = __('Recipient's City'); $shippingAddressFieldset['postcode']['label'] = __('Recipient's Zip/Postal Code'); $shippingAddressFieldset['telephone']['label'] = __('Recipient's Telephone Number'); $shippingAddressFieldset['fax']['label'] = __('Recipient's Fax'); $shippingAddressFieldset['vat_id']['label'] = __('Recipient's Tax/VAT Number'); }

    //Billing Address on payment method
    if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
        ['children']['payment']['children']['payments-list']['children'])) {
        $paymentList = $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
        ['children']['payment']['children']['payments-list']['children'];

        foreach ($paymentList as $key =&gt; $payment) {
            if (isset($payment['children']['form-fields']['children'])) {
                $paymentsListFormFields = &amp;$jsLayout['components']['checkout']['children']['steps']
                ['children']['billing-step']['children']['payment']['children']['payments-list']
                ['children'][$key]['children']['form-fields']['children'];
                $paymentsListFormFields = $this-&gt;getModifiedFormFieldLabels($paymentsListFormFields);
            }
        }
    }

    //Billing Address on payment page
    if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']
        ['children']['payment']['children']['afterMethods']['children'])) {
        if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children']
            ['payment']['children']['afterMethods']['children']['billing-address-form']['children']['form-fields']
            ['children'])) {
            $billingAddressFormFormFields = &amp;$jsLayout['components']['checkout']['children']['steps']['children']
            ['billing-step']['children']['payment']['children']['afterMethods']
            ['children']['billing-address-form']['children']['form-fields']['children'];
            $billingAddressFormFormFields = $this-&gt;getModifiedFormFieldLabels($billingAddressFormFormFields);
        }
    }

    return $jsLayout;
}

/**
 * @param $billingFormFields
 * @return array
 */
private function getModifiedFormFieldLabels($billingFormFields): array
{
    $billingFormFields['firstname']['label'] = __('Your First Name');
    $billingFormFields['middlename']['label'] = __('Your Middle Name/Initial');
    $billingFormFields['lastname']['label'] = __('Your Last Name');
    $billingFormFields['suffix']['label'] = __('Your Name Suffix');
    $billingFormFields['company']['label'] = __('Your Company');
    $billingFormFields['street']['label'] = __('Your Street Address');
    $billingFormFields['street']['children'][0]['label'] = __('Your Street Address: Line 1');
    $billingFormFields['street']['children'][1]['label'] = __('Your Street Address: Line 2');
    $billingFormFields['country_id']['label'] = __('Your Country');
    $billingFormFields['region']['label'] = __('Your State/Province');
    $billingFormFields['region_id']['label'] = __('Your State/Province');
    $billingFormFields['city']['label'] = __('Your City');
    $billingFormFields['postcode']['label'] = __('Your Zip/Postal Code');
    $billingFormFields['telephone']['label'] = __('Your Telephone Number');
    $billingFormFields['fax']['label'] = __('Your Fax');
    $billingFormFields['vat_id']['label'] = __('Your Tax/VAT Number');

    return $billingFormFields;
}

}

Step 5: Finally, run the setup:upgrade command to make your new module active, and then compile code, deploy static content:

bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f

Done.

Update on November, 11th 2022 part 1
Investigate why the Address Email text is not updated as expected.
Step 1: Go to the frontend, and add a product to cart.
Step 2: Open the Browser Developer Tool, choose Network tab, and enter email.html to filter (take a look at my screenshot below).
Go to the checkout page, and wait for the page to load finished, you may see a result in the Browser Developer Tool like the below screenshot. Take a screenshot like I did, then switch from Header tab to Response tab to copy the file content and add the screenshot and the file content to the original post. I'll check. enter image description here

Update on November, 16th 2022
Based on your information (screenshot), please take the following steps to replace Email Address with Your Email Address:

  1. Create app/design/frontend/Smartwave/porto_child/Amazon_Payment/web/template/form/element folder.

  2. Copy vendor/amzn/amazon-pay-module/view/frontend/web/template/form/element/email.html to app/design/frontend/Smartwave/porto_child/Amazon_Payment/web/template/form/element/email.html.

  3. Open the file email.html mentioned in the above step to replace Email Address with Your Email Address.

  4. Re-deploy static content for frontend. To do that, run the following commands:

rm -rf var/view_preprocessed/pub/static/frontend
rm -rf pub/static/frontend
bin/magento setup:static-content:deploy -f --area frontend

You are done, do not run other commands as they are not needed.

Tu Van
  • 6,868
  • 2
  • 11
  • 22
  • I have posted my answers to my original post. Thank you. – Allysin Nov 09 '22 at 00:02
  • Please check my updated answer. – Tu Van Nov 09 '22 at 11:37
  • I have posted a reply to your updated post in my original post. Thank you. – Allysin Nov 09 '22 at 16:50
  • Please check my updated answer about 5 min later. – Tu Van Nov 09 '22 at 16:59
  • Sorry Tu Van, I can't find it. I have done the steps you posted and it didn't help - website still showing Your First Name etc. I have posted all your steps and what showed up on the screen after running them. Can I edit this in the database itself? – Allysin Nov 09 '22 at 17:03
  • Let's wait, I'm writing the solution, which will be published in the next 2 mins. – Tu Van Nov 09 '22 at 17:07
  • I've updated the answer to removing Your before all fields. Please check. – Tu Van Nov 09 '22 at 17:10
  • When I tell you to run SELECT * FROM translation; that means I'm still debugging, not completing enough steps to fix your issue. But with the latest update, your issues with "Your ..." will be resolved. – Tu Van Nov 09 '22 at 17:16
  • Thank you very much - the Your is now gone indeed! Can I ask you something real quick please? Since I started messing with this, I now have 2 new problems: 1. An Error when trying to update invoices = X The invoice can't be saved at this time. Please try again later. and 2. I have 2 websites running on the same Magento install and they are both set up on different Stripe Accounts via the Stripe Payment extension from Amasty. Both are now billing into 1 Stripe card processing account as opposed to even yesterday each website/store was going into its own. Is this something I have done? – Allysin Nov 09 '22 at 17:31
  • Just let you know these do not real quick. Maybe answer you later. – Tu Van Nov 09 '22 at 17:37
  • Thank you Tu Van. I will be here. It's just I haven't really done anything other than trying to change the CSV file, ran the commands you have given me, and the usual php bin/magento setup:upgrade and php bin/magento setup:di:compile and php bin/magento setup:static-content:deploy -f and php bin/magento cache:clean and php bin/magento cache:flush and php bin/magento indexer:reindex and bin/magento cache:clean translate and php bin/magento cache:clean translate and bin/magento setup:static-content:deploy en_US -f but that never broke it like this before... – Allysin Nov 09 '22 at 17:41
  • Just to let you know: Checking in the Admin panel of Magento (in the Amasty Stripe extension), the primary store actually had the Publishable and Secret Key of of the 2nd store. I have no idea how that happened? When I removed that Publishable and Secret key and put in the correct one, it works correctly now = the payments go to correct Payment processor accounts. I am also NO LONGER getting the 'The invoice can't be saved at this time. Please try again later' Error. Hopefully it will be good from now on. – Allysin Nov 09 '22 at 18:55
  • Glad to hear these issues are resolved now. I've added the solution to change the delivery and billing address field labels. Please take a look and let me know if the issue is resolved or not. – Tu Van Nov 09 '22 at 22:07
  • Great job! You definitely deserve the bounty! Most of the things worked (the Recipient's in Delivery address and Your in Billing address). What did NOT work was to change the Email address heading to YOUR Email address. Not sure if it's something I have done wrong? I have detailed all of my steps in an update to my original post. Thank you. – Allysin Nov 10 '22 at 23:10
  • I am so sorry - I have no idea what happened! I kept coming here every day looking for your answer and did not see it until today even though you posted it days ago. I've done the investigative steps for Your Email address and added the info to my original post. If you would please take a look? Thank you. BTW - in your steps that helped to name the Recipient's and Your in front of the address fields, there are a few that are confused. I can fix this myself on mine but you may want to update your answer for people who will read this later. Thank you. – Allysin Nov 15 '22 at 21:34
  • Yep, I left an answer immediately after you updated your post. What makes you confused, could you tell me? Please copy vendor/amzn/amazon-pay-module/view/frontend/web/template/form/element/email.html to app/design/frontend/Smartwave/porto_child/en_US/Amazon_Payment/template/form/element/email.html and make the change like I said in my answer. – Tu Van Nov 15 '22 at 21:51
  • Sorry - I'm not confused. One of the lines in your ModifyCheckoutField.php got confused. It shows this: $shippingAddressFieldset['country_id']['label'] = __('Recipient's City'); and this: $billingFormFields['country_id']['label'] = __('Your City'); I am going to try the Your Email address modification now. Thanks. – Allysin Nov 15 '22 at 22:30
  • I have done this now but didn't have the full path to the 2nd URL you mentioned so I created the missing subdirectories and placed the email.html file in there but it does not seem to be working. I have updated my original post with more info. – Allysin Nov 15 '22 at 22:52
  • I've updated the typos for the Country field labels that you mentioned, thanks for letting me know. There is a mistake (typo) in my last comment, I missed the web folder and redundant the en_US folder (a typo mistake when looking at the generated file in the browser). Please check my updated answer to finish your task. – Tu Van Nov 16 '22 at 04:18
  • I am having a hard time with another issue. I can give you another 50 points if you are able to help please? The problem is documented here: https://magento.stackexchange.com/questions/361932/uncheck-my-billing-and-shipping-address-are-the-same-checkbox-by-default Thank you. – Allysin Nov 18 '22 at 12:15
  • Sure, I'll take a look. Earn more points is good but my wish is for your feedback to the answerers who answer your questions (issue) to let them know if their answer helps you or not and mark an answer as accepted if it works for you. That helps other people who have the same issue and come there later to know whether your issue is resolved or not and which is the correct solution. – Tu Van Nov 18 '22 at 12:31
  • 1
    I'm sorry - I know you are right. I will go through all of these when I get a chance and do that. – Allysin Nov 18 '22 at 12:35
  • That sound great! – Tu Van Nov 18 '22 at 12:37
  • I can't work with the Magento 2.4.2-p1 that I have anymore because of too many problems. I've set up a new Magento 2.4.5-p1 with the Multi Steps Checkout for Magento 2 Webkul Check-out: https://store.webkul.com/magento2-multi-steps-checkout.html How could I do the steps above (rename to Recipient Street etc. and Your Street etc.) considering I have this Check-out now installed? – Allysin Jan 28 '23 at 21:08
  • My steps above apply to Magento default checkout, your new checkout extension is modified Magento default checkout, so you need to apply the same to your new checkout extension. If you have coding experience, you can read their code to apply it. Unfortunately, your new extension is a paid extension, so you can't share their code publicly, so it's too hard for most people who want to help you with this one. – Tu Van Jan 29 '23 at 14:09
  • I suggest contacting your extension provider to ask for additional work (paid) based on their extension and your existing code which works on Magento default checkout. Tell them that you successfully changed the shipping address and billing address field name to Magento default checkout with this guide https://magento.stackexchange.com/questions/361508/in-line-translations-do-not-update-on-the-front-end?noredirect=1#comment502936_361577:~:text=in%20Magento_Checkout%20module.-,Change%20the%20delivery%20address%20field%20labels%20and%20the%20billing%20address%20field%20labels.,-You%20need%20to – Tu Van Jan 29 '23 at 14:15
0

you should have run the upgrade command setup:upgrade and also make sure that the module where you have defined the additional csv has an upgraded version so that the upgrade for the module triggers.

Oscprofessionals
  • 1,795
  • 9
  • 20
  • I ran these commands yesterday and once again today: php bin/magento setup:upgrade then php bin/magento setup:di:compile then php bin/magento setup:static-content:deploy -f This did not help - it still comes up as Your First Name, Your Last Name etc. everywhere. – Allysin Nov 09 '22 at 11:51
  • I tried changing this in: /public_html/app/design/frontend/Smartwave/porto/i18n We only have the Smartwave Porto theme and about 13 modules/extensions from Amasty. – Allysin Nov 09 '22 at 12:07
  • Try the following : Upgrade module using composer or you shall go into DB and check the setup upgrade table and change the version of the module you have modified to a lower version so that your upgrade command will result in csv related execution and then check the translation table if your new entry is there or not. – Oscprofessionals Nov 10 '22 at 09:32