function commerce_ss_line_item_sku in Commerce Stock 7.2
Helper function to get product SKU from line item.
Parameters
array $line_item: The cart line item for which to return a product SKU.
2 calls to commerce_ss_line_item_sku()
- commerce_ss_decrease_by_line_item in modules/
commerce_ss/ commerce_ss.rules.inc - Subtracts from stock the sold amount in a line item.
- commerce_ss_increase_by_line_item in modules/
commerce_ss/ commerce_ss.rules.inc - Adds the sold amount in a line item to stock.
File
- modules/
commerce_ss/ commerce_ss.rules.inc, line 166 - Rules integration for Commerce Simple Stock.
Code
function commerce_ss_line_item_sku($line_item) {
$line_item_wrapper = entity_metadata_wrapper('commerce_line_item', $line_item);
return $line_item_wrapper->commerce_product->sku
->value();
}