Page 1 of 4 123 ... LastLast
Results 1 to 10 of 34
  1. #1
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Confirmation: can't use php in Product Descriptions?

    I saw this mentioned about a year ago elsewhere here; I'm wondering if it's still true that you cannot use embedded php in Product Descriptions.

    Because, what is strange, is that this *does* work for the define pages. For example, for my main page, I simply have this:

    <?php include('MainPage.html'); ?>

    Then, I can work on the main page in DreamWeaver, and just upload it to the site instead of having to copy and paste it into the define pages main page area.

    Too bad it doesn't work for product descriptions. I was going to put them all in a folder and have them loaded dynamically. Then I could easily update them in DreamWeaver.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation: can't use php in Product Descriptions?

    If you search the forum for "boilerplate" you'll see some discussions and links to ways to alter your site's code for workarounds.
    .

    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.

  3. #3
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: Confirmation: can't use php in Product Descriptions?

    Thanks, but that's not what I'm looking for - I've seen that thread.

    I'm not looking to define boilerplate to include in each of many product descriptions.

    My product descriptions are extended HTML pages, with pictures, and HTML formatted text. They are all different. No boilerplate.

    I want each product description to be a separate page in Dreamweaver, that I can edit to my heart's content in a program made to do it, and then just "put" the file (upload to the site), and ZenCart automatically reflects the results of my edits.

    Here is a comparison of what I would like to do.

    Scenario 1 (if could use php include in Product Descriptions.):

    1. Edit product description in DreamWeaver.
    2. Upload to site (one click in DreamWeaver).
    3. View changes in browser.

    Scenario 2: (current situation)

    1. Edit product description in DreamWeaver.
    2. Copy Product Description.
    3. Open Product in ZenCart admin > Categories > Products.
    4. Paste in new description.
    5. Hit preview button.
    6. Hit OK.
    7. View changes in browser.

    Notice the difference in the number of steps? This becomes quite tedious, quite quickly, when working on complex product descriptions using CSS formatting.

    The BOILERPLATE workaround is not even applicable here.

    Why can you use php include in a Define Pages page, and not in a Product Description?
    Last edited by karma-lab; 15 Jun 2008 at 04:06 AM.

  4. #4
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Confirmation: can't use php in Product Descriptions?

    Why can you use php include in a Define Pages page, and not in a Product Description?
    In a nut shell.. Define pages are php pages, where product descriptions are stored in a database as text, not php pages.

    Somewhere down the line dreamweaver started working more with interpreters such as asp, php and databases like MySQL. Had to if it wanted to survive.. I jump from 4 to 8, so that's where I'm at. Dream 8 has the ability to use MySQL and php with live edits if you have a working server to access. The server can be on the internet or local. I've used it with Uniform Server, php5 and MySQL5, but for info, it's a pain to set up and just as flaky as normal for dreamweaver. The Adobe web site has info on setting it up.

    Not sure if you can edit product description, but something to try.
    Dave
    Always forward thinking... Lost my mind!

  5. #5
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation: can't use php in Product Descriptions?

    Quote Originally Posted by karma-lab View Post
    Here is a comparison of what I would like to do.

    Scenario 1 (if could use php include in Product Descriptions.):

    1. Edit product description in DreamWeaver.
    2. Upload to site (one click in DreamWeaver).
    3. View changes in browser.

    Scenario 2: (current situation)

    1. Edit product description in DreamWeaver.
    2. Copy Product Description.
    3. Open Product in ZenCart admin > Categories > Products.
    4. Paste in new description.
    5. Hit preview button.
    6. Hit OK.
    7. View changes in browser.

    Notice the difference in the number of steps?
    Not entirely correct.

    You forgot to include a couple important items:

    Scenario 1 (if could use php include in Product Descriptions.):
    1. Edit product description in DreamWeaver.
    2. Upload to site (one click in DreamWeaver).
    3. Open Product in ZenCart admin > Categories > Products.
    4. Paste in the required PHP code for to include() the file uploaded via DW, as the product description content.
    5. Hit preview button.
    6. Hit OK.
    7. View changes in browser.

    As far as I can tell it seems to be the same number of steps.
    .

    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.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Confirmation: can't use php in Product Descriptions?

    From what I can tell, it would be the same number of steps to create a new product, but simpler to edit the description afterward.

    My recollection of the boilerplate thread leads me to believe that you could use the $_GET[products_id] variable as a component of a filename to be included, so that tpl_product_info_display.php could insert the correct individual product description content by the process described.

    You would have to name your files with the product id as part of the name. If your model numbers are unique and suitable for inclusion in a filename, you could use those instead.

  7. #7
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: Confirmation: can't use php in Product Descriptions?

    Quote Originally Posted by DrByte View Post
    Not entirely correct.

    You forgot to include a couple important items:

    Scenario 1 (if could use php include in Product Descriptions.):
    1. Edit product description in DreamWeaver.
    2. Upload to site (one click in DreamWeaver).
    3. Open Product in ZenCart admin > Categories > Products.
    4. Paste in the required PHP code for to include() the file uploaded via DW, as the product description content.
    5. Hit preview button.
    6. Hit OK.
    7. View changes in browser.

    As far as I can tell it seems to be the same number of steps.
    Nope, not true.

    If I were able to put this in a product description:

    Code:
    <?php include ('myProduct.html'); ?>
    ...then my scenario is correct. All I have to do is edit the 'myProduct.html' file, and hit refresh on the browser, to see the results of my edits. Am I missing something?

    This is already what I am doing with my main page, which is set up through the Define Pages section. I just have:

    Code:
    <?php include ('mainPage.html'); ?>
    All I do is edit the mainPage.html page in the root of my store, upload it, and hit the browser refresh, and it's all there. No need to go through the tedious process of locating the correct page in the zencart admin interface and pasting some chunk of html into it.
    Last edited by karma-lab; 15 Jun 2008 at 10:14 AM.

  8. #8
    Join Date
    Apr 2008
    Posts
    133
    Plugin Contributions
    1

    Default Re: Confirmation: can't use php in Product Descriptions?

    Quote Originally Posted by DrByte View Post
    Not entirely correct.

    You forgot to include a couple important items:

    [snip]

    As far as I can tell it seems to be the same number of steps.
    One other point: You may be correct for the first setting up of the page. I just realized this now. But that's not what I was talking about. For every edit after that, my scenario is correct. And that's my point. When tweaking a product description, especially through CSS (as we all know, it's especially finicky, especially for different browsers), it's common to tweak and upload the same product description dozens of times. If you could just use 'php include' to include an html page for a product description, so much of this tedium would be removed.

  9. #9
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Confirmation: can't use php in Product Descriptions?

    There are lots of ways to alter the default behavior of the code, perhaps by writing a direct database content-editor of your own, or by writing in the ability to include external files, or any number of different solutions.
    Feel free to get creative, and please come back and share what you come up with so we can all benefit from it. Hopefully it supports multiple languages, as Zen Cart does now, so that others can use it too.
    .

    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.

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Confirmation: can't use php in Product Descriptions?

    Here's the new tip: adding boilerplate files to your descriptions.

    http://www.thatsoftwareguy.com/zenca...ate_files.html

    I wrote some logic to do it automatically based on product id or category id, but I came back to doing it this way because it's the most flexible.

    Good luck,
    swguy
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 
Page 1 of 4 123 ... LastLast

Similar Threads

  1. How to use a append query to update all product descriptions?
    By welshop.com in forum General Questions
    Replies: 7
    Last Post: 24 Aug 2016, 12:33 PM
  2. v138a PHP 5.4.4 dropping product descriptions
    By LittelBird in forum Upgrading from 1.3.x to 1.3.9
    Replies: 7
    Last Post: 29 Jul 2014, 04:20 AM
  3. v151 Can I use custom html files to add extra info to my product descriptions?
    By Razzinator in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 Mar 2013, 06:29 PM
  4. Is it possible to use php coded links in category descriptions?
    By timps in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 1 Sep 2007, 01:52 AM
  5. Using php include in product descriptions
    By gaekwad in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 12 Jun 2007, 11:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR