Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Location
    Brisbane, Australia
    Posts
    206
    Plugin Contributions
    2

    link problem include link help needed

    Hi all,

    I am trying to clean up my product details in my database as much general information is included for each listing.

    I propose to create a new custom page in the languages directory (like about-us) say products_general_info.php and include this in the product view page after the specific product information.

    What would be the correct link in the require(); statement to allow this information to display in the correct language.

    something like this????
    Code:
    require($template->get_template_dir('products_general_info.php',DIR_WS_TEMPLATE, $current_page_base,'pages'). '/products_general_info.php');
    Many thanks,

    Goshawk
    Time is but an illusion, there is only "now"!
    www.inekesfashions.com.au
    www.kalaxcreations.com

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,093
    Plugin Contributions
    25

    Default Re: include link help needed

    Yiour best bet is probably to use swguy's boilerplate file technique to draw the general info from HTML files you create. (Post 6 in the thread referenced.)

  3. #3
    Join Date
    Aug 2006
    Location
    Brisbane, Australia
    Posts
    206
    Plugin Contributions
    2

    Default Re: include link help needed

    Thanks gjh42 for your reply.

    I propose to place the link in the tpl_product_info_display.php file at the end of this code:
    Code:
    <!--bof Product details list  -->
    <?php if ( (($flag_show_product_info_model == 1 and $products_model != '') or ($flag_show_product_info_weight == 1 and $products_weight !=0) or ($flag_show_product_info_quantity == 1) or ($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name))) ) { ?>
    <ul id="productDetailsList" class="floatingBox back">
      <?php echo (($flag_show_product_info_model == 1 and $products_model !='') ? '<li>' . TEXT_PRODUCT_MODEL . $products_model . '</li>' : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_weight == 1 and $products_weight !=0) ? '<li>' . TEXT_PRODUCT_WEIGHT .  $products_weight . TEXT_PRODUCT_WEIGHT_UNIT . '</li>'  : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_quantity == 1) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>'  : '') . "\n"; ?>
      <?php echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . TEXT_PRODUCT_MANUFACTURER . $manufacturers_name . '</li>' : '') . "\n"; ?>
    </ul>
    <br class="clearBoth" />
    <?php
      }
    ?>
    <!--eof Product details list -->
    So not in the html created from the database.

    It should be possible just to place a include/require statement before the ?> that loads the additional file.

    Goshawk
    Time is but an illusion, there is only "now"!
    www.inekesfashions.com.au
    www.kalaxcreations.com

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    21,093
    Plugin Contributions
    25

    Default Re: include link help needed

    Is there just one file that you want to include in every product? Then your idea is sound and will work easily.

    If you have various stock texts that you want to insert in different products, then the boilerplate concept may be better. I have developed a variant of swguy's method that can be used to insert as many stock text/HTML chunks as desired into whatever part of the product info page is wanted, triggered by an HTML comment in the description. All it requires is putting a function call into the file in the place desired. I haven't submitted it to Free Addons yet, but I will attach it here if you would like to try it.
    What would be the correct link in the require(); statement to allow this information to display in the correct language.
    $_SESSION['language'] will get the current language, and can be used in a file lookup.
    Why are you planning to require a PHP file? Is it going to need PHP manipulation and processing to output the HTML you will want to display? If you are only going to want one piece of text/HTML in this location, you can define that as a constant in a language file (one for each language you are using)
    PHP Code:
    define('PRODUCT_GENERAL_INFO_TEXT''<div class="boilerplate"><p class="generalSection">This is a bunch of general product information.</p><p>It is long and repetitious and the same on every product.</p></div>'); 
    and echo the constant where you want it:
    PHP Code:
    <!--eof Product details list -->
    <?php echo PRODUCT_GENERAL_INFO_TEXT;?>
    Last edited by gjh42; 14 Oct 2011 at 04:36 AM.

  5. #5
    Join Date
    Aug 2006
    Location
    Brisbane, Australia
    Posts
    206
    Plugin Contributions
    2

    Default Re: include link help needed

    Thanks gjh42,

    I will try this method, as 90% of my products have the same info attached.

    For the other few products the information would not distract from the listing.

    I will however again look closer at swguy's boilerplate file technique as it will give some future proofing if new prodicts need to be added.

    Goshawk
    Time is but an illusion, there is only "now"!
    www.inekesfashions.com.au
    www.kalaxcreations.com

 

 

Similar Threads

  1. How do I include the title in the address bar to include the product name?
    By alliedlock in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 2 Aug 2009, 05:59 AM
  2. Product Listing Modification to Include Link to Media Manager Preview
    By sleastack in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Mar 2008, 12:25 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
  •