This is a discussion on How to parse PHP inside product description within the osCMax v2 Customization/Mods forums, part of the osCMax v2.0 Forums category; I want to write a few custom PHP functions to make writing my item descriptions easier. However, when I tried ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| I want to write a few custom PHP functions to make writing my item descriptions easier. However, when I tried doing this the PHP isn't parsing. I made a file called: /includes/convert.php and am calling it from within the product description. I added a line near the top of /product_info.php that says: require('includes/convert.php'); However when I view the product page the call I made just shows up as a blank spot. Please advise. Thank you. Greg convert.php Code: <?php
function inch($in){
$cm=$in*2.54;
echo "$in\" ($cm cm)";
}
function cm($cm){
$in=$cm/2.54;
echo "$in\" ($cm cm)";
}
?>
Code: <?php inch('45') ?>
|
| Sponsored Links | ||
| ||
|
#2
| |||
| |||
| you make it bts compatible? |
|
#3
| |||
| |||
| I thought that inside BTS you should be allowed to use PHP freely. For example, inside your product description, it will not parse... <?php echo "hello"; ?> It will come up a blank page, and if you view source, you see <?php echo "hello"; ?> |
|
#4
| ||||
| ||||
| You can't put inline PHP into the product discription. As it is read into PHP as a variable and is outputed by PHP but is NOT processed BY PHP.... Its a raw read and write. IF you see <?php ..... ?> then you know that its NOT processed by php. |
|
#5
| |||
| |||
| bummer. So by the basic structure of OSCommerce, this isn't possible then. Well that just sucks now doesn't it. lol. I was hoping I could write simple tasks with php so my descriptions would be accurate. It seems however that this just isn't going to happen and I need to write static product description pages. So jpf...no way around this? Or should I just stop and move on to my next project. I think this is a unfixable roadblock by design. |
|
#6
| ||||
| ||||
| Add you PHP code to the product discription PAGE..... Not the discription. Suround it with an IF statement if you don't need it for all items....
__________________ JPF - osCMax Fourm Moderator Try out our osCMax at: Live Catalog Demo Limited access Admin: Live Admin Demo Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped! |
|
#7
| |||
| |||
| Quote:
Could you please elaborate? Thanks. |
| Sponsored Links | ||
| ||
| |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I am not getting no product description? | mtechama | osCMax v2 Installation issues | 4 | 11-04-2005 01:17 AM |
| No Product Description | Cisco | osCMax v2 Installation issues | 2 | 10-04-2005 08:55 AM |
| Product Description | mrwang | osCMax v1.7 Discussion | 2 | 01-12-2005 02:40 PM |
| edit product description | Anonymous | osCMax v1.7 Discussion | 1 | 06-24-2004 06:39 AM |
| Product Description | telsadek | osCommerce 2.2 Installation Help | 0 | 10-03-2003 11:06 PM |