Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2009
    Posts
    13
    Plugin Contributions
    0

    Default Add a sticker for featured products

    Hello,

    I have find this code for put a sticker on the news products. This work fine but i want to have the same system for the featured products.

    I am 0 in PHP ; this is the code:

    <?php
    $datesql = "select products_date_added from products where products_id = ". (int)$_GET['products_id'] ." ";
    $date_display = $db->Execute($datesql);
    $newdate = $date_display->fields['products_date_added'];
    $newdate2 = $newdate–30;
    function reformatDate($newdate) {
    list($day, $month, $year, $hour, $min, $sec) = split( '[: -]',
    $newdate);
    return "$day-$month-$year";
    }
    $dateA=$newdate;
    $theDate=reformatDate($dateA);
    $thirty_days_ago = mktime()-2592000;
    if ($theDate >= date('d-m-Y', $thirty_days_ago)) { echo '<div class="new"></div>'; }
    ?>

    Can you help me ? Thank you.

  2. #2
    Join Date
    Jun 2009
    Posts
    13
    Plugin Contributions
    0

    Default Re: Add a sticker for featured products

    I have find the solution and you can use if you want to put a sticker on featured products:

    1°) in the stylesheet css, add a class:

    .new {
    background-image:url(../images/stickers.png );

    width: 232px;
    height: 40px;

    }

    2°) In the tpl_product_info_display.php, add this where you want the sticker (You must to find the good place):

    <?php
    $base= "select products_id from products where products_id = ". (int)$_GET['products_id'] ." ";
    $base2 = $db->Execute($base);
    $base3 = $base2->fields['products_id'];

    $base4= "select products_id from featured where products_id = '$base3' ";

    $base5 = $db->Execute($base4);
    $base6 = $base5->fields['products_id'];

    if ($base3=$base6){ echo '<div class="new"></div>'; }
    ?>

    It's all

    After this, all your's featured products have a sticker.
    Attached Images Attached Images  

 

 

Similar Threads

  1. Add text area for Featured Products on home page
    By barendfaber in forum General Questions
    Replies: 4
    Last Post: 23 Oct 2013, 11:31 PM
  2. Displaying 'Add to Cart' button on New Products and Featured Products
    By KenshiroU in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 28 Jun 2013, 05:30 AM
  3. Replies: 13
    Last Post: 21 Feb 2013, 03:52 PM
  4. clone featured products for category featured products
    By justbecause in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 18 Jan 2011, 06:49 AM
  5. Guide: How to add sorting for featured products
    By Vladimir7 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 4 Jan 2008, 07:56 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