Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach($order->getAllVisibleItems() as $key => $item){
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
- $price = $item->getPrice();
- $valor_comissao = (int)$product->getAttributeText('comissao_vendedor')/100;
- $comissao_valor2 = $price-($price*$valor_comissao);
- $qty = $item->getQtyOrdered();
- $valor_pedido = ($price*$qty);
- if($valor_pedido > 150) {
- $comissao_valor = ($comissao_valor2*$qty-17);
- } else {
- $comissao_valor=($comissao_valor2*$qty-2);
- }
- $comissoes[] = array (
- 'Razao' => 'Produto '.$item->getName().' id '.$item->getProductId().' x '.$item->getQtyToInvoice().' sku: '. $item->getSku(),
- 'LoginMoIP' => $product->getAttributeText('loginmoip'),
- 'ValorFixo' => $comissao_valor
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement