Hallo,
da ich bisher sehr viel von diesem Forum profitiert habe, möchte ich heute etwas zurückgeben. Unten seht Ihr den Code für ein Modul, das die komplette Mehrwertsteuer (inkl. gesetzl. Mwst.) also nicht nur die einzelnen Beträge im Warenkorb anzeigt.
Die Preise für Summe Artikel, Rabatt, Gutschein, Versandkosten, Zahlart auf dem Bild sind Bruttopreise
[B]INSTALLATION[/B]
neue Datei:
[B]/modules/vat_basket.php[/B]
<?php
class vat_oxBasket extends vat_oxBasket_parent
{
/**
* Returns formatted complete VAT including all taxes
*
* @return string
*/
public function getFCompleteVAT(){
return oxLang::getInstance()->formatCurrency( $this->getPrice()->getBruttoPrice() - $this->_getNettoPrice(), $this->getBasketCurrency() );
}
/**
* Returns formatted netto price without VAT
*
* @return string
*/
public function getFNettoPrice(){
return oxLang::getInstance()->formatCurrency($this->_getNettoPrice() ,$this->getBasketCurrency() );
}
/**
* Returns netto price
*
* @return double
*/
protected function _getNettoPrice(){
//Get Netto Delivery costs
$dNetPrice = $this->getCosts( 'oxdelivery' )->getNettoPrice();
//Get Netto Payment costs
$dNetPricePay = $this->getCosts( 'oxpayment' )->getNettoPrice();
//Get Netto Wrap costs
$dWrappNet = $this->getCosts( 'oxwrapping' )->getNettoPrice();
return ($this->getDiscountedNettoPrice() + $dNetPrice + $dNetPricePay + $dWrappNet);
}
}
[B]/modules/metadata.php[/B]
$aModule = array(
'id' => 'complete_vat',
'title' => 'Complete VAT',
'description' => 'Module to show complete VAT in Basket.',
'thumbnail' => '',
'version' => '1.0',
'author' => '',
'extend' => array(
'oxbasket' => 'complete_vat/vat_oxbasket'
)
);
bei OXID Version < 4.6 muss im Adminberich das Modul registriert werden:
'oxbasket' => 'complete_vat/vat_oxbasket'
[B]Dateiänderungen:[/B]
[B]/out/azure/tpl/page/checkout/inc/basketcontents.tpl[/B]
über dem [{block name=“checkout_basketcontents_grandtotal_vat”}] folgendes einfügen:
[{block name="checkout_basketcontents_grandtotal_vat"}]
<tr>
<th>[{ oxmultilang ident="PAGE_CHECKOUT_BASKETCONTENTS_GRANDTOTAL_VAT" }]</th>
<td style="font-weight:normal">[{ $oxcmp_basket->getFCompleteVAT() }] [{ $currency->sign }]</td>
</tr>
[{/block}]
[B]/out/azure/de/cust_lang.php[/B]
folgendes einfügen:
'PAGE_CHECKOUT_BASKETCONTENTS_GRANDTOTAL_VAT' => "inkl. gesetzl. Mwst."
PS: Ich habe das Modul nicht in Exchange geladen, da ich noch keine Zeit gefunden habe mich damit zu beschäftigen.