The code is using one if before it takes the icon from z_market_icons.
Did you check the conditions?
1# Your weapon musnt be in FORBIDDEN array (look @ the start)
2# Your weapon template must have duration -1 (db part)
3# Your weapon grade must be 5 (S grade)
4# Your weapon type must be in Types
TYPES = ["Sword","Blunt","Dagger","Bow","Etc","Pole","Fist","Dual Sword","Dual Fist","Big Sword","Big Blunt"]
5# Your weapon enchant must be more than 0.
if idtest not in FORBIDDEN and itemTemplate.getDuration() == -1 and grade == 5 and itype in TYPES and Item.getEnchantLevel() > 0: