Advertisement
Guest User

Untitled

a guest
Oct 11th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. $obj = new stdClass();
  2. $obj->customerId = $customerid;
  3. $obj->scheduling = $scheduling;
  4. $obj->items = new stdClass();
  5. foreach($items as $item)
  6. {
  7. $obj->items->dimensions = array('height' => $item->getAltura(), 'width' => $item->getLargura(), 'length' => $item->getComprimento(), 'weight' => $item->getPeso());
  8. $obj->items->skus = array('skuId' => $item->getProduto()->getCodigo(), 'description' => $item->getProduto()->getNome(), 'ean' => $item->getProduto()->getCodigoBarras(), 'price' => $item->getValorUnitario(), 'freight' => '0.00', 'quantity' => $item->getQuantidade());
  9. }
  10. $obj->items->invoice = array('id' => 78861, 'key' => '35180815385717000176550010000788611662925859');
  11. $obj->items->trackingId = $trackingId . $this->getPedido()->getId();
  12. $obj->items->observation = 'Item fragil';
  13.  
  14.  
  15.  
  16. print_r(json_encode($obj));
  17. echo '<hr>';
  18. print_r(json_encode($obj, true));
  19. die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement