Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

List orders by User Group Rate Topic   - - - - -

 
  • mikee
  • Senior Member
  • Members
  • Join Date: 20-Jul 09
  • 137 posts

Posted 30 January 2010 - 01:54 PM #1

Hi,

Would anyone know how to make a modification that would allow me to make a search for any orders placed by a particular User Group? I have read this thread, which has a similar modification http://forum.cs-cart...ead.php?t=14597. This is the code that was suggested to display orders by 'Shipping Method' :


Open the "controllers/admin/orders.php" file and find the following code:


PHP Code:

elseif ($mode == 'manage') {

list($orders, $search, $totals) = fn_get_orders($params, Registry::get('settings.Appearance.admin_orders_per_page'), true);


add this code below:
PHP Code:

if (!empty($orders)){

foreach ($orders as $k => $v) {

$order_info = fn_get_order_info($v['order_id']);
$o_id = $v['order_id'];
if (!empty($order_info)){
foreach ($order_info as $a => $B){
if ($a=='shipping'){

foreach ($b as $ship => $shipping){

$ship_order[] = array (

'o_id' => $o_id,
'shipping' => $shipping['shipping'],
'carrier' => (isset($shipping['carrier'])? $shipping['carrier'] : "No carrier")
);

}
}

}
}
}
if (isset($ship_order)){
$view->assign('ship_order', $ship_order);
}
}
Open the "skins/basic/admin/views/orders/manage.tpl" file.

Find the following code:
PHP Code:

<td class="center">
<input type="checkbox" name="order_ids[]" value="{$o.order_id}" class="checkbox cm-item" /></td>
<td>
<a href="{$index_script}?dispatch=orders.details&order_id={$o.order_id}" class="underlined"> <strong>#{$o.order_id}</strong> </a>

and add the following code below, you can change it to appear how you like:
PHP Code:

{foreach from=$ship_order item="ship"}
{if $ship.o_id eq $o.order_id}
{if $ship.shipping}
<p >
<label>{$lang.shipping}:{$ship.shipping}</label>
</p>
{/if}
{if $ship.carrier }
<p >
<label>{$lang.carrier}:{$ship.carrier}</label>
</p>
{/if}
{/if}
{/foreach}

Any help would be much appreciated.

Thanks

Mike

 
  • scase
  • Senior Member
  • Members
  • Join Date: 19-Dec 08
  • 294 posts

Posted 30 January 2010 - 06:20 PM #2

I would love this ability, too! I am not on 2.0.12, though, so still have memberships and not user groups. I may have to wait until I upgrade but would still like this mod.

Stephanie

 
  • mikee
  • Senior Member
  • Members
  • Join Date: 20-Jul 09
  • 137 posts

Posted 30 January 2010 - 06:37 PM #3

I have 2.0.10, which has User groups so you don't need to upgrade all the way to 2.0.12. In my case, i have a seperate User group for customers that have a credit account with me, and therefore don't need to pay by credit card at checkout. I need to invoice them at the end of each month, so it would be very useful to be able to find their orders easily!

 
  • jobosales
  • Senior Member
  • Members
  • Join Date: 04-Nov 06
  • 3114 posts

Posted 30 January 2010 - 09:01 PM #4

What I would like to see implemented is the ability to set the order status for each payment type. You would then be able to, for instance, have a 'Purchase order' payment method which could set the order status to 'On account'. Then you could use the existing order status search in the advanced orders to find these orders and also have visibility in the current order status fields.

This would be much better than lumping everything into 'Open' status as you could then establish appropriate workflows for different payment methods (e.g., confirming Paypal payment amounts).

Bob
CS-Cart 2.0.14 (testing)

 
  • mikee
  • Senior Member
  • Members
  • Join Date: 20-Jul 09
  • 137 posts

Posted 30 January 2010 - 09:18 PM #5

I agree Bob, that would be very useful. At the moment i have to change the Order Status manually, and this can be dangerous in case i accidentally set to the wrong status, and also cumbersome.