Skip to content

Commit 75e87cb

Browse files
committed
Merge branch 'WP-211' into 'main'
fix: new checkout validator See merge request ecommerce_modules/cms/wordpress/wordpress!86
2 parents 5bd666c + fb00b19 commit 75e87cb

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Validator/CheckoutValidator.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Cdek\Validator {
1111

1212
use Cdek\CdekApi;
13+
use Cdek\Config;
1314
use Cdek\Exceptions\CacheException;
1415
use Cdek\Exceptions\External\ApiException;
1516
use Cdek\Exceptions\External\CoreAuthException;
@@ -32,7 +33,7 @@ public function __invoke(): void
3233
$meta = $rate->get_meta_data();
3334

3435
if ( in_array((int)$meta[MetaKeys::TARIFF_MODE], Tariff::listOfficeDeliveryModes(), true) ) {
35-
if ( empty($meta[MetaKeys::OFFICE_CODE]) ) {
36+
if ( empty($meta[MetaKeys::OFFICE_CODE]) && empty($request['extensions'][Config::DELIVERY_NAME]['office_code']) ) {
3637
wc_add_notice(esc_html__('Order pickup point not selected.', 'cdekdelivery'), 'error');
3738
}
3839
} else {

0 commit comments

Comments
 (0)