Could use some help with this code
Code:
{* $Id: products_colors.tpl,v 1.0 2003/10/26 13:07:50 ADPBoss Exp $ *} What I want it to do is 1. Check if the product is active or disabled "forsale" 2. Check if the product has an availability of 0 or 1. I was able to make this work with just checking the avail (inventory) number but cannot seem to combine the two checks. It's probably because I am not very smart at this stuff. I am sure someone who knows what they are doing could fix this in a minute. |
:wink: Nicely Done!
Now that's what I call some value-added programming! Regards, G;en |
Could really use some help with my code
It's so close |
Quote:
I do believe that you can use 'and' in your 'if' statements. So, you code might look something like this: Code:
{* $Id: products_colors.tpl,v 1.0 2003/10/26 13:07:50 ADPBoss Exp $ *} I'm not a master programmer either, so this may be a shot in the dark. Maybe Shan, Boomer or Funky could shed some light on this if thay happen to stroll through here. Piper P.S. Let me know what happens! |
Nah that don't work but thanks for trying.
I have another idea.... |
How 'bout this...
Code:
{* $Id: products_colors.tpl,v 1.0 2003/10/26 13:07:50 ADPBoss Exp $ *}б═ It's the blind leading the blind! 8O Piper |
LOL!
We are blind! This didn't work either. I wish I knew more about this stuff. |
One more before I go to bed...
Code:
{* $Id: products_colors.tpl,v 1.0 2003/10/26 13:07:50 ADPBoss Exp $ *}б═б═ I used the 'elseif' to separate the options. Also, there was an extra } in there. Believe it or not, this is exactly how I teach myself. I try everything using slightly different code until I find the solution. It may take me hours, but I eventually solve the problem as well as learning by trail and error (mostly error). When all else fails, check other templates to see if you can find similar code and use it as a reference. Good luck, and good night. Piper |
Yay! Go to bed Piper, you dunnit! Only thing is you had the forsale condition set to "n" in all instances but it should be as below! :)
Grey - Disabled product, Red - Out of stock, Yellow - Inventory level of 1 http://www.adpmods.com/graphics/x-ample1.gif Create a file in skin1/main called products_colors.tpl Code:
{* $Id: products_colors.tpl,v 1.0 2003/10/26 13:07:50 ADPBoss Exp $ *} Next you need to add the color formatting tags to your skin1/main/products.tpl file Code:
{* $Id: products.tpl,v 1.22 2002/11/13 07:17:54 alfiya Exp $ *} You will see that I commented where the code change starts and ends. Basically we are adding Code:
{include file="main/products_colors.tpl"} inside all of the TD tags that are on the product information lines. Now, last change. Because we are using red to mark zero stock products, then we had to change the default admin small message css being used on the Advanced Discount display. I created a new CSS style in skin1.css called "AdvancedDiscount". I used a blue colour for the NEW advanced discount display on this page. You will see the code on the line that produces the discount % display. Code:
font class=AdvancedDiscount That's it. Thank Piper for coming up with a really great idea that all of you developers should be incorporating into your cart builds. To the average Joe E-Commerce merchant, this kind of added UI friendliness is a very cool feature. ** One more note, I have changed the hyperlinking on the product name display in main/products.tpl to link to the modify page rather than the details page. I product modify constantly and this is a nice feature for someone like me. Again, thank Piper for the inspiration. |
I appended the products.tpl as stated but now the list price does not show and the percentage discount shows as -%.
I've been looking at the code but am still a little new, could you please help? |
All times are GMT -8. The time now is 12:29 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.