PDA

View Full Version : try to add php code to information pages



holdera
09-30-2013, 11:19 AM
I have tried adding php code to the admin | templates | information pages area both in the wysiwyg and in the "source" mode. both comment out all of my php by changing my
<?php tag to <!-- ?php.

I know the information page html is stored in the information table. so I edited the text directly there but it still doesn't work.

Any quick tips?

pgmarshall
09-30-2013, 12:48 PM
Unfortunately, it is not designed to take php code. What are you trying to add to the page? You can add conditional php into the information.php page and load it when the id = the page you want it on.

But as I say, it depends on what you want to do ...

Regards.

holdera
09-30-2013, 12:57 PM
all i want to do is load different text based on user login:


if ($customer_group_id = '0') {
include('./shipping_retail.php');
} else {
include('./shipping_wholesale.php');
}

holdera
09-30-2013, 12:58 PM
I have a few of these to do for different information pages. it worked in 2.0.3, but the text wasn't in the database then.

holdera
09-30-2013, 08:53 PM
ok I accomplished what I wanted as you suggested by conditionally setting $page_description in information.php although not how I would have preferred. But it's done and it works and I have to move on.

Thanks again pgmarshall.

pgmarshall
10-01-2013, 01:26 PM
It definitely make sense to add a show/hide function based on customer group for the information pages.

This way you could add two shipping details pages and hide one from Wholesale and the other from Retail - thereby allow customer_group control over information pages.

If you add this to the bugtracker I will code up a solution for osCmax.

Regards.

holdera
10-02-2013, 08:39 AM
It definitely make sense to add a show/hide function based on customer group for the information pages.

This way you could add two shipping details pages and hide one from Wholesale and the other from Retail - thereby allow customer_group control over information pages.

If you add this to the bugtracker I will code up a solution for osCmax.

Regards.

there is a customer group hide on Information pages. I just never thought to use it as you describe. That sounds like the perfect solution. I will try making matching pages and hiding the other group and see how it goes. I am somewhat disappointed I didn't think of that.