You shouldn't need to add that. PHP files do not require a ?> at the end - in fact, revised core Zen Cart files are often also changed to remove the ?>. No idea why adding it back would make a difference.
For the quotes, you're rightPHP works fine simply embedded in javascript, but its result, unlike in HTML output, needs to be enclosed in quotes so js can handle it properly as a string and not try to treat it as a variable or something else. In researching your question, I came across a method (using json_encode() ) that should also avoid possible escaping issues, allowing end users to incorporate various quotes and symbols in the description without breaking javascript. I'll test that out and resubmit, with a real improvement instead of just a bugfix.
In the meantime, adding quotes around the PHP or else just embedding text directly will work.


PHP works fine simply embedded in javascript, but its result, unlike in HTML output, needs to be enclosed in quotes so js can handle it properly as a string and not try to treat it as a variable or something else. In researching your question, I came across a method (using json_encode() ) that should also avoid possible escaping issues, allowing end users to incorporate various quotes and symbols in the description without breaking javascript. I'll test that out and resubmit, with a real improvement instead of just a bugfix.
Reply With Quote
