forked from smmccabe/commerce_shipping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
commerce_shipping.module
58 lines (49 loc) · 1.6 KB
/
commerce_shipping.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* @file
* Contains commerce_shipping.module..
*/
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
/**
* Implements hook_help().
*/
function commerce_shipping_help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
// Main module help for the commerce_shipping module.
case 'help.page.commerce_shipping':
$output = '';
$output .= '<h3>' . t('About') . '</h3>';
$output .= '<p>' . t('Handles shipping and fulfilment for Drupal Commerce') . '</p>';
return $output;
default:
}
}
/**
* Adds the default shipment items field to the shipment.
*
* Shipment items can't be a base field because the Views integration is broken.
* Instead, it is created as a configurable field for the shipment.
*
*/
function commerce_shipping_add_shipment_item_field() {
//Evan you can probably use this for refernce to some stuff you might need to add for this
/*$view_display = commerce_get_entity_display('commerce_order', $shipment->id(), 'view');
$view_display->setComponent('line_items', [
'type' => 'commerce_line_item_table',
'weight' => 0,
]);
$view_display->save();
$form_display = commerce_get_entity_display('commerce_order', $shipment->id(), 'form');
$form_display->setComponent('line_items', [
'type' => 'inline_entity_form_complex',
'weight' => 0,
'settings' => [
'override_labels' => TRUE,
'label_singular' => 'line item',
'label_plural' => 'line items',
],
]);
$form_display->save();*/
}