PluginProbe
Packeta / 2.1
Packeta v2.1
2.3.2 2.3.1 trunk 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.3.0 1.3.1 1.3.2 1.4 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 All 56 releases
← All changes | src/Packetery/Module/Order/Metabox.php +3 -21 trunk2.1 View file →
@@ -294,21 +294,16 @@
294 294 if ( isset( $statusClasses[ $statusType ] ) ) {
295 295 $statusClass = $statusClasses[ $statusType ];
296 296 }
297 297
298 - $invalidFields = $this->orderForm->getInvalidFieldsFromValidationResult( $this->orderValidator->validate( $order ) );
299 - $invalidFieldsMessage = $this->orderForm->getInvalidFieldsMessageFromValidationResult( $invalidFields, $order );
300 -
301 298 $parts[ self::PART_MAIN ] = $this->latteEngine->renderToString(
302 299 PACKETERY_PLUGIN_DIR . '/template/order/metabox-common.latte',
303 300 [
304 301 'order' => $order,
305 - 'showConsignPasswordForZBox' => $this->optionsProvider->isShowConsignPasswordForZBoxEnabled(),
306 302 'packetStatusTranslatedName' => $packetStatusTranslatedName,
307 303 'statusClass' => $statusClass,
308 304 'isPacketSubmissionPossible' => false,
309 305 'orderWarningFields' => [],
310 - 'invalidFieldsMessage' => $invalidFieldsMessage,
311 306 'packetCancelLink' => $packetCancelLink,
312 307 'packetTrackingUrl' => $this->coreHelper->getTrackingUrl( $packetId ),
313 308 'packetClaimTrackingUrl' => $packetClaimTrackingUrl,
314 309 'showLogsLink' => $showLogsLink,
@@ -334,9 +329,8 @@
334 329 'printPacketClaimLabel' => $this->wpAdapter->__( 'Print packet claim label', 'packeta' ),
335 330 'cancelPacketClaim' => $this->wpAdapter->__( 'Cancel packet claim', 'packeta' ),
336 331 'packetClaimPassword' => $this->wpAdapter->__( 'Packet claim password', 'packeta' ),
337 332 'submissionPassword' => $this->wpAdapter->__( 'submission password', 'packeta' ),
338 - 'zboxConsignPassword' => $this->wpAdapter->__( 'Consignment code', 'packeta' ),
339 333 'setStoredUntil' => $this->wpAdapter->__( 'Set the pickup date extension', 'packeta' ),
340 334 'runWizard' => $this->wpAdapter->__( 'Run options wizard', 'packeta' ),
341 335 ],
342 336 ]
@@ -417,23 +411,18 @@
417 411 }
418 412 }
419 413 }
420 414
421 - $invalidFields = $this->orderForm->getInvalidFieldsFromValidationResult( $this->orderValidator->validate( $order ) );
422 - $invalidFieldsMessage = $this->orderForm->getInvalidFieldsMessageFromValidationResult( $invalidFields, $order );
423 -
424 415 $parts[ self::PART_MAIN ] = $this->latteEngine->renderToString(
425 416 PACKETERY_PLUGIN_DIR . '/template/order/metabox-form.latte',
426 417 [
427 418 'form' => $this->form,
428 419 'order' => $order,
429 - 'showConsignPasswordForZBox' => $this->optionsProvider->isShowConsignPasswordForZBoxEnabled(),
430 420 'showWidgetButton' => $showWidgetButton,
431 421 'widgetButtonError' => $widgetButtonError,
432 422 'showHdWidget' => $showHdWidget,
433 423 'isPacketSubmissionPossible' => $isPacketSubmissionPossible,
434 - 'orderWarningFields' => $invalidFields,
435 - 'invalidFieldsMessage' => $invalidFieldsMessage,
424 + 'orderWarningFields' => Form::getInvalidFieldsFromValidationResult( $this->orderValidator->validate( $order ) ),
436 425 'packetCancelLink' => null,
437 426 'packetTrackingUrl' => null,
438 427 'packetStatusTranslatedName' => null,
439 428 'packetSubmitUrl' => $packetSubmitUrl,
@@ -454,9 +443,9 @@
454 443 'isPacketaPickupPoint' => $order->isPacketaInternalPickupPoint(),
455 444 'pickupPointAttributes' => Attribute::$pickupPointAttributes,
456 445 'homeDeliveryAttributes' => Attribute::$homeDeliveryAttributes,
457 446 'translations' => [
458 - 'packetSubmissionValidationErrorTooltip' => $this->wpAdapter->__( 'It is not possible to submit the shipment because all the information required for this shipment is not filled:', 'packeta' ),
447 + 'packetSubmissionValidationErrorTooltip' => $this->wpAdapter->__( 'It is not possible to submit the shipment because all the information required for this shipment is not filled.', 'packeta' ),
459 448 'showLogs' => $this->wpAdapter->__( 'Show logs', 'packeta' ),
460 449 'weightIsManual' => $this->wpAdapter->__( 'Weight is manually set. To calculate weight remove field content and save.', 'packeta' ),
461 450 'codIsManual' => $this->wpAdapter->__( 'COD value is manually set. To calculate the value remove field content and save.', 'packeta' ),
462 451 'valueIsManual' => $this->wpAdapter->__( 'Order value is manually set. To calculate the value remove field content and save.', 'packeta' ),
@@ -466,9 +455,8 @@
466 455 'printPacketClaimLabel' => $this->wpAdapter->__( 'Print packet claim label', 'packeta' ),
467 456 'cancelPacketClaim' => $this->wpAdapter->__( 'Cancel packet claim', 'packeta' ),
468 457 'packetClaimPassword' => $this->wpAdapter->__( 'Packet claim password', 'packeta' ),
469 458 'submissionPassword' => $this->wpAdapter->__( 'submission password', 'packeta' ),
470 - 'zboxConsignPassword' => $this->wpAdapter->__( 'Z-BOX consign password', 'packeta' ),
471 459 // translators: %s: Order number.
472 460 'reallyCancelPacketHeading' => sprintf( $this->wpAdapter->__( 'Order #%s', 'packeta' ), $order->getCustomNumber() ),
473 461 // translators: %s: Packet claim number.
474 462 'reallyCancelPacketClaim' => sprintf( $this->wpAdapter->__( 'Do you really wish to cancel packet claim number %s?', 'packeta' ), $order->getPacketClaimId() ),
@@ -584,15 +572,9 @@
584 572
585 573 $pickupPoint = $this->mapper->toOrderEntityPickupPoint( $order, $propsToSave );
586 574 $order->setPickupPoint( $pickupPoint );
587 575
588 - $updatedRowCount = $this->orderRepository->save( $order );
589 - if ( $updatedRowCount === false ) {
590 - $this->messageManager->flash_message(
591 - (string) $this->wpAdapter->__( 'An error occurred while saving the order. More details in WC log.', 'packeta' ),
592 - MessageManager::TYPE_ERROR
593 - );
594 - }
576 + $this->orderRepository->save( $order );
595 577 }
596 578
597 579 /**
598 580 * Creates pickup point picker settings.