Page 1 of 5 123 ... LastLast
Results 1 to 10 of 49
  1. #1
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default sold out sm button position


    Does anyone know what file I could edit to wrap this sold_out_sm.gif in a position: relative; tag so I could move it up over the top of the image?

    I've searched the developers toolkit and can't find the file that's generating this button. I can't see from the page source either :-(

  2. #2
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    hah, figured this out myself guys like this:

    /includes/functions/function_general.php

    replace:
    PHP Code:
        if ($return_button != $link and $additional_link != false) {
          return 
    $additional_link '<br />' $return_button
    with:
    PHP Code:
        if ($return_button != $link and $additional_link != false) {
          return 
    $additional_link '<br /><div style="position:relative; top:-200px">' $return_button
    just edit the -200px to suit your own image sizes.

  3. #3
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    No, ignore my last post.... I thought I had a solution but in fact it just messes up the page formatting.

    Does anyone know how I can add a <div id="mySoldOutButton" to this image so I can control its position from the stylesheet??

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    no one?

  5. #5
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    I've been trying to figure this out for a couple of days but to no avail...

    I'm basically trying to use some sort of position: relative; top: -100px; to control the position of the BUTTON_IMAGE_SOLD_OUT_SMALL gif that displays under the image on the products list pages.

    Is there any way to position this button over the image?

    I tried going with CSS buttons which helps but I hate them... I much prefer the image buttons... but how do I position button_sold_out_sm.gif relative?

    Is there a way to define this button and then somehow control it via my stylesheet?

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    a picture paints 1000 words:


  7. #7
    Join Date
    Aug 2006
    Location
    UK
    Posts
    449
    Plugin Contributions
    0

    Default Re: sold out sm button position

    My fix is to modify includes/modules/CUSTOM/product_listing.php Line 160...

    Code:
            case 'PRODUCT_LIST_IMAGE':
            $lc_align = 'center';
            if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              $lc_text = '';
            } else {
              if (isset($_GET['manufacturers_id'])) {
                $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
              } else {
                $lc_text = '<a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH, IMAGE_PRODUCT_LISTING_HEIGHT, 'class="listingProductImage"') . '</a>';
              }
    // bof - SOLD OUT on Image
             if ($listing->fields['products_quantity'] <= 0) {
             $lc_text .='<div class="sold_out_on_image" style="position:relative;top:-50px;">Sold Out</div>';
            }
    // eof - SOLD OUT on Image
    You should remove the in line style and put it into your stylesheet.css
    ~Steve~

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    Steve, almost perfect!! You've certainly got me on the right tracks!!

    As you can see if you look at my products page here, I have altered the code you suggested so that it displays an image as opposed to text:
    PHP Code:
              // bof - SOLD OUT on Image
             
    if ($listing->fields['products_quantity'] <= 0) {
             
    $lc_text .='<div class="sold_out_on_image"><img src="http://www.dystynction.com/includes/templates/freetemplate2/images/button_sold_out_sm_mine.gif"></div>';
            }
             
    // eof - SOLD OUT on Image 
    This works a treat as it places a sold out image over the top of the product image, however there is a problem with the white space caused by my position: relative;



    How on earth do I get rid of the white space that the image file would occupy if not for my position: relative; ???

    My stylesheet entry is this:
    PHP Code:
    .sold_out_on_image {
    positionrelativetop: -180px;
    margin0px;
    padding0px;
    line-height0px;
    displayinline;


  9. #9
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: sold out sm button position

    OK, getting somewhere although still not perfect. I changed my stylesheet to this:
    PHP Code:
    .sold_out_on_image {
    positionrelativetop: -180px;
    height0px;
    margin0px;
    padding0px;
    line-height0px;
    displayblock;

    and although it's a vast improvement, it still leaves a small white gap... anyone any idea from my source code how I can get rid of the <br> white space now?

  10. #10
    Join Date
    Aug 2006
    Location
    UK
    Posts
    449
    Plugin Contributions
    0

    Default Re: sold out sm button position

    another mod... not tested in IE...


    .centeredContent {
    position:relative;
    }

    .sold_out_on_image {
    bottom:140px;
    left:40px;
    margin:0;
    padding:0;
    position:absolute;
    text-align:center;
    width:125px;
    }
    ~Steve~

 

 
Page 1 of 5 123 ... LastLast

Similar Threads

  1. sold out button
    By dmagic in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 28 Jul 2014, 07:45 AM
  2. Sold Out Button says "Sold Out SM".... Sophy Blue
    By huntleybill in forum Addon Templates
    Replies: 3
    Last Post: 28 Nov 2011, 05:32 AM
  3. Chenge the "sold out" button position
    By ilmarchez in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 15 Apr 2011, 10:52 PM
  4. SOLD-OUT graphic /outline /position
    By rdcast in forum General Questions
    Replies: 2
    Last Post: 9 Apr 2011, 04:57 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