Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $obj = new stdClass();
- $obj->customerId = $customerid;
- $obj->scheduling = $scheduling;
- $obj->items = new stdClass();
- foreach($items as $item)
- {
- $obj->items->dimensions = array('height' => $item->getAltura(), 'width' => $item->getLargura(), 'length' => $item->getComprimento(), 'weight' => $item->getPeso());
- $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());
- }
- $obj->items->invoice = array('id' => 78861, 'key' => '35180815385717000176550010000788611662925859');
- $obj->items->trackingId = $trackingId . $this->getPedido()->getId();
- $obj->items->observation = 'Item fragil';
- print_r(json_encode($obj));
- echo '<hr>';
- print_r(json_encode($obj, true));
- die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement