Uses the megarow pattern to provide a "Quick Edit" link in the view, that shows all product variations for that product display, right underneath the triggering row. The status and price can be modified directly.

The view used to display the product variations under a product display line is "commerce_backoffice_product_variations" which has a relation only for "product" product variations and not for custom product variation types.

I posted a ticket here to:
http://www.drupalcommerce.org/discussions/6870/administration_view_custo...

Comments

jsacksick’s picture

Priority: Major » Normal

There's no explicit check for the "product" Commerce product type, the potential issue that you could have could be because you're using a different product reference field (You should better use the default field_product instead).

bojanz’s picture

Category: bug » support
Status: Active » Fixed
zet’s picture

Category: support » bug
Priority: Normal » Major
Status: Fixed » Active

And how is this fixed or a support request ?

please check in commerce_backoffice_product.module file how the commerce_backoffice_product_variations view is attached for the product displays.

/**
* Displays a view of products referenced from the given node, in a megarow.
*/
function commerce_backoffice_product_variations_view($node) {
  $title = t('Variations for product %title', array('%title' => $node->title));
  $output = views_embed_view('commerce_backoffice_product_variations', 'default', $node->nid);

  return views_megarow_display($title, $output, $node->nid);
}

If I manually change that to : $output = views_embed_view('my_custom_product_variation_view',[...] then my specific custom product variant is attached ok to my custom product display.

BUT this should be extended to work with more than one view or just some specific machine name of some field or view ! (I'm not sure which is the upper root of this limitation)

If not, you should specify with caps on the drupal commerce kickstart distribution and this project page that it's supposed to work with just the defaults "X, Y and... " of some view name / field name/ content type name/ product variation name

zet’s picture

Also, while playing with some new views of my custom product displays, I noticed the issue it's related just to the quick edit button (the one that appears after the checking of "Add the quick edit link for product displays." on Content: Operations links (Dropbutton)). The simple edit button works well, but opens the custom product display edit page with the product variants just in a new loaded page and not in the nice ajaxified attached product variants view of megarow.

and I see this code in commerce_backoffice_handler_field_node_operations.inc line37, but i don't really understand it

 // Add the quick-edit link which opens the megarow.
     if ($this->options['add_quick_edit']) {
       $quick_edit['quick-edit'] = menu_get_item('commerce_backoffice/variations/' . $nid);
       $quick_edit['quick-edit']['title'] = t('Quick edit');
       $quick_edit['quick-edit']['attributes']['class'] = 'views-megarow-open';
       $links = array_merge($quick_edit, $links);
     }
 
jsacksick’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Fixed

I don't know what you're doing, I created a new variation type "test" with his matching product display type "test".
Then I created a new product display of that type with a variation and it appears in the view...

http://cl.ly/image/1w3x223E0b0s

zet’s picture

Category: support » bug
Status: Fixed » Active

Is it supposed to be the same name/machine name for product display types and their associated product variants ? Then I guess this is a very important thing that must be clearly stated in the documentation!
Try this : test it by creating a custom product variation type named "test" or "test variants" and uncheck "Create matching product display type"
Then refer it (link it) mannualy in the custom product display type named "Test Display".

jsacksick’s picture

Category: bug » support
Status: Active » Fixed

Well it's not a bug then, if you uncheck "Create matching product display type" for sure we won't be able to know which product display type to configure.
Commerce Backoffice defines some defaults settings for the product display type you're creating using it's help... not for others.

zet’s picture

Component: Code » User interface
Category: support » bug
Status: Fixed » Active

For sure is not a support request neither.
And I don't really understand why you keep "fixing" this issue, since it's a specific issue, reported for a specific use case, by a specific user, different than you, which is in this case... me. You can close it with "won't fix" status maybe, but for sure is not fixed neither.

I'm not sure what you mean by :

if you uncheck "Create matching product display type" for sure we won't be able to know which product display type to configure.

..., as I'm sure I will be able to know which product display type to configure, if I am adding the Product variation reference to the product display myself.

Commerce Backoffice defines some defaults settings for the product display type you're creating using it's help...

..So can I infer by this that the "Create matching product display type" checkbox on the "Add product variation type" page ( admin/commerce/config/product-variation-types/add ) is added by Commerce Backoffice ? Please confirm if so, and then remove that "optional" creation of a product display with the same name for every new created product variation type, force this product display creation, and just inform the user that a product display content type (with the same name) will be created in order for commerce backoffice to function properly.

Until then, I consider it a bug, which just confuses the users that want to have different names for the product displays and their referenced product variations.

zet’s picture

Issue summary: View changes

cite -> blockquote