Skip to content

Commit

Permalink
Merge pull request #36 from onedesign/remove-direct-purchasables-refe…
Browse files Browse the repository at this point in the history
…rence

Find SKU through snapshot rather than purchasable
  • Loading branch information
mkornatz authored Sep 7, 2017
2 parents bf4bfd4 + eaeabec commit b406adf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/OneShipStation_XmlService.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function items(\SimpleXMLElement $xml, $items, $name='Items') {
public function item(\SimpleXMLElement $xml, Commerce_LineItemModel $item, $name='Item') {
$item_xml = $xml->getName() == $name ? $xml : $xml->addChild($name);

$item_mapping = ['SKU' => ['callback' => function($item) { return $item->getPurchasable()->sku; }],
$item_mapping = ['SKU' => ['callback' => function($item) { return $item->snapshot['sku']; }],
'Name' => 'description',
'Weight' => ['callback' => function($item) { return round($item->weight, 2); },
'cdata' => false],
Expand Down

0 comments on commit b406adf

Please sign in to comment.