==== Hinzufügen von Versandkosten ====
Bislang wurde der PayPal Bestellung keine Versandkosten hinzugefügt. Diese Erweiterung des front.order_process.inc.php ändert das. \\
\\
\\
$total_amount += ($cart[$key]['shopprod_price'] * $cart[$key]['shopprod_quantity'] ); // my total price
}
$p->add_field('num_cart_items', ($i-1));
$p->add_field('payment_gross', $total_amount);
\\
$total_amount += ($cart[$key]['shopprod_price'] * $cart[$key]['shopprod_quantity'] ); // my total price
$subtotal['weight'] += $cart[$key]['shopprod_quantity'] * $cart[$key]['shopprod_weight']; // + q23.rst 290212 my total weight
}
// + q23.rst 29022012 calculate shipping
foreach( _getConfig( 'shop_pref_shipping', '_shopPref' ) as $item_key => $row ) {
// do nothing as long shipping fee = 0
if( $row['net'] == 0 ) {
continue;
}
$row['calculate'] = false;
// lower weight and current shipping fee lower then this
if( $subtotal['weight'] <= $row['weight'] ) {
$row['calculate'] = true;
}
if( $row['calculate'] ) {
$subtotal['shipping_net'] = $row['net'];
$subtotal['shipping_gross'] = $subtotal['shipping_net'] * ( 1 + ($row['vat'] / 100) );
$subtotal['shipping_vat'] = $subtotal['shipping_gross'] - $subtotal['shipping_net'];
break;
}
}
// + q23.rst 29022012 now add shipping cost to ipn
$p->add_field('item_number_' . $i, 'Versand');
$p->add_field('item_name_' . $i, 'DHL Paket');
$p->add_field('quantity_' . $i, '1');
$p->add_field('amount_' . $i, $subtotal['shipping_net']);
$p->add_field('num_cart_items', ($i)); // + q23.rst 290212 remove -1 because of shipping
//$p->add_field('payment_gross', $total_amount);