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/Options/OptionsProvider.php +3 -36 trunk2.1 View file →
@@ -21,9 +21,9 @@
21 21 class OptionsProvider {
22 22
23 23 public const DEFAULT_VALUE_PACKETA_LABEL_FORMAT = 'A6 on A4';
24 24 public const DEFAULT_VALUE_CARRIER_LABEL_FORMAT = self::DEFAULT_VALUE_PACKETA_LABEL_FORMAT;
25 - public const DEFAULT_VALUE_CARRIER_SETTINGS = true;
25 + public const DEFAULT_VALUE_CARRIER_SETTINGS = false;
26 26 public const MAX_STATUS_SYNCING_PACKETS_DEFAULT = 100;
27 27 public const MAX_DAYS_OF_PACKET_STATUS_SYNCING_DEFAULT = 14;
28 28 public const FORCE_PACKET_CANCEL_DEFAULT = true;
29 29 public const PACKET_AUTO_SUBMISSION_ALLOWED_DEFAULT = false;
@@ -33,11 +33,8 @@
33 33 public const AUTO_ORDER_STATUS = 'auto_order_status';
34 34 public const DISPLAY_FREE_SHIPPING_IN_CHECKOUT_DEFAULT = true;
35 35 public const PRICES_INCLUDE_TAX_DEFAULT = false;
36 36 public const HIDE_CHECKOUT_LOGO_DEFAULT = false;
37 - public const AUTO_EMAIL_INFO_INSERTION_DEFAULT = true;
38 - public const PICKUP_POINT_VALIDATION_ENABLED_DEFAULT = false;
39 - public const SHOW_CONSIGN_PASSWORD_FOR_Z_BOX_DEFAULT = false;
40 37
41 38 public const AUTOMATIC_CHECKOUT_DETECTION = 'automatic_checkout_detection';
42 39 public const BLOCK_CHECKOUT_DETECTION = 'block_checkout_detection';
43 40 public const CLASSIC_CHECKOUT_DETECTION = 'classic_checkout_detection';
@@ -488,17 +485,8 @@
488 485
489 486 return self::HIDE_CHECKOUT_LOGO_DEFAULT;
490 487 }
491 488
492 - public function isAutoEmailInfoInsertionEnabled(): bool {
493 - $autoEmailInfoInjection = $this->get( 'auto_email_info_insertion' );
494 - if ( $autoEmailInfoInjection !== null ) {
495 - return (bool) $autoEmailInfoInjection;
496 - }
497 -
498 - return self::AUTO_EMAIL_INFO_INSERTION_DEFAULT;
499 - }
500 -
501 489 public function isCheckoutLogoShown(): bool {
502 490 return ! $this->isCheckoutLogoHidden();
503 491 }
504 492
@@ -700,9 +688,9 @@
700 688 if ( $isEnabled !== null ) {
701 689 return (bool) $isEnabled;
702 690 }
703 691
704 - return self::DEFAULT_VALUE_CARRIER_SETTINGS;
692 + return false;
705 693 }
706 694
707 695 public function isWcCarrierConfigEnabledNullable(): ?bool {
708 696 $isEnabled = $this->advancedData['new_carrier_settings_enabled'] ?? null;
@@ -756,13 +744,10 @@
756 744 * @return string
757 745 */
758 746 public function getEmailHook(): string {
759 747 $emailHook = $this->get( 'email_hook' );
760 - if ( $emailHook === null || $emailHook === '' ) {
761 - return self::EMAIL_HOOK_DEFAULT;
762 - }
763 748
764 - return $emailHook;
749 + return $emailHook ?? self::EMAIL_HOOK_DEFAULT;
765 750 }
766 751
767 752 /**
768 753 * Performs replacements needed by Nette form to pass validation, see https://github.com/dg/nette-component-model/blob/master/src/ComponentModel/Container.php#L50 .
@@ -773,24 +758,6 @@
773 758 * @return string
774 759 */
775 760 public function sanitizePaymentGatewayId( string $id ): string {
776 761 return preg_replace( '/\W/', '_', $id );
777 - }
778 -
779 - public function isPickupPointValidationEnabled(): bool {
780 - $isEnabled = $this->get( Page::FORM_PICKUP_POINT_VALIDATION_ENABLED );
781 - if ( $isEnabled === null ) {
782 - return self::PICKUP_POINT_VALIDATION_ENABLED_DEFAULT;
783 - }
784 -
785 - return (bool) $isEnabled;
786 - }
787 -
788 - public function isShowConsignPasswordForZBoxEnabled(): bool {
789 - $value = $this->get( 'show_consign_password_for_z_box' );
790 - if ( $value !== null ) {
791 - return (bool) $value;
792 - }
793 -
794 - return self::SHOW_CONSIGN_PASSWORD_FOR_Z_BOX_DEFAULT;
795 762 }
796 763 }