I am using the domain module to run multiple stores from one ubercart install. I need to create a sales report per domain. I've tried to copy the 'zone' filter and field code and replace the data with the values from the domain and uc_domain_orders tables, but so far I have not been successful. No errors but my new filter and field are not showing up. Any pointers?

CommentFileSizeAuthor
#5 677790-uc_domain-dev-filter_by_domain-1.patch926 bytesEKM

Comments

madsph’s picture

Cleraing views cache sometimes help. Other than that I think I need a little more information about what you are doing to give a better answer.

jday’s picture

Title: Add a fiter for domain » Add a filter for domain

Yes thanks for the reminder about cache and my apologies for the incomplete call for help. But I think I've got it!
with the domain_access module (which comes with it's own views) and the uc_views module enabled, I've added this to a custom module:

/*******************************************************************************
 * Add custom views filter: implementation of hook_views_data
 ******************************************************************************/

function uc_mymodule_views_data() {
  $data['uc_domain_orders']['table']['join']['uc_orders'] = array(
  'left_field' => 'order_id',
  'field' => 'order_id',
  );
  
  $data['uc_domain_orders']['domain_id'] = array(
    'title' => t('Store Domain'),
    'help' => t('The store from which the order was placed'),
    'filter' => array(
      'handler' => 'domain_views_handler_filter_domain_domain_id',
    ),
  );
  
  return $data;

}

flushed the cache and I now have a domain filter on ubercart orders

madsph’s picture

Status: Active » Closed (fixed)

Sounds cool :-D

seddonym’s picture

See http://drupal.org/node/810048 for a snippet that provides fields, rather than filters. Also it will allow you to put in the Domain sitename.

EKM’s picture

Version: 6.x-3.x-dev » 6.x-1.x-dev
StatusFileSize
new926 bytes

I've written a patch that applies to the current DEV head ( 6.x-1.x-dev ) so that we can use this as a normal filter on ubercart orders with adding custom filters in other modules, might be useful to add to the upstream if someone has the time.