Hi

Great module. I want to create a view showing "This week's discounted products" or something similar.

Any plan to integrate the module with Views?

Thanks

Glenn

Comments

glennnz’s picture

Ah, figured it out.

I've used a Taxonomy term and the CCK fields to create my View.

Glenn

ryangroe’s picture

Status: Active » Closed (fixed)

Great. I'm glad you have it working. If you have anymore questions let me know.

a_lawry’s picture

Hi,

I am trying to do exactly the same thing. Can you tell me how it's done or just point me in the right direction?

Thanks for the help.

Andrew

ryangroe’s picture

The easiest thing would be to message glennnz and ask him to send you an export of his view.

cleverhoods’s picture

and for god's sake share with us the information... 'cause i simply cannot use the altered fields as FILTER... somehow i cant find them :(

glennnz’s picture

Here is my View export. It uses Views Slideshow to create a block with a What's Hot product list, which slideshows through the products which have sold plenty.

$view = new view;
$view->name = 'popular_products';
$view->description = 'Popular products';
$view->tag = 'product';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'title' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'html' => 0,
    ),
    'link_to_node' => 1,
    'exclude' => 0,
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'relationship' => 'none',
  ),
  'field_image_cache_fid' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'link_to_node' => 0,
    'label_type' => 'none',
    'format' => 'product_linked',
    'multiple' => array(
      'group' => 0,
      'multiple_number' => '',
      'multiple_from' => '',
      'multiple_reversed' => 0,
    ),
    'exclude' => 0,
    'id' => 'field_image_cache_fid',
    'table' => 'node_data_field_image_cache',
    'field' => 'field_image_cache_fid',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'sell_price' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 1,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'sell_price',
    'table' => 'uc_products',
    'field' => 'sell_price',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'discounted_price' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => 'Now [discounted_price]',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'discounted_price',
    'table' => 'uc_products',
    'field' => 'discounted_price',
    'override' => array(
      'button' => 'Override',
    ),
    'relationship' => 'none',
  ),
  'buyitnowbutton' => array(
    'label' => '',
    'alter' => array(
      'alter_text' => 0,
      'text' => '',
      'make_link' => 0,
      'path' => '',
      'link_class' => '',
      'alt' => '',
      'prefix' => '',
      'suffix' => '',
      'help' => '',
      'trim' => 0,
      'max_length' => '',
      'word_boundary' => 1,
      'ellipsis' => 1,
      'strip_tags' => 0,
      'html' => 0,
    ),
    'exclude' => 0,
    'id' => 'buyitnowbutton',
    'table' => 'uc_products',
    'field' => 'buyitnowbutton',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'random' => array(
    'id' => 'random',
    'table' => 'views',
    'field' => 'random',
  ),
));
$handler->override_option('filters', array(
  'sum_qty' => array(
    'operator' => '>=',
    'value' => array(
      'value' => '10',
      'min' => '',
      'max' => '',
    ),
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'sum_qty',
    'table' => 'uc_order_products_qty_vw',
    'field' => 'sum_qty',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Override',
    ),
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
));
$handler->override_option('cache', array(
  'type' => 'none',
));
$handler->override_option('style_plugin', 'slideshow');
$handler->override_option('style_options', array(
  'grouping' => '',
  'type' => 'ul',
  'mode' => 'single_frame',
  'hover_breakout' => 'teaser',
  'teasers_last' => 1,
  'hover' => 'hover',
  'timer_delay' => '5000',
  'sort' => '1',
  'fade' => 1,
  'fade_speed' => 'slow',
  'fade_value' => '0.25',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

Glenn

KaoszNagymester’s picture

Hi!

I get the following error by Filter, when import the code:
Error: handler for uc_order_products_qty_vw > sum_qty doesn't exist!

How can I solve this?