Magento Product Price Is Zero with Catalogue Price Rule

We have come across a somewhat critical core code error in Magento versions less than 1.5 when using the “Fixed Amount discount”. Any SKU that the respective rule applies to results in the final sale price of the product being £0. This seems to only occur in certain scenarios, but is easily replicated on a Magento 1.4.2.0 clean demo store. The fix Rather than posting the full code for an extension based override, we’re just going to post the code snippet and the simpler PHP autoloader priority based fix using the ./app/code/local directory. Create ./app/code/local/Mage/CatalogRule/Helper/Data.php And paste the following code inside: class Mage_CatalogRule_Helper_Data extends Mage_Core_Helper_Abstract { public function calcPriceRule ($actionOperator, $ruleAmount, $price) { $priceRule = 0; switch ($actionOperator) { case ‘to_fixed’: $priceRule = $ruleAmount; break; case ‘to_percent’: $priceRule= $price * $ruleAmount / 100; break; case ‘by_fixed’: $priceRule = $price – $ruleAmount; break; case ‘by_percent’: $priceRule = $price * (1 – … Continue reading

How to fix PaymentSense’s gateway “orderStatus” error

We recently integrated the PaymentSense’s gateway for one of our customers. While making some test transactions, we noticed the extension raised a basic PHP error on the callback: Undefined variable: orderState in /http/app/code/local/Paymentsense/Paymentsensegateway/controllers/PaymentController.php on line 812 Hopefully, this error will be fixed in their new release. Undefined variable: orderState The following fix removed the error and assigned the right status to the order. If you still face problems after applying it, please let us know and we will update this ticket. Editing on app/code/local/Paymentsense/Paymentsensegateway/controllers/PaymentController.php on line +812, change : $order->setState($orderState, ‘pys_paid’, $message, false); To $order->setState($status, ‘pys_paid’, $message, false);