Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    red flag Adding In Stock Image to Product Display Page

    Hello:

    I am wandering what code is necessary to add an 'In Stock' image on my product info display page.

    I do not know PHP at all but do know some programming basics so, if anyone could help me out here - that would be fantastic.

    Also would I have add code to my stylesheet to position it correctly or will it all just depend on where I place the code in my product info display page.

    Thank you.
    Thank you,
    autoace

  2. #2
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Adding In Stock Image to Product Display Page

    you are going to have to edit a file called tpl_product_info_display.php that is in (includes/templates/yourtemplate/templates/)

    You need to find the following block of 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 -->
    And add the following lines:

    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>
    <?php if ($products_quantity>0){
    echo '<div id="inStockImage">in stock</div>';
    };?>
    <br class="clearBoth" />
    
    <?php
      }
    ?>
    <!--eof Product details list -->
    That will add a phrase 'in stock' on the page if the item in in stock. In the code you can replace the 'in stock' with whatever you want - including an image - in normal html.

    If you need more help with that let us know.

    This will place the image after the product details list. You can position it with css a bit from here. If you want it somewhere else entirely then you're going to need to move the lines we added somewhere else in the code.

    As always a URL would be fantastically useful!

  3. #3
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    Default Re: Adding In Stock Image to Product Display Page

    Hi niccol:

    Thanks for the response. I did as you instructed and it shows up perfect, just how I want it!

    One more question, though...
    How would I code for an image via html?

    Thanks
    Thank you,
    autoace

  4. #4
    Join Date
    Apr 2009
    Posts
    2,134
    Plugin Contributions
    3

    Default Re: Adding In Stock Image to Product Display Page

    Well, the minimal way of inserting an image into an html document is:

    Code:
    <img src="image_path"/>
    where image_path represents exactly where the image is on the server and what its name is.

    Good explanation at:

    http://www.w3schools.com/htmL/html_images.asp

  5. #5
    Join Date
    Jun 2009
    Posts
    617
    Plugin Contributions
    0

    Default Re: Adding In Stock Image to Product Display Page

    Hello:

    I ended up just using my stylesheet to style and format the actual words. Enough w/ loading pics!

    Thanks for your help.
    Thank you,
    autoace

 

 

Similar Threads

  1. v151 "Display Cart After Adding Product" - Only if Stock is Less than 1
    By gaffettape in forum General Questions
    Replies: 3
    Last Post: 6 Jan 2013, 08:40 PM
  2. Image Handler: Can not get image to display on product info page
    By weezee in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 24 Oct 2010, 04:31 AM
  3. how do i change product image size on multi product display page?
    By what44 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 7 Nov 2007, 04:51 AM
  4. o stock on product image page
    By Rob905 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 19 Sep 2007, 03:37 PM
  5. Display text or image “IN STOCK” on product pages up the top?
    By apemusic in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 3 Jul 2007, 03:07 PM

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