Hi!
I'm using v1.0.8.20
I'm trying to add php code on shipping info_pages, beacuase on august only open in the morning and I usually use a php code to auto change august timetable, but now I can't
How can I use php code inside info_pages?
Thanks in advance.
1.0.8.20 - info_pages - add php code
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Has thanked: 38 times
- Been thanked: 102 times
Re: 1.0.8.20 - info_pages - add php code
You could put the php in a hook and inject the html by JavaScript.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
Re: 1.0.8.20 - info_pages - add php code
Hi @raiwa
Thanks for your idea, I'm trying to edit directly if is possible, if not, I will use a str_replace inside the file, I think it's easy to find the change in future.
Thanks for your idea, I'm trying to edit directly if is possible, if not, I will use a str_replace inside the file, I think it's easy to find the change in future.
-
- Lead Developer
- Posts: 2423
- Joined: Tue Oct 29, 2019 9:37 am
- : Buy Me A Beverage
- Has thanked: 49 times
- Been thanked: 137 times
Re: 1.0.8.20 - info_pages - add php code
Other options;
You could make a module that displays only on the relevant page (shipping), then install the module in the usual way.
Or
An other option is to drop a copy of /templates/default/includes/pages/info.php
into the overide template or whichever template you are using, then put some hardcode into it.
You could make a module that displays only on the relevant page (shipping), then install the module in the usual way.
Or
An other option is to drop a copy of /templates/default/includes/pages/info.php
into the overide template or whichever template you are using, then put some hardcode into it.
Gamechanger Addon: Queued Emails, try before you buy.
Re: 1.0.8.20 - info_pages - add php code
Hi @burt
Thanks for your ideas, actually I use your second option, the first option isn't possible, shipping, privacy and conditions aren't modular, I try it all the morning without results.
Those pages don't have $Template->get_content('modular_page')
Thanks for your ideas, actually I use your second option, the first option isn't possible, shipping, privacy and conditions aren't modular, I try it all the morning without results.
Code: Select all
$page = info_pages::get_page([
'p.slug' => 'shipping',
'pd.languages_id' => (int)$_SESSION['languages_id'],
]);
$breadcrumb->add($page['pages_title'], $Linker->build('shipping.php'));
require $Template->map('template_top.php', 'component');
?>
<h1 class="display-4"><?= $page['pages_title'] ?></h1>
<?= $page['pages_text'] ?>
<div class="buttonSet">
<div class="text-right"><?= new Button(IMAGE_BUTTON_CONTINUE, 'fas fa-angle-right', 'btn-light btn-block btn-lg', [], $Linker->build('index.php')) ?></div>
</div>
<?php
require $Template->map('template_bottom.php', 'component');
?>
Code: Select all
$breadcrumb->add(NAVBAR_TITLE, $Linker->build('account.php'));
require $Template->map('template_top.php', 'component');
if ($messageStack->size('account') > 0) {
echo $messageStack->output('account');
}
?>
<div class="row"><?= $Template->get_content('account') ?></div>
<?php
require $Template->map('template_bottom.php', 'component');
?>
-
- PhoenixCart Developer
- Posts: 1184
- Joined: Sat Dec 21, 2019 8:08 am
- : Buy Me A Beverage
- Has thanked: 38 times
- Been thanked: 102 times
Re: 1.0.8.20 - info_pages - add php code
Place a copy of the page into the override template and add the content call there, or directly the modification you wish to add.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
- zipurman
- PhoenixCart Developer
- Posts: 470
- Joined: Tue Oct 13, 2020 5:20 pm
- : Buy Me A Beverage
- Has thanked: 84 times
- Been thanked: 147 times
Re: 1.0.8.20 - info_pages - add php code
zipurman
aka Preston Lord
-----------
Happy to help where I can
https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
aka Preston Lord
-----------
Happy to help where I can
https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Re: 1.0.8.20 - info_pages - add php code
Thanks Rainer, I just place the overrided file, I think it's more easy.
Thanks for you addon, I save for the futurezipurman wrote: ↑Thu Jun 08, 2023 11:21 pm You can also use my shortcodes addon for this.
app.php/addons/free_addon/shortcodes_hook/