Hi,
Is there a way to include a php code into a product description from the admin panel? It looks as including jscript works fine, but tags <?....?> are ignored.
Any suggestions?
Thanks
Hi,
Is there a way to include a php code into a product description from the admin panel? It looks as including jscript works fine, but tags <?....?> are ignored.
Any suggestions?
Thanks
I need to include a flash object with dynamic flashvars parameters. Instead of adding the code to each product description, it would be more elegant to include a call to a php function, which generates the flash structure
I could do it with jscript,, but would prefer php
You can not do that, because PHP is server side, so it is executed BEFORE sending to your browser. If you put it inside desc, it will be treated not as php code but just plain text.
There is one way to use php tho: in your product_info template file, you can put the php code there to echo the flash. (say if your product name is abc, then echo flash abc.swf, not so hard rite?)
I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me
No, i cannot do this. There is a single flash file, where I pass parameters (xml file) different for different products. In other words, each product has its own xml file, which is a variable for flash.
I can include the whole object code, but it would be easier to call it as a function of the passed variables.
I cannot understand your statement that " You can not do that, because PHP is server side". Of course, it should be done on a server side, but each product description is included by php include statement anyway
Your product description is saved into database, and when Zen display that product it does something like this:
echo $product_description; (just an example).
$product_description; is a string, and treated as so.
I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me
From "Similar Threads" at the bottom of this page:
http://www.zen-cart.com/forum/showthread.php?t=59826 ... see post #4
Or, since you're wanting to add a specific element common to all products, you could just alter your template to display the element where needed, and name your object based on the product id or model etc.
Or, you could add another field in the database to store specific object filename which you call separately, via the template.
It really depends on exactly what you want to accomplish.
Be careful not to think of the solution before you fully define the need/problem.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.