| @@ -30,9 +30,10 @@ | ||
| 30 | 30 | $css_generator->add_class_styles( |
| 31 | 31 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content h4', |
| 32 | 32 | $this->get_status_title_css( $attributes ), |
| 33 | 33 | $this->get_status_title_css( $attributes, 'Tablet' ), |
| 34 | - $this->get_status_title_css( $attributes, 'Mobile' ) | |
| 34 | + $this->get_status_title_css( $attributes, 'Mobile' ), | |
| 35 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_status_title_css( $attributes, $device ); } ) | |
| 35 | 36 | ); |
| 36 | 37 | |
| 37 | 38 | $css_generator->add_class_styles( |
| 38 | 39 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content h4:hover', |
| @@ -37,9 +38,10 @@ | ||
| 37 | 38 | $css_generator->add_class_styles( |
| 38 | 39 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content h4:hover', |
| 39 | 40 | $this->get_status_title_hover_css( $attributes ), |
| 40 | 41 | $this->get_status_title_hover_css( $attributes, 'Tablet' ), |
| 41 | - $this->get_status_title_hover_css( $attributes, 'Mobile' ) | |
| 42 | + $this->get_status_title_hover_css( $attributes, 'Mobile' ), | |
| 43 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_status_title_hover_css( $attributes, $device ); } ) | |
| 42 | 44 | ); |
| 43 | 45 | $css_generator->add_class_styles( |
| 44 | 46 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p span, |
| 45 | 47 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p time', |
| @@ -44,9 +46,10 @@ | ||
| 44 | 46 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p span, |
| 45 | 47 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p time', |
| 46 | 48 | $this->get_deatils_title_css( $attributes ), |
| 47 | 49 | $this->get_deatils_title_css( $attributes, 'Tablet' ), |
| 48 | - $this->get_deatils_title_css( $attributes, 'Mobile' ) | |
| 50 | + $this->get_deatils_title_css( $attributes, 'Mobile' ), | |
| 51 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_deatils_title_css( $attributes, $device ); } ) | |
| 49 | 52 | ); |
| 50 | 53 | |
| 51 | 54 | $css_generator->add_class_styles( |
| 52 | 55 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p span:hover, |
| @@ -52,9 +55,10 @@ | ||
| 52 | 55 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p span:hover, |
| 53 | 56 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success__content p time:hover', |
| 54 | 57 | $this->get_deatils_title_hover_css( $attributes ), |
| 55 | 58 | $this->get_deatils_title_hover_css( $attributes, 'Tablet' ), |
| 56 | - $this->get_deatils_title_hover_css( $attributes, 'Mobile' ) | |
| 59 | + $this->get_deatils_title_hover_css( $attributes, 'Mobile' ), | |
| 60 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_deatils_title_hover_css( $attributes, $device ); } ) | |
| 57 | 61 | ); |
| 58 | 62 | $css_generator->add_class_styles( |
| 59 | 63 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p span, |
| 60 | 64 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p a', |
| @@ -59,9 +63,10 @@ | ||
| 59 | 63 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p span, |
| 60 | 64 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p a', |
| 61 | 65 | $this->get_email_css( $attributes ), |
| 62 | 66 | $this->get_email_css( $attributes, 'Tablet' ), |
| 63 | - $this->get_email_css( $attributes, 'Mobile' ) | |
| 67 | + $this->get_email_css( $attributes, 'Mobile' ), | |
| 68 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_email_css( $attributes, $device ); } ) | |
| 64 | 69 | ); |
| 65 | 70 | $css_generator->add_class_styles( |
| 66 | 71 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p span:hover, |
| 67 | 72 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p a:hover', |
| @@ -66,9 +71,10 @@ | ||
| 66 | 71 | '{{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p span:hover, |
| 67 | 72 | {{WRAPPER}} .storeengine-thankyou-order-info-shortcode .storeengine-thankyou-order-info-success .storeengine-thankyou-order-info-success__email p a:hover', |
| 68 | 73 | $this->get_email_hover_css( $attributes ), |
| 69 | 74 | $this->get_email_hover_css( $attributes, 'Tablet' ), |
| 70 | - $this->get_email_hover_css( $attributes, 'Mobile' ) | |
| 75 | + $this->get_email_hover_css( $attributes, 'Mobile' ), | |
| 76 | + $css_generator->custom_device_map( function ( $device ) use ( $attributes ) { return $this->get_email_hover_css( $attributes, $device ); } ) | |
| 71 | 77 | ); |
| 72 | 78 | |
| 73 | 79 | return $css_generator->generate_css(); |
| 74 | 80 | } |
| @@ -117,16 +123,13 @@ | ||
| 117 | 123 | return [ 'color' => Color::get_css( isset( $attributes['emailColorH'] ) ? $attributes['emailColorH'] : '' ) ]; |
| 118 | 124 | } |
| 119 | 125 | |
| 120 | 126 | public function render_block_content( $attributes, $content, $block_instance ) { |
| 127 | + // StoreEngine core falls back to sample content when there's no real | |
| 128 | + // order (e.g. in the editor), so no dummy flag is needed here. | |
| 121 | 129 | $attr_array = [ |
| 122 | - 'ids' => Helper::get_attribute_value( $attributes, 'products_ids' ), | |
| 123 | - 'dummy' => false, | |
| 130 | + 'ids' => Helper::get_attribute_value( $attributes, 'products_ids' ), | |
| 124 | 131 | ]; |
| 125 | - // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.MissingUnslash | |
| 126 | - if ( isset( $_GET['context'] ) && 'edit' === sanitize_text_field( $_GET['context'] ) ) { | |
| 127 | - $attr_array['dummy'] = true; | |
| 128 | - } | |
| 129 | 132 | |
| 130 | 133 | $shortcode = '[storeengine_thankyou_order_info ' . Helper::attr_shortcode( $attr_array ) . ']'; |
| 131 | 134 | echo do_shortcode( $shortcode ); |
| 132 | 135 | } |