Displaying shipping info on products with Views + EVA field

We recently built a Drupal Commerce based site and wanted to include automated shipping information along with the product's display. There's a number of ways that could be done, but since we use taxonomy terms to set a shipping category for each product (used in turn to determine which shipping calculation rules the product should fire) it made sense to lever the term's name and description field and call that data back into the product's node display in the desired way.

So, we constructed a "Commerce product" type view that does the following:
- takes the nid of the product it appears on;
- uses this to determine which shipping tid is in use;
- uses that to return the name and description fields;

One of the things that required a little thought is the relationships (in order to be able to access the node and term data). We needed:

- Commerce product: shipping category (ie the term reference field we use for setting the shipping category on each product);
- Commerce product: referencing node (ie the node (nid) of type product display which the actual Commerce product appears);

We could then access the terms data (name and description) as fields.

In order to get the right tid for the right nid we needed to add a contextual filter of type Content:nid (using the referencing node relationship) and setting as default value "content id from url". Test by passing a known nid through the argument/preview.

The query should look something like this:

SELECT taxonomy_term_data_field_data_field_shipping_category.name AS taxonomy_term_data_field_data_field_shipping_category_name, taxonomy_term_data_field_data_field_shipping_category.vid AS taxonomy_term_data_field_data_field_shipping_category_vid, taxonomy_term_data_field_data_field_shipping_category.tid AS taxonomy_term_data_field_data_field_shipping_category_tid, taxonomy_term_data_field_data_field_shipping_category__taxonomy_vocabulary.machine_name AS taxonomy_term_data_field_data_field_shipping_category__taxon, taxonomy_term_data_field_data_field_shipping_category.description AS taxonomy_term_data_field_data_field_shipping_category_descri, taxonomy_term_data_field_data_field_shipping_category.format AS taxonomy_term_data_field_data_field_shipping_category_format
{commerce_product} commerce_product
LEFT JOIN {field_data_field_shipping_category} field_data_field_shipping_category ON commerce_product.product_id = field_data_field_shipping_category.entity_id AND (field_data_field_shipping_category.entity_type = 'commerce_product' AND field_data_field_shipping_category.deleted = '0')
LEFT JOIN {taxonomy_term_data} taxonomy_term_data_field_data_field_shipping_category ON field_data_field_shipping_category.field_shipping_category_tid = taxonomy_term_data_field_data_field_shipping_category.tid
LEFT JOIN {field_data_field_product} field_data_field_product ON commerce_product.product_id = field_data_field_product.field_product_product_id
LEFT JOIN {node} field_product_commerce_product ON field_data_field_product.entity_id = field_product_commerce_product.nid
LEFT JOIN {taxonomy_vocabulary} taxonomy_term_data_field_data_field_shipping_category__taxonomy_vocabulary ON taxonomy_term_data_field_data_field_shipping_category.vid = taxonomy_term_data_field_data_field_shipping_category__taxonomy_vocabulary.vid
WHERE (( (field_product_commerce_product.nid = '157' ) )AND(( (commerce_product.type IN ('product')) )))

The view UI looks like this:

Then to provide the result as an EVA field... add this display type, set bundle to node, argument to id and attach to your product display. The field will now be available on the product display's display fields and you can order accordingly. Here's how we have chosen to present it: