Skip to content

Commit

Permalink
Merge pull request #396 from myparcelnl/articlenumber-and-supplier
Browse files Browse the repository at this point in the history
Articlenumber and supplier
  • Loading branch information
Robin de Laater authored May 7, 2020
2 parents 09521b5 + 97c78ba commit 3d2cefc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
24 changes: 15 additions & 9 deletions Model/Sales/TrackTraceHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ class TrackTraceHolder
/**
* Track title showing in Magento
*/
const MYPARCEL_TRACK_TITLE = 'MyParcel';
const MYPARCEL_CARRIER_CODE = 'myparcelnl';
const ORDER_NUMBER = '%order_nr%';
const DELIVERY_DATE = '%delivery_date%';
const PRODUCT_ID = '%product_id%';
const PRODUCT_NAME = '%product_name%';
const PRODUCT_QTY = '%product_qty%';
const MYPARCEL_TRACK_TITLE = 'MyParcel';
const MYPARCEL_CARRIER_CODE = 'myparcelnl';
const ORDER_NUMBER = '%order_nr%';
const DELIVERY_DATE = '%delivery_date%';
const PRODUCT_ID = '%product_id%';
const PRODUCT_NAME = '%product_name%';
const PRODUCT_QTY = '%product_qty%';
const ARTICLE_SHORT_NAME = '%article_short_name%';
const ARTICLE_NUMBER_SUPPLIER = '%article_number_supplier%';

/**
* @var ObjectManagerInterface
Expand Down Expand Up @@ -267,14 +269,18 @@ public function getLabelDescription($magentoTrack, ?string $checkoutData): strin
self::DELIVERY_DATE,
self::PRODUCT_ID,
self::PRODUCT_NAME,
self::PRODUCT_QTY
self::PRODUCT_QTY,
self::ARTICLE_SHORT_NAME,
self::ARTICLE_NUMBER_SUPPLIER
],
[
$order->getIncrementId(),
$deliveryDate,
$this->getProductInfo($productInfo, 'product_id'),
$this->getProductInfo($productInfo, 'name'),
$this->getProductInfo($productInfo, 'qty'),
$this->getProductInfo($productInfo, 'so_kortenaam'),
$this->getProductInfo($productInfo, 'so_artikelnummerleverancier')
],
$labelDescription
);
Expand All @@ -291,7 +297,7 @@ public function getLabelDescription($magentoTrack, ?string $checkoutData): strin
private function getProductInfo(array $productInfo, string $field): ?string
{
if ($productInfo) {
return $productInfo[0][$field];
return $productInfo[0][$field] ?? '';
}

return null;
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</field>
<field id="label_description" translate="label comment" type="text" sortOrder="213" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Label description</label>
<comment>This description will appear on the shipment label. The following parts can be used: %order_nr%, %delivery_date%, %product_id%, %product_name%, %product_qty%.</comment>
<comment>This description will appear on the shipment label. The following parts can be used: %order_nr%, %delivery_date%, %product_id%, %product_name%, %product_qty%, %article_short_name%, %article_number_supplier%.</comment>
</field>
<field id="country_of_origin" translate="label comment" type="text" sortOrder="214" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Country of origin</label>
Expand Down
2 changes: 1 addition & 1 deletion i18n/nl_NL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Print settings,Print instellingen
Paper type,Print oriëntatie
Select a standard orientation for printing labels.,Selecteer een standaard print ori&euml;ntatie voor het printen van labels.
Default shipping options,Standaard verzendinstellingen
"This description will appear on the shipment label. The following parts can be used: %order_nr%, %delivery_date%, %product_id%, %product_name%, %product_qty%.","Deze beschrijving verschijnt op het verzendlabel. De volgende onderdelen kunnen worden gebruikt: %order_nr%, %delivery_date%, %product_id%, %productnaam%, %product_qty%."
"This description will appear on the shipment label. The following parts can be used: %order_nr%, %delivery_date%, %product_id%, %product_name%, %product_qty%, %article_short_name%, %article_number_supplier%.","Deze beschrijving verschijnt op het verzendlabel. De volgende onderdelen kunnen worden gebruikt: %order_nr%, %delivery_date%, %product_id%, %productnaam%, %product_qty%, %article_short_name%, %article_number_supplier%."
"Fill in your preferences for a shipment. These settings will only apply for the mass actions in the order grid. When creating a single shipment, these settings can be changed manually. These settings will activate based on the order total amount.","Vul hier uw standaard voorkeuren in voor uw verzendopties. Deze instellingen worden als default op al uw zendingen toegepast, indien van toepassing. Deze opties zijn later, per zending, uiteraard nog wel aan te passen tijdens het verwerken."
Automate 'Home address only',Automatiseer 'Alleen huisadres'
'Home address only' operates above a certain order total amount,'Alleen huisadres' wordt geactiveerd als het totaal bedrag meer is dan bovenstaande bedrag
Expand Down

0 comments on commit 3d2cefc

Please sign in to comment.