Skip to content

Commit

Permalink
šŸ› fix(Manager.php): add additional check for property existence to prā€¦
Browse files Browse the repository at this point in the history
ā€¦event error when accessing vendor_discount property if dokan pro exists
  • Loading branch information
nurul-umbhiya committed Nov 10, 2023
1 parent 8b33c3d commit 7645184
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Order/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ private function create_shipping( $order, $parent_order ) {
* @return void
*/
private function create_coupons( $order, $parent_order, $products ) {
if ( dokan()->is_pro_exists() ) {
if ( dokan()->is_pro_exists() && property_exists( dokan_pro(), 'vendor_discount' ) ) {
// remove vendor discount coupon code changes
remove_filter( 'woocommerce_order_get_items', [ dokan_pro()->vendor_discount->woocommerce_hooks, 'replace_coupon_name' ], 10 );
}
Expand Down

0 comments on commit 7645184

Please sign in to comment.