Einzelnen Beitrag anzeigen
  #2  
Alt 13.07.07, 15:11
Benutzerbild von christiana83
christiana83 christiana83 ist offline
Forum Stammgast
 
Registriert seit: 04.07.06
Ort: Gotha
Alter: 25
Beiträge: 399
christiana83 eine Nachricht über ICQ schicken christiana83 eine Nachricht über Skype™ schicken

Hi,

also mit dem TS:
Typoscript-Code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
plugin.tt_products.shipping {

radio = 1
10.title =Nachname
10.image.file =
10.price.1 = 12.90
10.calculationScript = fileadmin/scripts/products_calcScript.inc
10.price.type = count
10.percentOfTotalShipping = 0

}

stellst du nur die Versandoptionen ein. Quasi, dass Nachnahme 12,90 nochmal auf den Gesamtpreis addieren soll in diesem Beispiel.

dann gibts im Ordner t3conf/ext/tt_products/pi noch ein Berechnungsscript für deinen Shop.

Die berechnen allerdings noch mit einer Gebühr (fee) in einer bestimmten Höhe, weshalb das nicht hinhaut.
Ich hab das script deswegen ins fileadmin kopiert (siehe TS) und den Wert auf "0" gesetzt, dann hats getimmt. Das Script kannst du übrigens noch beliebig erweitern(z.B. Versandkosten unter 20€ gratis etc.), wenn du ein wenig php kannst.

PHP-Code:
<?php
/*

products_comp_calcScript.php


Calculation script for use with the default products.inc script

The script is based on the assumption that you're going to add a fee for using MasterCard/Eurocard, VISA or Diners Club.
MasterCard and VISA demands 5.75 % percent of the total amount in transaction fee. To compensate for this and let the customer pay the fee, this script calculates how much you need to add to the total in order to fully compensate.
To compensate 5,75% you must add 6.10%, then 5,75 % percent of that total is exactly the same as the amount of the fee.

TypoScript properties:

.feeTax     = enter sales-tax percentage for the fee, if any
.feePercent = the percent to be compensated for, default is 5.75 %

*/


$baseAmount $this->basket->calculatedArray['priceTax']['goodstotal']+$this->basket->calculatedArray['priceTax']['shipping'];        // The fee is calculated from the total of the goods AND shipping
$feePercent doubleval($confScript['feePercent'] ? $confScript['feePercent'] : 0);        // Fee percent is by default 5.75 %
    # Calculate conpensating percentage by:   100/(1-pFee/100)-100 = pComp, where pFee is the percentage, eg. Mastercard is taking (5,75%) and pComp will thus be 6.1 %
$compPercent 100/(1-$feePercent/100)-100;        // The compensation percentage.

$this->basket->calculatedArray['priceNoTax']['payment'] = $baseAmount/100*$compPercent;        // Add the amount to the no_tax total
$this->basket->calculatedArray['priceTax']['payment'] = $this->basket->calculatedArray['priceNoTax']['payment'] * (1+$this->basket->conf['payment.']['TAXpercentage']/100);        // ..and add the amount to the tax total + tax of the amount, if any


?>
Mit Zitat antworten