Color coded order status...
I created a mod to the orders.tpl file to change the color of the cells with the order info in them. The cells will change color according to the status of the order. This makes it very easy to glance at your screen to get the status.
Here is a screen capture of what I'm talking about. I'll post the code shortly. it's a very simple (yet effective) mod. http://66.113.244.89/order_colors.gif Piper |
hey, that's pretty cool. Would you be able to change the colours easily?
|
Awesome MOD!
Can't wait to incorporate your code into my cart. |
Quote:
Yup! The colors are controlled by a seperate .tpl file. you can edit them to whatever you like. It would really be cool to somehow incorporate the color settings into the "General Settings" page, but for now you just need to edit the color values in the tpl. Simple enough. Piper P.S. I've been realy busy lately, but I'll try to post the code tomorrow. |
Nicely done. =D>
Can't wait for the code. |
Here's the code...
First, create a new template called 'order_colors.tpl' (or whatever you prefer). This file should live in the 'Main' directory. Paste the following into this new file: Code:
{* $Id: orders_colors.tpl,v 1.0 2003/10/26 13:07:50 pipercub Exp $ *} Obviously, you can add all of the status indicators that you need, but I only use these three. This is also where you change the colors. Next, open 'main/orders.tpl'. Find the part of the code where the 'section' loop begins. Replace everything between {section name=cat_num loop=$orders} and {/section} with the following code: *This is the easy method. Scroll down for the custom method. Code:
{section name=cat_num loop=$orders} For theose who don't want to replace their file (due to other mods), you can simply paste: Code:
{include file="main/orders_colors.tpl"} between all of the <td> tags for the cells that you want to affect. Example: <td align="center" {include file="main/orders_colors.tpl"}> Enjoy, Piper |
Awesome. Absolutely awesome.
Implemented and I'm tweaking colours right now. ADDED Ok here is my colour scheme. Blue for Complete Grey for Incomplete Red for Failed Green for Processed Yellow for Queued Code:
{* $Id: orders_colors.tpl,v 1.0 2003/10/26 13:07:50 pipercub Exp $ *} Hope you like it although it is very easy to change. |
This is so great that my mind is racing with the possibilities.
It would be great to be able to implement this in the modify product listings. Show out of stock products or low stock products highlighted with colour. |
adpboss,
Did you paste the entire chunk of code, or just the 'include'? The reason I ask is because I modified the number of cells that xcart displays on the orders page. I didn't like to have to check a radio button and then hit 'Details', so I added the customers name and made it a hot link. I also modified the date format. All of this is in the big chunk of code. Piper |
Piper,
I just went back and checked. Yes, I have the names and the dates. Great job! I am just finishing modifying the product listings, and will post my code as I complete. Thanks, this is really excellent. |
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? |
OK, I got the list price to show but still not the discount. only shows -%
Heres the code I have Code:
{* $Id: products.tpl,v 1.22 2002/11/13 07:17:54 alfiya Exp $ *} This is what I actually changed (or added) in the code supplied for this mod: Code:
{if $products[cat_num].list_price gt 0} Again, thanks in advance! |
What version are you running? You need to put your version and server type in your forum signature. It's tough to help someone if we don't know what they are running.
Did you copy the whole products.tpl verbatim or just change the tags? I don't understand the code you posted that you changed. It has nothing to do with this mod. We are adding smarty tags to the cell formatting by inserting the smarty include in the TD tags. That and adding the NEW AdvancedDiscount CSS. |
I cipied the whole thing verbatim and then noticed the list price (or shop price as it showed after the change) was 0.00 and the discount was -%, being the kinda guy I am, I backed everytinhg up first and then started tearing apart code. Afterall how else do I learn?
So after copying the code verbatim and seeing the list price and discount not working, I started analyzing the original code vs. the modified code and came up with the chunk of code I included, that was in the original code. In short, using the supplied code in 3.4.8, the list price and discount no longer came up.....hmmmmm |
Do you think it could be that you copied my 3.3.8 code and used it for your version?
If you want to implement this mod, I would recommend going into your original products file and manually adding the tags. If you were using 3.3.8 you may be able to shortcut by copying the code but across release versions it is bound to have issues. I only provided my products code to show all of the instances where I had to add the tags. Good Luck! |
Nevermind......
ADVICE FOR NEWBIES that are really trying to learn how to manipulate the code in X-Cart and think it seems impossible and when you think it makes absolutely no sense do this: Step back a minute Take a deep breath and...............READ THE CODE! adpBoss, forget everything I said and did in this post. I'm getting better! I just read the code and made a couple changes and everything works just fine. Thanks to all for this mod (and the orders.tpl mod)..They make x-cart a better experience.. |
No problem.
We all have to start somewhere and trust me, staring at your cart code for hours on end will make everything seem difficult and confusing. Sometimes going for a walk and coming back to a problem can work miracles. Good Luck with your store! :D |
love it!!!!
|
Custom order date format
Not really wanting to create a new topic for this so Im posting it in the forum that inspired me. Sweet mod in this forum I might add!
Anyhow, here's my mod: Code:
{$orders[cat_num].date|date_format:"%h. %d, %Y - %r"} This will display your orders in the following format: Nov. 10, 2003 - 06:33:21 PM Here's a useful page for further date customizations: http://unix.about.com/library/weekly/aa042301a.htm |
Shame I missed this thread earlier. Some good mods here, makes life much easier. \:D/
|
Thanks pipercub.. this makes life easier..
|
Trying to further mod this mod....
Well ,this mod has been working very well for me. However, I wanted to improve it but I'm having some troubles. What I would like to do is the following:
We have obviuosly had success color coding this table. However, I want to be able to display some order data within that table. Example: Lets say your color coded table shows two orders. One is complete (green) the other is pending (yellow). On the pending order, I want to be able to see a list of the products associated with that order. http://www.stargatecinema.com/new_table.gif Basically, I need to pull info from the "history_order.tpl" and place it into the "order.tpl". Seems pretty simple, but I think these two tpl's call different php files. *The toggle triangle would be a bonus, but it's above the scope of what I'm trying to do. Any help would be great! Pipercub |
I think you would have to find where the history_order.tpl posts its data in the sql db. My site isnt live yet so I have no orders but im guessing you would ahve to take that persons order number and search the order_details table and pull all the info you want for each order that matches that # in the table.
I might write something but It would be useless on my site since some of my orders are going to be 1000 items + |
Do you expect many customers will spend the time to add over 1,000 items to their cart one by one?
Not being sarcastic, but quite serious. Do you have something special planned so they can purchase faster? |
Re: Trying to further mod this mod....
Quote:
This would be useful... any ideas? |
is there a way to highlight orders that are shipped 2nd day so those stand out more?
|
You need to modify this code in the orders_colors.tpl
Code:
{* $Id: orders_colors.tpl,v 1.0 2003/10/26 13:07:50 pipercub Exp $ *} Something like this (this is only a starting point, I'm too busy to develop your mod for you, it's easy you can do it.) Code:
{* $Id: orders_colors.tpl,v 1.0 2003/10/26 13:07:50 pipercub Exp $ *} Hope this helps. Good luck. |
hey thanks! I couldnt figure out the fields that were in the orders struct. Is there a place where they are defined?
i did something like this in orders.tpl (only support ups): Code:
<td width=90% class=Text {include file="main/order_colors.tpl"}> works good!!! thanks man! [/code] |
FYI -- These mods worked fine in 3.5.10 -- Thanks everyone!
|
No problem. I can't live without this mod. I do a modest # of orders, I have no idea how people who pump 100's a day through their site keep track visually.
|
This is one of the most underrated mods for everyday users. Nothing is better than visual representation of order status. Especially when you want to browse through a list to see how many are queued, declined etc all in one screen without using filters.
Implementing this in V4.0.5 You need to modify skin1/main/orders_list.tpl Around line 53 change Code:
<TR{cycle values=", class='TableSubHead'"}> to Code:
<TR{cycle values=", class='TableSubHead'"}> Please also note that you will have to update your orders_colors.tpl file to account for V4 changes. Code:
{* $Id: orders_colors.tpl,v 2.0 2004/10/31 01:27:28 ADPBoss Exp $ *} Please also note that no status colour has been set for Declined "D". You can just copy one of the if statements and add your own. I will follow up with product colour mod as soon as possible. |
All times are GMT -8. The time now is 01:24 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.