File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 4040$ coupon = null ;
4141
4242if (isset ($ _REQUEST ['c ' ])) {
43- $ couponCode = $ _REQUEST ['c ' ];
43+ $ couponId = ( int ) $ _REQUEST ['c ' ];
4444 if ($ buyingCourse ) {
45- $ coupon = $ plugin ->getCouponByCode ( $ couponCode , BuyCoursesPlugin::PRODUCT_TYPE_COURSE , $ _REQUEST ['i ' ]);
45+ $ coupon = $ plugin ->getCoupon ( $ couponId , BuyCoursesPlugin::PRODUCT_TYPE_COURSE , $ _REQUEST ['i ' ]);
4646 } else {
47- $ coupon = $ plugin ->getCouponByCode ( $ couponCode , BuyCoursesPlugin::PRODUCT_TYPE_SESSION , $ _REQUEST ['i ' ]);
47+ $ coupon = $ plugin ->getCoupon ( $ couponId , BuyCoursesPlugin::PRODUCT_TYPE_SESSION , $ _REQUEST ['i ' ]);
4848 }
4949}
5050
155155 Display::return_message ($ plugin ->get_lang ('CouponRedeemed ' ), 'success ' , false )
156156 );
157157
158- header ('Location: ' .api_get_path (WEB_PLUGIN_PATH ).'buycourses/src/process.php?i= ' .$ _REQUEST ['i ' ].'&t= ' .$ _REQUEST ['t ' ].'&c= ' .$ formCouponValues [ ' coupon_code ' ]);
158+ header ('Location: ' .api_get_path (WEB_PLUGIN_PATH ).'buycourses/src/process.php?i= ' .$ _REQUEST ['i ' ].'&t= ' .$ _REQUEST ['t ' ].'&c= ' .$ coupon [ ' id ' ]);
159159
160160 exit ;
161161}
You can’t perform that action at this time.
0 commit comments