Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43
  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,513
    Plugin Contributions
    126

    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,513
    Plugin Contributions
    126

    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,513
    Plugin Contributions
    126

    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
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Using include in product description

    That is much simpler and would almost work. But due to varying production times, the deadline will vary by product. Is there a way to modify tpl_product_info_display.php to call a file like SSI (I assume not) or to link a single file with all the deadline details?

  8. #8
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,513
    Plugin Contributions
    126

    Default Re: Using include in product description

    The PHP Include function does the same thing. Something like

    <?php
    include($template->get_template_dir('/tpl_dates.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_dates.php');
    ?>

    where tpl_dates (in your templates folder) has an echo statement
    displaying what you want.

    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.

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

    Default Re: Using include in product description

    Okay, good. Is there anyway to just add the include statement into the product description file directly?

  10. #10
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    10,513
    Plugin Contributions
    126

    Default Re: Using include in product description

    You have to edit tpl_product_info_display.php and put in the include statement I gave you (after of course creating your file tpl_dates.php).
    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.

 

 
Page 1 of 5 123 ... LastLast

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