Create account and Info Pages

Open to all! Ask other shopowners for help.
Post Reply
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Create account and Info Pages

Post by Dan Cole »

I just updated my create account email so that it pulls it's template from info_pages. For the longest time I couldn't get it to work and then I realized I couldn't add the n_create_account.php file (which I updated to pull the file from info_pages) to my override directory. Although the n_create_account.php file is located on the shop side as a notifications module I assume it is considered an admin file and can't be overridden. Can anyone confirm that is the case? Just curious since it would be nice not to have to change the core file. I assume I'll need to do something similar with the other notification modules but at least I'm aware of that pitfall now.

Dan

Using php 8.1 and Phoenix 1.0.8.20,


Join The Code Co-op to get access to your library in the Code Co-op Forum
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Create account and Info Pages

Post by heatherbell »

Dan Cole wrote: Sun Aug 18, 2024 7:52 pmCan anyone confirm that is the case?
Not the case.
See - https://github.com/CE-PhoenixCart/Phoen ... ng#modules
otherwise see - https://github.com/CE-PhoenixCart/Phoen ... #templates
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Create account and Info Pages

Post by Dan Cole »

I figured it should work so I'll give it another go. Maybe tired eyes. Out of curiosity have you actually tried it with one of the notifications modules?

Dan
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Create account and Info Pages

Post by heatherbell »

Dan Cole wrote: Sun Aug 18, 2024 7:52 pmcouldn't add the n_create_account.php file to my override directory.
As described in the links posted, main module files, in this case n_create_account.php, cannot be overridden into a template, only the tpl_ and language files.
This works for notification modules the same as others, see Example 2 that I wrote here - https://phoenixcart.org/phoenixcartwiki ... a_Template
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Create account and Info Pages

Post by Dan Cole »

heatherbell wrote: Mon Aug 19, 2024 12:49 pm As described in the links posted, main module files, in this case n_create_account.php, cannot be overridden into a template, only the tpl_ and language files.
This works for notification modules the same as others, see Example 2 that I wrote here - https://phoenixcart.org/phoenixcartwiki ... a_Template
Thanks again and sorry to be a pest. Some days I'm as thick as a brick...this is now perfectly clear to me...
main module files, in this case n_create_account.php, cannot be overridden into a template, only the tpl_ and language files.
I was sure this worked but obviously I must have been overriding a tpl_ and/or a language file.

I get it now.

Dan
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Create account and Info Pages

Post by Dan Cole »

I finally found the time to get back to this and now have all of the notification modules pulling their email templates from info_pages. It makes text changes fairly simple and dresses up the emails so they can include images etc. For the moment I just edited the main module files but I may rework those changes to use hooks as I did in Phoenix 1.0.5.0. Now I just need to decide if that is worth the time and effort. Anyway I wanted to stick a fork in this thread for now.

BTW, can someone tell me why the main module files can't be overridden? That seems odd to me but I'm sure there is a good reason for it.

Dan
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Create account and Info Pages

Post by heatherbell »

Dan Cole wrote: Tue Sep 10, 2024 3:52 pmtell me why the main module files can't be overridden? That seems odd to me but I'm sure there is a good reason for it.
Don't know the answer and suspect that I wouldn't understand the answer if I had it.
Similarly to when I have to open the bonnet of a vehicle, or have to do electrical work, I'm amazed when I understand 'how' it works enough to fix it but satisfy myself with that without going further into 'why' it works or why it's made the way it is.

The way I explain it to myself in simplified terms because that is all I understand:
The Main file (generally/predominantly) 'creates' the module, handling what the module actually 'does' and is often dependent on other files in core (suspect that's why it can't be overridden).
The Template file (generally/predominantly) 'displays' the module, handling HTML, style and layout and usually only dependent on the Main file.
The Language file (generally/predominantly) handles the language elements.
Using 'generally/predominantly' because sometimes there seems to be overlap of what each file handles.
The facility to override the Template and Language files allows changes to how/what is displayed.
Changing the Main file might essentially change what the module 'does' which, strictly speaking, might make it a different module, hence, maybe, the advice to 'clone' the module to make another if changes to that file are required.

Do not accept anything here as a definitive answer as I've only replied as a thought exercise and to prompt correction whereby we might all learn.


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