Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

per product status

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 10-02-2009, 04:03 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default per product status

i've modded xcart to have a per product status, now it doesn't touch stock etc, just gives me a text area to add any notes about a product, or a tick box if it's shipped.

this way I can either tick the box if it shipped in full, or for example, "2of3 shipped, 1 refunded via PayPal" to make it clear to customers.

mods to make:

database:

add two columns to the xcart_order_details table:
status (type=text)
shipped (type=int)

file edits:
func.order.php
approx line 211 - make the query
Code:
$products = func_query("SELECT $sql_tbl[order_details].itemid, $sql_tbl[products].*, $sql_tbl[order_details].*, IF($sql_tbl[products].productid IS NULL, 'Y', '') as is_deleted, IF($sql_tbl[order_details].product = '', $sql_tbl[products].product, $sql_tbl[order_details].product) as product $fields, manufacturer, $sql_tbl[order_details].status, $sql_tbl[order_details].shipped

this will pull the data from the new columns whenever the product details are queried, so they can be displayed etc

order.php
add the following after x_load('mail','order');
Code:
#update product statuses if ( is_array($prodstatus)) { foreach ($prodstatus as $product) { $qps="UPDATE $sql_tbl[order_details] SET status = '".$product[status]."', shipped='"; if($product[shipped] == 'on') { $qps .="1"; } $qps .="' WHERE productid = '".$product[productid]."' AND orderid='".$orderid."'"; db_query($qps); } }

then you need to edit your templates.
order_data.tpl
I've added a column to the products table, that displays the info. The code I use in the section loop is
[code]
<td>{if $product.shipped eq 1}Shipped{else} {$product.status}{/if}</td>

you also need to edit your order_info.tpl to display the data, and to add/edit the data. Mine is heavily modified so I'll post it here in full:
(next post - this one was too long)


I *think* that's it. Basically, when looking at the order in admin, I can tick the shipped box, or I can type into the box, and hit the update button just under the product list. those details are then displayed in the invoice that is printed out.

Just fyi, I have another invoice that I call packing list, that we print off first. It's a packing list format that prints onto a sheet that includes a label, so the address label is there, and we can tick off the products as we pick them. so once the order is picked etc, the address label is ready, and we have a recoed of what's picked. We can then update the order using this mod, and print the invoice to put into the box, which will have any notes about refunded items etc on it.

hth
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #2  
Old 10-02-2009, 04:09 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default Re: per product status

order_info attached
Attached Files
File Type: tpl order_info.tpl (16.2 KB, 72 views)
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:15 PM.

   

 
X-Cart forums © 2001-2020