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 40
40
$ coupon = null ;
41
41
42
42
if (isset ($ _REQUEST ['c ' ])) {
43
- $ couponCode = $ _REQUEST ['c ' ];
43
+ $ couponId = ( int ) $ _REQUEST ['c ' ];
44
44
if ($ buyingCourse ) {
45
- $ coupon = $ plugin ->getCouponByCode ( $ couponCode , BuyCoursesPlugin::PRODUCT_TYPE_COURSE , $ _REQUEST ['i ' ]);
45
+ $ coupon = $ plugin ->getCoupon ( $ couponId , BuyCoursesPlugin::PRODUCT_TYPE_COURSE , $ _REQUEST ['i ' ]);
46
46
} else {
47
- $ coupon = $ plugin ->getCouponByCode ( $ couponCode , BuyCoursesPlugin::PRODUCT_TYPE_SESSION , $ _REQUEST ['i ' ]);
47
+ $ coupon = $ plugin ->getCoupon ( $ couponId , BuyCoursesPlugin::PRODUCT_TYPE_SESSION , $ _REQUEST ['i ' ]);
48
48
}
49
49
}
50
50
155
155
Display::return_message ($ plugin ->get_lang ('CouponRedeemed ' ), 'success ' , false )
156
156
);
157
157
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 ' ]);
159
159
160
160
exit ;
161
161
}
You can’t perform that action at this time.
0 commit comments