Created
May 8, 2013 05:24
-
-
Save sthamann/5538405 to your computer and use it in GitHub Desktop.
Modify cart to determine tax depends on the basket value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Replace Hook auf engine/core/class/sBasket::getMaxTax | |
public function getMaxTax(){ | |
$sql = " | |
SELECT | |
SUM(price * quantity) as amount_per_tax, tax | |
FROM s_order_basket b | |
WHERE b.sessionID=? AND b.modus=0 | |
GROUP BY tax_rate | |
ORDER BY amount_per_tax DESC | |
"; | |
$taxRate = Shopware()->Db()->fetchRow($sql,array(empty(Shopware()->System()->sSESSION_ID) ? session_id() : Shopware()->System()->sSESSION_ID)); | |
return $taxRate["tax"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment