Product Slideshow Block

Contrib type: 
Code/CSS Snippet
Status: 
awaiting

Downloads


Compatibility: 
Ubercart 1.x

Here is a pretty simple view setup that allows for a rotating slideshow block to be placed on your site. I imagine this would be great for showing off featured products, specials, etc. For the purposes of this demonstration, I overrode the default "products" page that Views installs. I also added a preset in imagecache called "slideshow_image" so that I could resize my product images to the correct dimensions. Please note that this code requires:

Views
Views_slideshow (plugin)
Imagecache

Here's the code from the export:

  $view = new stdClass();
  $view->name = 'products';
  $view->description = 'products';
  $view->access = array (
);
  $view->view_args_php = '';
  $view->page = FALSE;
  $view->page_title = 'Products';
  $view->page_header = '';
  $view->page_header_format = '1';
  $view->page_footer = '';
  $view->page_footer_format = '1';
  $view->page_empty = '';
  $view->page_empty_format = '1';
  $view->page_type = 'node';
  $view->url = 'products';
  $view->use_pager = TRUE;
  $view->nodes_per_page = '10';
  $view->menu = TRUE;
  $view->menu_title = 'Products View';
  $view->menu_tab = FALSE;
  $view->menu_tab_weight = '0';
  $view->menu_tab_default = FALSE;
  $view->menu_tab_default_parent = NULL;
  $view->menu_tab_default_parent_type = 'tab';
  $view->menu_parent_tab_weight = '0';
  $view->menu_parent_title = '';
  $view->block = TRUE;
  $view->block_title = 'Product Slideshow';
  $view->block_header = '';
  $view->block_header_format = '1';
  $view->block_footer = '';
  $view->block_footer_format = '1';
  $view->block_empty = '';
  $view->block_empty_format = '1';
  $view->block_type = 'slideshow_list';
  $view->nodes_per_block = '3';
  $view->block_more = FALSE;
  $view->block_use_page_header = FALSE;
  $view->block_use_page_footer = FALSE;
  $view->block_use_page_empty = FALSE;
  $view->sort = array (
    array (
      'tablename' => 'uc_products',
      'field' => 'ordering',
      'sortorder' => 'ASC',
      'options' => '',
    ),
    array (
      'tablename' => 'node',
      'field' => 'title',
      'sortorder' => 'ASC',
      'options' => '',
    ),
  );
  $view->argument = array (
  );
  $view->field = array (
    array (
      'tablename' => 'node_data_field_image_cache',
      'field' => 'field_image_cache_fid',
      'label' => '',
      'handler' => 'content_views_field_handler_ungroup',
      'options' => 'slideshow_image_linked',
    ),
  );
  $view->filter = array (
    array (
      'tablename' => 'node',
      'field' => 'status',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
    array (
      'tablename' => 'uc_products',
      'field' => 'is_product',
      'operator' => '=',
      'options' => '',
      'value' => '1',
    ),
  );
  $view->exposed_filter = array (
  );
  $view->requires = array(uc_products, node, node_data_field_image_cache);
  $views[$view->name] = $view;

To use this, go to the "Import" function in views administration.

I'm new to UC and this is my first contribution so feedback is encouraged and appreciated.

-David

shiva's picture
Offline
Joined: 05/03/2008
Juice: 11
Re: Product Slideshow Block

Its a nice contribution. I was planning to use http://drupal.org/project/slideshow when I come across this contribution. Is it possible to see any demo ? is it compatible with RC4 ?

himagarwal's picture
Offline
Joined: 06/24/2008
Juice: 302
Re: Product Slideshow Block

I'm getting this problem in Ubercart 1.0

You don't seem to have the following requirements: node_data_field_image_cache
mitchell_ad027's picture
Offline
Joined: 11/13/2008
Juice: 17
Re: Product Slideshow Block

Where could I find this so-called "Views_slideshow" plugin??

Thanks!

manatwo's picture
Offline
Joined: 02/19/2008
Juice: 235
Re: Re: Product Slideshow Block

drupal.org/project/views_slideshow

buysnakewine's picture
Offline
Joined: 03/31/2009
Juice: 105
Best way to show products in a slideshow ?

Hi,

Can you confirm that this module is the best choice to show a slideshow of products on the homepage of the shop ?

Thanks.