Page 5 of 5 FirstFirst ... 345
Results 41 to 43 of 43
  1. #41
    Join Date
    Oct 2005
    Location
    Chicago, IL USA
    Posts
    1,587
    Plugin Contributions
    29

    Default Re: Using include in product description

    Ain't that the truth!! I don't think I should be working on upgrading to 1.3.7 right now either.

  2. #42
    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.

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

    Default Re: Using include in product description

    Linda,

    Is the below code right for 1.3.7? I think I figured out why my readonly attributes where displaying when empty. I didn't carry over the mod when I upgraded. When I install it new, I'm getting a parse error.


    Quote Originally Posted by Ajeh View Post
    The constant is the:
    PRODUCTS_OPTIONS_TYPE_READONLY

    I forget off hand the code in 1.2.7 but it is similar ...

    In the first location I change the code to:
    PHP Code:
                      // Read Only - just for display purposes
                      
    if ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) {
                        
    //            $tmp_html .= '<input type="hidden" name ="id[' . $products_options_names->fields['products_options_id'] . ']"' . '" value="' . stripslashes($products_options->fields['products_options_values_name']) . ' SELECTED' . '" />  ' . $products_options->fields['products_options_values_name'];
                        
    if (empty($products_options_details)) {
                          
    $tmp_html '';
                        } else {
                          
    $tmp_html .= $products_options_details '<br />';
                        }
                      } else {
                        
    $zv_display_select_option ++;
                      } 
    In the next location I change the code:
    PHP Code:
                      // READONLY
                      
    case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY):
                      if (empty(
    $tmp_html)) {
                      } else {
                      
    $options_name[] = $products_options_names->fields['products_options_name'];
                      
    $options_menu[] = $tmp_html "\n";
                      
    $options_comment[] = $products_options_names->fields['products_options_comment'];
                      
    $options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' '1' '0');
                      }
                      break; 

 

 
Page 5 of 5 FirstFirst ... 345

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