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:
2nd step of the Checkout:
Here is my en_US.csv file in:
/public_html/app/design/frontend/Smartwave/porto/i18n
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):
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' ?
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:
- 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:
- 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'
- I ran the following:
SELECT * FROM abcd_translation
;
And it gave this response:
Live Production site.
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
- 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:
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>
<!--Hidden fields -->
<fieldset class="fieldset hidden-fields" data-bind="fadeVisible: isPasswordVisible">
<div class="field">
<label class="label" for="customer-password">
<span data-bind="i18n: 'Password'"></span>
</label>
<div class="control">
<input class="input-text"
placeholder="Password"
type="password"
name="password"
id="customer-password"
data-validate="{required:true}" autocomplete="off"/>
<span class="note" data-bind="i18n: 'You already have an account with us. Sign in or continue as guest.'"></span>
</div>
</div>
<!-- ko foreach: getRegion('additional-login-form-fields') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!-- /ko -->
<div class="actions-toolbar">
<input name="context" type="hidden" value="checkout" />
<div class="primary">
<button type="submit" class="action login primary" data-action="checkout-method-login"><span data-bind="i18n: 'Login'"></span></button>
</div>
<div class="secondary">
<a class="action remind" data-bind="attr: { href: forgotPasswordUrl }">
<span data-bind="i18n: 'Forgot Your Password?'"></span>
</a>
</div>
</div>
</fieldset>
<!--Hidden fields -->
</fieldset>
</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.