Address Layout in Module

Open to all! Ask other shopowners for help.
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Address Layout in Module

Post by Fiber »

I have installed 1.0.9.3 and am busy configuring the payment methods. What I now notice with the standard money order is that the details of the Shop are there, which is good of course, but not in the way I think it should be, namely neatly arranged and not on 1 line,
Image
so then I think ohh then I do a br at Store address in admin
Image
but then it looks good at money order but not in the footer at store details..
Image
Make payable to: not filled in yet..
Turn up the Max


Join The Code Co-op to get access to your library in the Code Co-op Forum
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Bug Hunt!

Post by ecartz »

Fiber wrote: Tue Jun 11, 2024 11:09 am but then it looks good at money order but not in the footer at store details..
While it might make sense for us to make it display the same in both places, I think that you might be able to work around it by putting in a <br> without a carriage return.

Test Store<br />1234 Fake Dr<br />Test, OH 44444<br />Bank: 0123456789
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Re: Bug Hunt!

Post by Fiber »

ecartz wrote: Tue Jun 11, 2024 12:10 pm While it might make sense for us to make it display the same in both places,
Yep :)
I think that you might be able to work around it by putting in a <br> without a carriage return.

Test Store<br />1234 Fake Dr<br />Test, OH 44444<br />Bank: 0123456789
If I do that, see pictures...

Image
Image
Turn up the Max
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

Re: Bug Hunt!

Post by ecartz »

Fiber wrote: Tue Jun 11, 2024 1:06 pm If I do that, see pictures...
Did you copy and paste what I wrote? I think that the forum converted < into &lt; and > into &gt; -- if you convert them back (manually, by typing in the text box), I think it would work.
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Re: Bug Hunt!

Post by Fiber »

ecartz wrote: Tue Jun 11, 2024 1:10 pm Did you copy and paste what I wrote? I think that the forum converted < into &lt; and > into &gt; -- if you convert them back (manually, by typing in the text box), I think it would work.
No i did just typing, i did it just again just to be sure.. same result..
Turn up the Max
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: 🐞 Bug Hunt! 🐞

Post by burt »

In the payment module;

Code: Select all

public function confirmation() {
      return [
        'title' => sprintf(MODULE_PAYMENT_MONEYORDER_TEXT_CONFIRMATION,
                           (self::get_constant('MODULE_PAYMENT_MONEYORDER_PAYTO') ?? ''),
                           STORE_NAME, STORE_ADDRESS),
      ];
    }
to

Code: Select all

public function confirmation() {
      return [
        'title' => sprintf(MODULE_PAYMENT_MONEYORDER_TEXT_CONFIRMATION,
                           (self::get_constant('MODULE_PAYMENT_MONEYORDER_PAYTO') ?? ''),
                           STORE_NAME, nl2br(STORE_ADDRESS)),
      ];
    }
please report back if this solves it?
I am not here to build for you.
I am here to build with you. Let's help each other.
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Re: Bug Hunt!

Post by Fiber »

burt wrote: Tue Jun 11, 2024 5:39 pm

Code: Select all

                           STORE_NAME, nl2br(STORE_ADDRESS)),
 
please report back if this solves it?
Yep, it's good now... ty

@Just looked at the order confirmation email and now it is not listed correctly there.
mail.png
You do not have the required permissions to view the files attached to this post.
Turn up the Max
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: 🐞 Bug Hunt! 🐞

Post by burt »

I don't know what your code now looks like.
Do you have <br> in the address input? If yes, remove.
I am not here to build for you.
I am here to build with you. Let's help each other.
Fiber
Contributor
Posts: 173
Joined: Mon Oct 26, 2020 12:16 pm
Phoenix Version: v1.1.0.6
Has thanked: 17 times
Been thanked: 27 times

Re: Bug Hunt!

Post by Fiber »

burt wrote: Wed Jun 12, 2024 11:05 am I don't know what your code now looks like.
Do you have <br> in the address input? If yes, remove.
No, I haven't
It happened after I added the previous nl2br, I still played with email options in admin from LF and CRLF with LF it is fine, but I then see this in the header of the email

--=_068da915d5c882f52988f070b0421b62
Content-Type: text/plain; charset="utf-8"
Content Transfer Encoding: 7bit

and under the email is the source code of the email, If set it to CRLF then the break again..
Turn up the Max
ecartz
Core Team
Posts: 3084
Joined: Tue Nov 05, 2019 6:02 pm
Phoenix Version:
Has thanked: 4 times
Been thanked: 208 times

🐞 Bug Hunt! 🐞

Post by ecartz »

Change https://github.com/CE-PhoenixCart/Phoen ... 1-L144C137 to

Code: Select all

      $text = strip_tags(html_entity_decode(preg_replace("{<br[^>]*>\r?\n?}gi", $this->lf, $email_text), ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML5, $this->build_params['text_charset']));
Text emails strip out the br tags.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply