qubew Posted May 30, 2011 Share Posted May 30, 2011 Hi,I new for prestashop.Now i have Idea to give customer discount by his history paidlike Mr.A bought 3 times total $50, Mr.A will has 5% discount for next buy,and Mr.B bought 2 times total $100, Mr.B will has 10% discount for next buy.can anyone guide me do that or do you have suggest module ?Thank.Qubew Link to comment Share on other sites More sharing options...
Dreamtheme Posted May 30, 2011 Share Posted May 30, 2011 Use point reward build in module for that, on every sale for example 50$ user earn some amount of discount , it can be % or sum. Link to comment Share on other sites More sharing options...
qubew Posted May 30, 2011 Author Share Posted May 30, 2011 Thank you,I had solved this problem by edited /classes/cart.php related by http://www.prestashop.com/forums/viewthread/46117/P0/third_party_modules/discount_of_total_priceusing this code to get history paid. $querypaid = "SELECT SUM(total_paid_real) AS history_paid FROM ps_orders WHERE id_customer = '".$this->id_customer."' AND id_order IN ( SELECT id_order FROM ps_order_history WHERE id_order_state IN (2) ) "; $resultpaid = mysql_query($querypaid) or die(mysql_error()); $row = mysql_fetch_array($resultpaid); // get money of customer paid $Summary = $row['history_paid']; then using to make discount if ($Summary >= 50 && $Summary < 75) { $discount_per = 5; } // set discount $order_total = $order_total - (($order_total * $discount_per) / 100); Link to comment Share on other sites More sharing options...
Recommended Posts