daily pastebin goal
57%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top