2

I'm using the Drupal Commerce module, and there is no "Latest products" block.
I am trying to make a "Latest Products" view, but the images of the products are not visible in the view; however, the titles are OK.

screenshot

Here is the field that I choose for the product.

screenshot

What am I missing? I suspect of the permissions but I could not find any Permission except these two.

screenshot


This is the exported code of the view I am using.

$view = new view;
$view->name = 'latest_products';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Latest products';
$view->core = 7;
$view->api_version = '3.0';
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Master */
$handler = $view->new_display('default', 'Master', 'default');
$handler->display->display_options['title'] = 'Latest products';
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['query']['type'] = 'views_query';
$handler->display->display_options['query']['options']['query_comment'] = FALSE;
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'some';
$handler->display->display_options['pager']['options']['items_per_page'] = '2';
$handler->display->display_options['pager']['options']['offset'] = '0';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['label'] = '';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 0;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 0;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 1;
/* Field: Field: Image */
$handler->display->display_options['fields']['field_image']['id'] = 'field_image';
$handler->display->display_options['fields']['field_image']['table'] = 'field_data_field_image';
$handler->display->display_options['fields']['field_image']['field'] = 'field_image';
$handler->display->display_options['fields']['field_image']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['absolute'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['external'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['replace_spaces'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['trim_whitespace'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['nl2br'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['field_image']['alter']['more_link'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['trim'] = 0;
$handler->display->display_options['fields']['field_image']['alter']['html'] = 0;
$handler->display->display_options['fields']['field_image']['element_label_colon'] = 1;
$handler->display->display_options['fields']['field_image']['element_default_classes'] = 1;
$handler->display->display_options['fields']['field_image']['hide_empty'] = 0;
$handler->display->display_options['fields']['field_image']['empty_zero'] = 0;
$handler->display->display_options['fields']['field_image']['hide_alter_empty'] = 1;
$handler->display->display_options['fields']['field_image']['click_sort_column'] = 'fid';
$handler->display->display_options['fields']['field_image']['settings'] = array(
  'image_style' => 'thumbnail',
  'image_link' => '',
);
$handler->display->display_options['fields']['field_image']['field_api_classes'] = 0;
/* Sort criterion: Content: Post date */
$handler->display->display_options['sorts']['created']['id'] = 'created';
$handler->display->display_options['sorts']['created']['table'] = 'node';
$handler->display->display_options['sorts']['created']['field'] = 'created';
$handler->display->display_options['sorts']['created']['order'] = 'DESC';
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['value'] = 1;
$handler->display->display_options['filters']['status']['group'] = 1;
$handler->display->display_options['filters']['status']['expose']['operator'] = FALSE;

/* Display: Latest Products Block */
$handler = $view->new_display('block', 'Latest Products Block', 'block');
$handler->display->display_options['block_description'] = 'Latest products Block'; 

I looked at the source of the page but the image is not rendered.

screenshot


My problem is with the content type. There are 2 types: Product display, and Product.

When I look at the content types, the actual "Product" is not there.

screenshot

The actual images are stored in the Entity "Product" which is referenced here as "Product Reference" thats why I cant see the images in my view.

screenshot

I tried with a dummy content type(including images) without problems I see the images in my view.

Now my question is; How can I choose the images from the Entity Product while listing the "Product Display" type in my view?

These are the screenshots while creating the view.

screenshot

screenshot

When I add the fields, the image seems empty.

screenshot

screenshot

screenshot

1
  • You can post images using the post editor. Avoid adding links to external images.
    – avpaderno
    Commented Apr 8, 2012 at 8:51

3 Answers 3

3

I found the answer, it was the relationships
I needed to use Relationship in order to select images of Product(not of Product Display)

set relationStep1

set relationStep2

Then select the relation while choosing the image field
choose Relation

3
  • I gave no access permission to the View but the View is only Visible to Administrators, another problem, I cant find make the View visible to anonymous and authenticated users :( link access
    – wallace740
    Commented Apr 9, 2012 at 14:25
  • People-> Permissions. I needed to give access to Any Products to Anonymous en Authenticated roles as well
    – wallace740
    Commented Apr 10, 2012 at 19:37
  • They've made Commerce impossible to use unless you use Commerce Kickstart. It's sad because it's such an exciting idea, but the usability is low and don't expect anything to be intuitive at all. I guess the idea was to provide an eCommerce solution that promotes paid services instead of open source.
    – o_O
    Commented Feb 19, 2013 at 7:39
1

Make sure the public directory for image uploading is writable, dblog will tell you if there is a problem with that.

0

Try going through the HTML to see whether a path to the image is printed out.

You can copy-paste the HTML in a text file and attach it here for us to see. Also, export your view and attach that also to your post.

2
  • Requests for more information from the person asking a question should be a comment, not an answer. Commented May 3, 2012 at 4:16
  • Unfortunately I am not allowed to post a comment on one's question yet.
    – dom
    Commented May 16, 2012 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.