X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   per product status (https://forum.x-cart.com/showthread.php?t=49992)

amy2203 10-02-2009 04:03 AM

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

amy2203 10-02-2009 04:09 AM

Re: per product status
 
1 Attachment(s)
order_info attached


All times are GMT -8. The time now is 03:50 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.