Skip to content

Commit 10247cd

Browse files
committed
chore: bring in admin url and product meta onto items collection
1 parent 8fa721a commit 10247cd

File tree

1 file changed

+14
-0
lines changed
  • src/app/code/community/Zendesk/Zendesk/Helper

1 file changed

+14
-0
lines changed

src/app/code/community/Zendesk/Zendesk/Helper/Data.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,12 +589,19 @@ public function getOrderDetailBasic($order)
589589
foreach($order->getItemsCollection(array(), true) as $item) {
590590
$itemWithTax = $item->getRowTotal();
591591
$itemTax = $item->getTaxAmount();
592+
593+
$productId = $item->getProductId();
594+
$product = Mage::getModel('catalog/product')->load($productId);
595+
596+
$adminUrl = $urlModel->getUrl('adminhtml/zendesk/redirect', array('id' => $productId, 'type' => 'product'));
597+
592598
$orderInfo['relationships']['items']['data'][] = array(
593599
'type' => 'order_item',
594600
'id' => $item->getItemId(),
595601
'product_id' => $item->getProductId(),
596602
'name' => $item->getName(),
597603
'sku' => $item->getSku(),
604+
'url' => $adminUrl,
598605
'quantity' => intval($item->getQtyOrdered()),
599606
'refunded' => intval($item->getQtyRefunded()),
600607
'meta' => array(
@@ -606,6 +613,13 @@ public function getOrderDetailBasic($order)
606613
'timestamps' => array(
607614
'created_at' => $item->getCreatedAt(),
608615
'updated_at' => $item->getUpdatedAt(),
616+
),
617+
'product' => array(
618+
'status' => $product->getStatus(),
619+
'type' => $product->getTypeId(),
620+
'url' => $product->getUrlPath(),
621+
'image' => $product->getThumbnail(),
622+
'description' => $product->getDescription(),
609623
)
610624
)
611625
);

0 commit comments

Comments
 (0)