Results 1 to 10 of 43

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Using include in product description

    In the product description, is there a way to use some sort of include statement to call a file. Much like you can with SSI's so I can update the one file and then have all the products with that include state updated.

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,523
    Plugin Contributions
    127

    Default Re: Using include in product description

    The product description that you enter into the database can include HTML but not PHP. However, you could always modify tpl_product_info_display.php (perhaps conditionally on product id if that's what you need) to do an inclusion. What exactly are you trying to do?

    Scott
    That Software Guy. My Store: Zen Cart Support
    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.

  3. #3
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Using include in product description

    Many of the products we sell are gifts. As each holiday approached during the year, we post to deadline to guarantee delivery by that holiday. With over 100 products, that's a lot of changes. I'd like to have those few lines of text work just like an SSI so I can change, or even remove, the deadline info during the year.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,523
    Plugin Contributions
    127

    Default Re: Using include in product description

    OK - then you should follow the example provided here:

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

    Define PHP constants for the strings you want to use (ORDER_DEADLINE, etc.)
    Reference these constants in your description
    Update the values of the constants seasonally

    Good luck,
    Scott
    That Software Guy. My Store: Zen Cart Support
    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.

  5. #5
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Using include in product description

    Scott,

    Thanks for the suggestion. It looks like all stuff I can do and I'll give it try. But I'd love to hear a simpler way to do it.

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,523
    Plugin Contributions
    127

    Default Re: Using include in product description

    Simpler (but less flexible) would be to just modify tpl_product_info_display.php to say

    "Order by Dec 1 for Christmas Delivery"

    and then change this before Easter, Thanksgiving, or whatever holidays your
    clients are likely to buy for. This is just one change in one place.

    Good luck,
    Scott
    That Software Guy. My Store: Zen Cart Support
    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.

  7. #7
    Join Date
    May 2007
    Posts
    10
    Plugin Contributions
    0

    Default Re: Using include in product description

    Quote Originally Posted by swguy View Post
    The product description that you enter into the database can include HTML but not PHP. However, you could always modify tpl_product_info_display.php (perhaps conditionally on product id if that's what you need) to do an inclusion. What exactly are you trying to do?

    Scott
    Scott,

    Can you please tell the php code for modifying the tpl_product_info_display.php,
    conditionally on a product ID.

    Here is what I want to accomplish:

    Edit the tpl_product_info_display.php to call a specific html file, based on the product ID.
    Example:
    PHP Code:
     If product ID 1 then ?php include("/includes/folder1/product_description_1.html"); ?>
    else, continue checking 
    This is a workaround for php include not being allowed in product description.

    Best,
    Vova
    Last edited by reznikvova; 29 Jan 2008 at 04:53 PM.

 

 

Similar Threads

  1. Using PHP "include" in category & product description
    By g6enterprises in forum General Questions
    Replies: 4
    Last Post: 30 Jan 2009, 09:14 PM
  2. How to include other page to product description
    By marksu in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 11 Dec 2008, 12:47 AM
  3. How to include php code into a product description
    By andy1234 in forum General Questions
    Replies: 10
    Last Post: 5 Jan 2008, 06:32 AM
  4. 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

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