Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store Address format in transactional email footer is hardcoded #6538

Closed
heldchen opened this issue Sep 8, 2016 · 1 comment
Closed

Store Address format in transactional email footer is hardcoded #6538

heldchen opened this issue Sep 8, 2016 · 1 comment

Comments

@heldchen
Copy link
Contributor

heldchen commented Sep 8, 2016

Preconditions

  1. CE 2.1.1

Steps to reproduce

  1. try to customise the address format in the mail footer

Expected result

  1. you can customise the address format in the mail footer, for example putting the zip code in front of the city, as used in some European countries

Actual result

  1. you cannot (easily) customise the address format as it is hardcoded:
   /**
     * Format address in a specific way
     *
     * @param DataObject $storeInfo
     * @param string $type
     * @return string
     */
    public function format(DataObject $storeInfo, $type = 'html')
    {
        $this->eventManager->dispatch('store_address_format', ['type' => $type, 'store_info' => $storeInfo]);
        $address = $this->filterManager->template(
            "{{var name}}\n{{var street_line1}}\n{{depend street_line2}}{{var street_line2}}\n{{/depend}}"
            . "{{var city}}, {{var region}} {{var postcode}},\n{{var country}}",
            ['variables' => $storeInfo->getData()]
        );

        if ($type == 'html') {
            $address = nl2br($address);
        }
        return $address;
    }

sure, we could use an interceptor and completely forgo the current implementation, but really? at the least please add the template string into the event so it could be manipulated in an observer...

@piotrekkaminski
Copy link
Contributor

Thank you for your submission.

We recently made some changes to the way we process GitHub submissions to more quickly identify and respond to core code issues.

Feature Requests and Improvements should now be submitted to the new Magento 2 Feature Requests and Improvements forum (see details here).

We are closing this GitHub ticket and have moved your request to the new forum.

mmansoor-magento pushed a commit that referenced this issue Jan 26, 2021
MC-40472:  Sync php8 branches with 2.4 branches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants