I am having problems with the address template, when I add a new client it adds fine, but when registering the addresses it does not do it correctly, it leaves all the instructions for this untranslated, example: Default Billing Address {{depend prefix}} {{var prefix}} {{/ depend}} {{depend middlename}} {{var middlename}} {{/ depend}} {{depend suffix}} {{var suffix}} {{ / depend}} {{depend firstname}} ...
I leave a screenshot enter image description here
-
The above solution seems to work by changing the value find in SQL query ,but we need to override this core file.vivek mehta– vivek mehta2022年04月26日 11:40:16 +00:00Commented Apr 26, 2022 at 11:40
2 Answers 2
A better solution (without any PHP files modifications):
SELECT s.attribute_set_id
INTO @id
FROM eav_attribute_set AS s
INNER JOIN eav_attribute_group AS g
ON g.attribute_set_id = s.attribute_set_id AND 2 = s.entity_type_id AND 'Default' = s.attribute_set_name
;
DELETE FROM eav_attribute_set WHERE 2 = attribute_set_id;
ALTER TABLE eav_attribute_group DROP FOREIGN KEY EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID;
ALTER TABLE eav_attribute_group
ADD CONSTRAINT EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID
FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set (attribute_set_id) ON DELETE CASCADE ON UPDATE CASCADE
;
UPDATE eav_attribute_set SET attribute_set_id = 2 WHERE @id = attribute_set_id;
UPDATE eav_entity_attribute SET attribute_set_id = 2 WHERE @id = attribute_set_id;
UPDATE eav_entity SET attribute_set_id = 2 WHERE @id = attribute_set_id;
Then flush the Magento's cache.
Ok I've solved this issue, maybe it could help someone else, I have to say that I had migrated from M-1.8.1 to M-2.4.0 so I dont know you, but when I did it I had problems with eav_attribute_set table and if you wanted to continous with the migration you had to change Default for Default_1, ..., Default_8 and after migrate all data, in this table you found new records into, well I ran this query in mySQL :
select * from eav_attribute_set as eas inner join eav_attribute_group as eag on eag.attribute_set_id=eas.attribute_set_id where eas.entity_type_id=2 and eas.attribute_set_name='Default';
I took the value of attribute_set_id and change the file vendor/module-customer/API/ AddressMetadataInterface.php there I changed const ATTRIBUTE_SET_ID_ADDRESS = 2 for ATTRIBUTE_SET_ID_ADDRESS = the value of attribute_set_id that I got in the previous step (in my case was 13)
and that's it
I know is not a good practice change files in magento core, so you should do it in your child theme.
Maybe you should read this https://github.com/magento/magento2/issues/5873