Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default New Product Icon....

    I have looked around for a while and I am surprised this has not come up before. We are looking for a way to flag a product as new and have a new icon or some other identifier on the item to show that it is new. This would be a manual setting, not like the New Products logic. Anyone seen something like this for zencart?


    Cal

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

    Default Re: New Product Icon....

    You could use whatever is your method to test for the product as being "New" and add an icon on the display price function as that is used everywhere that the price is displayed so you just have to customize one function ...
    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: v1.5.5]
    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!

  3. #3
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: New Product Icon....

    Quote Originally Posted by Ajeh View Post
    You could use whatever is your method to test for the product as being "New" and add an icon on the display price function as that is used everywhere that the price is displayed so you just have to customize one function ...
    Excellent idea! Thanks :-)

  4. #4
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: New Product Icon....

    Quote Originally Posted by modernm View Post
    Excellent idea! Thanks :-)
    Is there a function that gives a quick true or false if a product is new or not? Based on the core ZenCart definition of new product.


    Cal

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

    Default Re: New Product Icon....

    What determines if your Products are New or not?

    You said you were not using the logic for products_date_added but using your own manual logic ...
    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: v1.5.5]
    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
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: New Product Icon....

    Found zen_get_new_date_range(), close enough!

  7. #7
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: New Product Icon....

    Quote Originally Posted by modernm View Post
    Is there a function that gives a quick true or false if a product is new or not? Based on the core ZenCart definition of new product.


    Cal
    Quote Originally Posted by Ajeh View Post
    What determines if your Products are New or not?

    You said you were not using the logic for products_date_added but using your own manual logic ...

    Ya, I then realized that would be more maintenance than it is worth.


    Cal

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

    Default Re: New Product Icon....

    Thanks for the update that this will work for you after all ...
    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: v1.5.5]
    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!

  9. #9
    Join Date
    Dec 2007
    Location
    Hoboken, NJ
    Posts
    96
    Plugin Contributions
    1

    Default Re: New Product Icon....

    K, so this is by far clean but if someone needs a quick and dirty solution for this, I did the following.

    modify "includes/modules/YOURTEMPLATE/product_listing.php"

    Replace...

    Code:
     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>';
              }

    With...

    Code:
    if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
              $lc_text = '';
            } else
    
    
    $display_limit = zen_get_new_date_range();
    
    $new_label_products_query = $db->Execute("select products_id, products_date_added from " . TABLE_PRODUCTS . "  p where products_id = '" . $listing->fields['products_id'] . "' $display_limit");
    
    
    		 {
              if (isset($_GET['manufacturers_id']) && $new_label_products_query->fields['products_id'] == $listing->fields['products_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"') . '<br /><br /><span class="productNew" style="font-weight:bold;">NEW!</span></a>';
    			
              } elseif ($new_label_products_query->fields['products_id'] == $listing->fields['products_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"') . '<br /><br /><span class="productNew" style="font-weight:bold;">NEW!</span></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>';
              }

  10. #10
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Re: New Product Icon....

    Hi,

    I tried the above given code but entire product listing is going missing. I think it need some modification.

    Im using 1.3.8a version.

    ~ Time

 

 

Similar Threads

  1. Replies: 29
    Last Post: 19 Sep 2014, 03:43 AM
  2. Adding a New Product icon to product listing
    By Minnie Mouse in forum General Questions
    Replies: 3
    Last Post: 30 Dec 2010, 02:17 AM
  3. How Display a NEW logo or icon in product listing for new products
    By triumph in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 29 Dec 2010, 09:35 AM
  4. Icon on new items?
    By aeolidia in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 31 Aug 2008, 03:12 PM
  5. how to add "new" icon on product and how to take the british flag...
    By smallpigpig in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 20 Sep 2007, 02:07 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR