Results 1 to 10 of 43

Hybrid View

  1. #1
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Using include in product description

    $products_options->fields['products_options_values_name'] != ' ' is not the same as:
    $products_options->fields['products_options_values_name'] != ''

    You want to test when that field is blank and when blank show nothing ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Using include in product description

    I'm understanding the logic but not the coding. This is what I have understood, but it's not working right.

    // Read Only - just for display purposes

    if (($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY) and ($products_options->fields['products_options_values_name'] != '')) {

    $tmp_html .= $products_options_details . '<br />';

    } else {

    $zv_display_select_option ++;

    }

    What did I misunderstand?

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Using include in product description

    If you look for the constant, I believe there are 2 places to reference in that file ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Using include in product description

    Linda,

    What is the constant you're referring to? Is it PRODUCTS_OPTIONS_TYPE_READONLY?

    If so, I did find two other references but I don't know what to do with them.

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Using include in product description

    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; 
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

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

    Default Re: Using include in product description

    Linda,

    You are a dream! Thank you, thank you for not giving up on me. Now it works perfectly!

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Using include in product description

    You are most welcome ...

    Keep in mind when you add vs edit ...

    It will probably wipe out the Option Value on the edit if you add HTML code in there so keep a copy handy ...

    This is a way to "cheat" on maintaining and updating common data on products ... it is not by any means perfected ...

    Plain text is fine, but get into the fancy stuff and it makes messies on the edit ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    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; 

 

 

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