Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. foreach($order->getAllVisibleItems() as $key => $item){
  2. $product = Mage::getModel('catalog/product')->load($item->getProductId());
  3. $price = $item->getPrice();
  4. $valor_comissao = (int)$product->getAttributeText('comissao_vendedor')/100;
  5. $comissao_valor2 = $price-($price*$valor_comissao);
  6. $qty = $item->getQtyOrdered();
  7. $valor_pedido = ($price*$qty);
  8.  
  9. if($valor_pedido > 150) {
  10. $comissao_valor = ($comissao_valor2*$qty-17);
  11. } else {
  12. $comissao_valor=($comissao_valor2*$qty-2);
  13. }
  14. $comissoes[] = array (
  15. 'Razao' => 'Produto '.$item->getName().' id '.$item->getProductId().' x '.$item->getQtyToInvoice().' sku: '. $item->getSku(),
  16. 'LoginMoIP' => $product->getAttributeText('loginmoip'),
  17. 'ValorFixo' => $comissao_valor
  18. );
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement