Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Posts
    7
    Plugin Contributions
    1

    Default Adding a "New" image to the product listing (similar to "Sold Out" image)

    Has this been done already?

    I want to add a "New" image to the product listing (similar to "Sold Out" image)

    I don't really want the separate "new" layout box, but I do want the same products that would normally show within this box to drive the functionality of showing my "new" image.

  2. #2
    Join Date
    Jul 2009
    Posts
    7
    Plugin Contributions
    1

    Default Re: Adding a "New" image to the product listing (similar to "Sold Out" image)

    Guess I got impatient.

    Here is what I did in case anyone else needs this:
    /includes/functions/functions_general.php
    Changed this (about line 1138):
    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    To this:
    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity, TO_DAYS(NOW()) - TO_DAYS(products_date_added) products_age_in_days from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    Added this:
    Code:
        case ($button_check->fields['products_age_in_days'] <= SHOW_NEW_PRODUCTS_LIMIT):
          $return_button = zen_image_button(BUTTON_IMAGE_NEW_SMALL, BUTTON_SOLD_NEW_ALT);
          break;
    Below this (about line 1147):
    Code:
        case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1'):
          if ($_GET['main_page'] == zen_get_info_page($product_id)) {
            $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);
          } else {
            $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);
          }
          break;
    /includes/languages/english/button_names.php
    Added:
    Code:
    define('BUTTON_SOLD_NEW_ALT', 'New');
    define('BUTTON_IMAGE_NEW_SMALL','button_new_sm.gif');
    Added graphic:
    /includes/templates/my_template/buttons/english/button_new_sm.gif

  3. #3
    Join Date
    Jul 2009
    Posts
    7
    Plugin Contributions
    1

    Default Re: Adding a "New" image to the product listing (similar to "Sold Out" image)

    Argg! Bug! Anyway, I could not find an edit in this forum, so I will just repost here with this correction:
    Code:
        case ($button_check->fields['products_age_in_days'] <= SHOW_NEW_PRODUCTS_LIMIT and $_GET['main_page'] != zen_get_info_page($product_id)):
    And here is the repost:
    Here is what I did in case anyone else needs this:
    /includes/functions/functions_general.php
    Changed this (about line 1138):
    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    To this:
    Code:
        $button_check = $db->Execute("select product_is_call, products_quantity, TO_DAYS(NOW()) - TO_DAYS(products_date_added) products_age_in_days from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
    Added this:
    Code:
        case ($button_check->fields['products_age_in_days'] <= SHOW_NEW_PRODUCTS_LIMIT and $_GET['main_page'] != zen_get_info_page($product_id)):
          $return_button = zen_image_button(BUTTON_IMAGE_NEW_SMALL, BUTTON_SOLD_NEW_ALT);
          break;
    Below this (about line 1147):
    Code:
        case ($button_check->fields['products_quantity'] <= 0 and SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1'):
          if ($_GET['main_page'] == zen_get_info_page($product_id)) {
            $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT, BUTTON_SOLD_OUT_ALT);
          } else {
            $return_button = zen_image_button(BUTTON_IMAGE_SOLD_OUT_SMALL, BUTTON_SOLD_OUT_SMALL_ALT);
          }
          break;
    /includes/languages/english/button_names.php
    Added:
    Code:
    define('BUTTON_SOLD_NEW_ALT', 'New');
    define('BUTTON_IMAGE_NEW_SMALL','button_new_sm.gif');
    Added graphic:
    /includes/templates/my_template/buttons/english/button_new_sm.gif

 

 

Similar Threads

  1. v150 After adding new product it goes to "Sold Out" even when in stock!
    By oavs in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 20 Sep 2012, 02:52 AM
  2. Replies: 20
    Last Post: 26 Oct 2011, 12:21 AM
  3. Replies: 26
    Last Post: 19 Feb 2010, 02:56 AM
  4. Remove "Product Image" "Item Name" and "Price"...
    By rebekah in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 22 Sep 2008, 06:08 PM
  5. Adding external link to "sold out" image
    By turbowilson in forum General Questions
    Replies: 0
    Last Post: 25 Jul 2008, 01:52 AM

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