| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Color coded order status... | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
Could use some help with this code
Code:
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. |
|||||||||
#12
|
|||||||
|
|||||||
Nicely Done!
Now that's what I call some value-added programming! Regards, G;en
__________________
Never understimate stupidity. -------- X-Cart Version: 3.5.2 Hosting:mind-in-design.net Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14 |
|||||||
#13
|
|||||||||
|
|||||||||
Could really use some help with my code
It's so close |
|||||||||
#14
|
|||||||
|
|||||||
Quote:
I do believe that you can use 'and' in your 'if' statements. So, you code might look something like this: Code:
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! |
|||||||
#15
|
|||||||||
|
|||||||||
Nah that don't work but thanks for trying.
I have another idea.... |
|||||||||
#16
|
|||||||
|
|||||||
How 'bout this...
Code:
It's the blind leading the blind! Piper |
|||||||
#17
|
|||||||||
|
|||||||||
LOL!
We are blind! This didn't work either. I wish I knew more about this stuff. |
|||||||||
#18
|
|||||||
|
|||||||
One more before I go to bed...
Code:
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 |
|||||||
#19
|
|||||||||
|
|||||||||
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:
Next you need to add the color formatting tags to your skin1/main/products.tpl file Code:
You will see that I commented where the code change starts and ends. Basically we are adding Code:
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:
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. |
|||||||||
#20
|
|||||||||
|
|||||||||
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? |
|||||||||
|
|||
X-Cart forums © 2001-2020
|