Guest Posted September 10, 2005 Posted September 10, 2005 http://www.vinylwarning.com.au/index.php?cPath=67_68 The quantity has been changed into status here, the green light displays products in stock, yellow for one left and red for no stock. I used a contribution for this code: //bof stock announcementcase 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; if ((STOCK_CHECK == 'true')&&($listing['products_quantity'] < 1 )) { $lc_text = '<span class="markProductOutOfStock"><center><img src="images/icon_status_red.gif"><center></span>'; } } elseif ((STOCK_CHECK == 'true')&&($listing['products_quantity'] > 0 )) { $lc_text = '<span class="markProductOutofStock"><center><img src="images/icon_status_green.gif"><center></b></span>'; } else { $lc_text = ' ' . $listing['products_quantity'] . ' '; } break; //eof stock announcement this only displays a red for no stock and a green button for stock, but I also want a yellow button for 2 products or less, so I tried this code: //bof stock announcementcase 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; if ((STOCK_CHECK == 'true')&&($listing['products_quantity'] < 1 )) { $lc_text = '<span class="markProductOutOfStock"><center><img src="images/icon_status_red.gif"><center></span>'; } elseif ((STOCK_CHECK == 'true')&&($listing['products_quantity'] <3 )) { $lc_text = '<span class="markProductOutofStock"><center><img src="images/icon_status_yellow.gif"><center></b></span>'; } elseif ((STOCK_CHECK == 'true')&&($listing['products_quantity'] > 3 )) { $lc_text = '<span class="markProductOutofStock"><center><img src="images/icon_status_green.gif"><center></b></span>'; } else { $lc_text = ' ' . $listing['products_quantity'] . ' '; } break; //eof stock announcement But this doesn't work, because when there are 3 products in stock there is no button but just the number 3. Can anyone helo me with this? It must work like this: 0 products red button 2 or less yellow button 3 or more green button (I tried this several times, but I can't simply put my hand to it)
241 Posted September 10, 2005 Posted September 10, 2005 //bof stock announcement case 'PRODUCT_LIST_QUANTITY': $lc_align = 'right'; if ((STOCK_CHECK == 'true')&&($listing['products_quantity'] < 1 )) { $lc_text = '<span class="markProductOutOfStock"><center><img src="images/icon_status_red.gif"><center></span>'; } elseif ((STOCK_CHECK == 'true')&&($listing['products_quantity'] <3 )) { $lc_text = '<span class="markProductOutofStock"><center><img src="images/icon_status_yellow.gif"><center></b></span>'; } elseif ((STOCK_CHECK == 'true')&&($listing['products_quantity'] >= 3 )) { $lc_text = '<span class="markProductOutofStock"><center><img src="images/icon_status_green.gif"><center></b></span>'; } else { $lc_text = ' ' . $listing['products_quantity'] . ' '; } break; //eof stock announcement No longer giving free advice. Please place deposit in meter slot provided. Individual: [=] SME: [==] Corporation: [===] If deposit does not fit one of the slots provided then you are asking too much! Is your Osc dated try Phoenix raising oscommerce from the ashes.
Guest Posted September 19, 2005 Posted September 19, 2005 That's the one, thanks! <{POST_SNAPBACK}> Where did you put this code, and on what page? Thanks 'T'
Recommended Posts
Archived
This topic is now archived and is closed to further replies.