osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

How to parse PHP inside product description

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 ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax v2 Customization/Mods

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Closed Thread

 

LinkBack Thread Tools
  #1  
Old 02-13-2006, 02:20 AM
Active Member
 
Join Date: Oct 2004
Posts: 215
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 5
groggory
Default How to parse PHP inside product description

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)";
	}
?>
call from inside product description
Code:
<?php inch('45') ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
  #2  
Old 02-14-2006, 10:26 AM
Active Member
 
Join Date: Dec 2003
Posts: 110
Thanks: 0
Thanked 3 Times in 2 Posts
Rep Power: 5
Redeye_Joe
Default RE: How to parse PHP inside product description

you make it bts compatible?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #3  
Old 02-14-2006, 01:11 PM
Active Member
 
Join Date: Oct 2004
Posts: 215
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 5
groggory
Default RE: How to parse PHP inside product description

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"; ?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #4  
Old 02-14-2006, 05:33 PM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,788
Thanks: 5
Thanked 104 Times in 90 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default RE: How to parse PHP inside product description

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #5  
Old 02-14-2006, 08:35 PM
Active Member
 
Join Date: Oct 2004
Posts: 215
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 5
groggory
Default RE: How to parse PHP inside product description

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #6  
Old 02-17-2006, 06:10 AM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,788
Thanks: 5
Thanked 104 Times in 90 Posts
Rep Power: 12
jpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to alljpf is a name known to all
Default RE: How to parse PHP inside product description

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
  #7  
Old 02-17-2006, 01:27 PM
Active Member
 
Join Date: Oct 2004
Posts: 215
Thanks: 0
Thanked 2 Times in 2 Posts
Rep Power: 5
groggory
Default Re: RE: How to parse PHP inside product description

Quote:
Originally Posted by jpf
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....
I don't follow. Where is the product description page? I know there is product_info.php in the root, but I'm not sure what you are referring to.

Could you please elaborate?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Sponsored Links
Advertisement
Closed Thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -8. The time now is 01:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO
http://www.oscmax.com/forums/
Copyright 2008 osCMax