Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Vendor getting draft order in dashboard #2156

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions includes/Order/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@

// create sub-orders
add_action( 'woocommerce_checkout_update_order_meta', [ $this, 'split_vendor_orders' ] );
add_action( 'woocommerce_store_api_checkout_update_order_meta', [ $this, 'split_vendor_orders' ] );
add_action( 'woocommerce_store_api_checkout_order_processed', [ $this, 'split_vendor_orders' ] );

// order table synced for WooCommerce update order meta
add_action( 'woocommerce_checkout_update_order_meta', 'dokan_sync_insert_order', 20 );
add_action( 'woocommerce_store_api_checkout_update_order_meta', 'dokan_sync_insert_order', 20 );
add_action( 'woocommerce_store_api_checkout_order_processed', 'dokan_sync_insert_order', 20 );

// order table synced for dokan update order meta
add_action( 'dokan_checkout_update_order_meta', 'dokan_sync_insert_order' );
Expand Down Expand Up @@ -329,7 +329,7 @@
$available_vendors = array_unique( $available_vendors );

if ( $coupon->is_type( 'fixed_cart' ) && count( $available_vendors ) > 1 ) {
throw new Exception( __( 'This coupon is invalid for multiple vendors.', 'dokan-lite' ) );

Check failure on line 332 in includes/Order/Hooks.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
}

// Make sure applied coupon created by admin
Expand All @@ -343,7 +343,7 @@

// A coupon must be bound with a product
if ( ! dokan()->is_pro_exists() && count( $coupon->get_product_ids() ) === 0 ) {
throw new Exception( __( 'A coupon must be restricted with a vendor product.', 'dokan-lite' ) );

Check failure on line 346 in includes/Order/Hooks.php

View workflow job for this annotation

GitHub Actions / Run PHPCS inspection

All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '__'.
}

$coupon_id = $coupon->get_id();
Expand Down
Loading