function create_dhl_express_contextual_info( array $phrases_in ) { if ( ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_VERSION' ) && ! defined( 'FLEXIBLE_SHIPPING_DHL_EXPRESS_PRO_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'dhl_express', $phrases_in, sprintf( // Translators: link. __( 'Want to show your customers the DHL Express live rates? %1$sCheck our DHL Express plugin%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_fedex_contextual_info( array $phrases_in ) { if ( ! defined( 'FLEXIBLE_SHIPPING_FEDEX_VERSION' ) && ! defined( 'FLEXIBLE_SHIPPING_FEDEX_PRO_VERSION' ) ) { $target_url = $this->is_base_location_country_pl() ? 'https://octol.io/fs-cross-fedex-pl' : 'https://octol.io/fs-cross-fedex'; $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'fedex', $phrases_in, sprintf( // Translators: link. __( 'Want to show your customers the FedEx live rates? %1$sCheck our FedEx plugin%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_ups_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_UPS_LABELS_VERSION' ) ) { $target_url = get_user_locale() === 'pl_PL' ? 'https://octol.io/fs-cross-ups-labels-pl' : 'https://octol.io/fs-cross-ups-labels'; $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'ups', $phrases_in, sprintf( // Translators: link. __( 'Sending your products with UPS? Create the shipments and generate shipping labels directly from your shop using our %1$sUPS Labels%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_usps_contextual_info( array $phrases_in ) { if ( ! defined( 'FLEXIBLE_SHIPPING_USPS_PRO_VERSION' ) ) { $target_url = 'https://octol.io/fs-cross-usps'; $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'usps', $phrases_in, sprintf( // Translators: link. __( 'Want to show your customers the USPS live rates? %1$sCheck our USPS plugin%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_dpd_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_DPD_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'dpd', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via DPD? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_enadawca_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_ENADAWCA_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'enadawca', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via Poczta Polska? Create the shipments and generate shipping labels directly from your shop using our %1$sPoczta Polska eNadawca integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_dhl_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_DHL_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'dhl', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via DHL? Create the shipments and generate shipping labels directly from your shop using our %1$sDHL integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_pwr_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_PACZKA_W_RUCHU_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'pwr', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via Orlen Paczka? Create the shipments and generate shipping labels directly from your shop using our %1$sOrlen Paczka integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_inpost_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_PACZKOMATY_INPOST_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'inpost', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via InPost? Create the shipments and generate shipping labels directly from your shop using our %1$sInPost integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * @param array $phrases_in . */ private function create_dpd_uk_contextual_info( array $phrases_in ) { if ( ! defined( 'WOOCOMMERCE_DPD_UK_VERSION' ) ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_AND_METHOD_DESCRIPTION_ELEMENTS, 'dpd_uk', $phrases_in, sprintf( // Translators: link. __( 'Sending your products via DPD UK? Create the shipments and generate shipping labels directly from your shop using our %1$sDPD UK integration%2$s', 'flexible-shipping' ), '', '' ) ) ); } } /** * Crate default contextual info. * * @param array $phrases_not_in . */ private function create_default_contextual_info( array $phrases_not_in ) { $this->add_hookable( new Flexible_Shipping_Contextual_Info( self::METHOD_TITLE_ELEMENT, 'other', [], $this->create_html_for_default_contextual_info(), $phrases_not_in ) ); } /** * @return string */ private function create_html_for_default_contextual_info() { if ( $this->is_base_location_country_pl() ) { return __( 'Check our further shipping integrations with DPD, DHL, InPost, eNadawca and Orlen Paczka.', 'flexible-shipping' ) . '  ' . sprintf( // Translators: link. __( '%1$sAdd integrations%2$s', 'flexible-shipping' ), '', '' ); } elseif ( $this->is_base_location_country_gb() ) { return __( 'Check our further shipping integration with DPD UK and FedEx / UPS live rates plugins.', 'flexible-shipping' ) . '  ' . sprintf( // Translators: link. __( '%1$sAdd integration%2$s', 'flexible-shipping' ), '', '' ); } elseif ( ! defined( 'FLEXIBLE_SHIPPING_PRO_VERSION' ) ) { return __( 'Upgrade from the free version to the Flexible Shipping PRO and create even the most complex shipping scenarios with ease.', 'flexible-shipping' ) . '  ' . sprintf( // Translators: link. __( '%1$sUpgrade Now%2$s', 'flexible-shipping' ), '', '' ); } else { return ''; } } }