1.0.8.20 - info_pages - add php code

Ask the community for help and support.
Post Reply
PiLLaO
Posts: 12
Joined: Thu Nov 05, 2020 9:28 pm
Has thanked: 14 times
Been thanked: 1 time

1.0.8.20 - info_pages - add php code

Post by PiLLaO »

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.
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Has thanked: 38 times
Been thanked: 102 times

Re: 1.0.8.20 - info_pages - add php code

Post by raiwa »

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
PiLLaO
Posts: 12
Joined: Thu Nov 05, 2020 9:28 pm
Has thanked: 14 times
Been thanked: 1 time

Re: 1.0.8.20 - info_pages - add php code

Post by PiLLaO »

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.
burt
Lead Developer
Lead Developer
Posts: 2423
Joined: Tue Oct 29, 2019 9:37 am
Has thanked: 49 times
Been thanked: 137 times

Re: 1.0.8.20 - info_pages - add php code

Post by burt »

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.
Gamechanger Addon: Queued Emails, try before you buy.
PiLLaO
Posts: 12
Joined: Thu Nov 05, 2020 9:28 pm
Has thanked: 14 times
Been thanked: 1 time

Re: 1.0.8.20 - info_pages - add php code

Post by PiLLaO »

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.

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');
?>
Those pages don't have $Template->get_content('modular_page')

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');
?>
raiwa
PhoenixCart Developer
PhoenixCart Developer
Posts: 1184
Joined: Sat Dec 21, 2019 8:08 am
Has thanked: 38 times
Been thanked: 102 times

Re: 1.0.8.20 - info_pages - add php code

Post by raiwa »

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
User avatar
zipurman
PhoenixCart Developer
PhoenixCart Developer
Posts: 470
Joined: Tue Oct 13, 2020 5:20 pm
Has thanked: 84 times
Been thanked: 147 times

Re: 1.0.8.20 - info_pages - add php code

Post by zipurman »

You can also use my shortcodes addon for this.

app.php/addons/free_addon/shortcodes_hook/
zipurman
aka Preston Lord
-----------
Happy to help where I can ;)

https://phoenixaddons.com
https://www.youtube.com/zipurman/ ** PHOENIX HOW-TO VIDEOS **
Image
PiLLaO
Posts: 12
Joined: Thu Nov 05, 2020 9:28 pm
Has thanked: 14 times
Been thanked: 1 time

Re: 1.0.8.20 - info_pages - add php code

Post by PiLLaO »

raiwa wrote: Thu Jun 08, 2023 12:01 pm Place a copy of the page into the override template and add the content call there, or directly the modification you wish to add.
Thanks Rainer, I just place the overrided file, I think it's more easy.
zipurman wrote: Thu Jun 08, 2023 11:21 pm You can also use my shortcodes addon for this.

app.php/addons/free_addon/shortcodes_hook/
Thanks for you addon, I save for the future
Post Reply