diff --git a/assets/customizer/css/upsells.css b/assets/customizer/css/upsells.css index 6ee8971ede..e5a8c91072 100644 --- a/assets/customizer/css/upsells.css +++ b/assets/customizer/css/upsells.css @@ -80,6 +80,20 @@ padding-top: 10px; align-items: center; } +.nv-simple-upsell.column-layout { + flex-direction: column; + align-items: start; + gap: 16px; + border-bottom: 1px solid #ccc; + border-top: none; + padding-bottom: 12px; +} + +.nv-simple-upsell.column-layout p { + font-size: 13px; + font-weight: normal; +} + .nv-simple-upsell p { margin: 0 10px 0 0; font-weight: 600; diff --git a/inc/customizer/controls/simple_upsell.php b/inc/customizer/controls/simple_upsell.php index 17b3a8ac6d..5a8a2e3f7c 100644 --- a/inc/customizer/controls/simple_upsell.php +++ b/inc/customizer/controls/simple_upsell.php @@ -47,19 +47,38 @@ class Simple_Upsell extends \WP_Customize_Control { */ public $text = ''; + /** + * Additional CSS class. + * + * @since 3.8.0 + * @var string + */ + public $class = ''; + + /** + * Use primary button class. + * + * @since 3.8.0 + * @var string + */ + public $use_primary = ''; + /** * Render Method * * @return void */ public function render_content() { + $base_class = 'nv-simple-upsell'; + $class = ( ! empty( $this->class ) ) ? $base_class . ' ' . $this->class : $base_class; + $button_class = ( ! empty( $this->use_primary ) ) ? 'button-primary' : 'button-secondary'; ?> -
+
text ) ) { ?>

text ); ?>

link ) && ! empty( $this->button_text ) ) { ?> - + button_text ); ?> diff --git a/inc/customizer/controls/upsells/scroll_to_top_control.php b/inc/customizer/controls/upsells/scroll_to_top_control.php new file mode 100644 index 0000000000..44fbe176dc --- /dev/null +++ b/inc/customizer/controls/upsells/scroll_to_top_control.php @@ -0,0 +1,500 @@ + + + +SVG; + ?> + +
+
+
+
+ + +
+
+
+
+
+
+ General + +
+
+
+ + +
+
+ + +
+
+ Scroll to Top Icon +
+ + + + + + + + + + + + + + + +
+
+
+ + +
+ +
+
+ Offset (px) +
+
+
+
+
+
+ + + + + +
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ +
+
+ Style + +
+
+
+
+ Padding +
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+ + +
+
+
+
+
Icon Size +
+
+
+ + + +
+
+
+
+ + + +
+
+
+
+
+
+
+ + + + + +
+
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+
+
+
+ Border Radius +
+
+
+
+
+
+ + + + + +
+
+
+
+
+ +
+
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+ Colors + +
+ +
+
+
+ Color +
+ +
+
+ +
+
+
+
+
+ Hover Color +
+ +
+
+ +
+
+
+
+
+ Background Color +
+ +
+
+ +
+
+
+
+
+ Background Hover Color +
+ +
+
+ +
+
+
+
+
+ register_type( 'Neve\Customizer\Controls\Heading', 'control' ); $this->register_type( 'Neve\Customizer\Controls\Checkbox', 'control' ); $this->register_type( 'Neve\Customizer\Controls\Upsell_Control', 'control' ); + $this->register_type( 'Neve\Customizer\Controls\Upsells\Scroll_To_Top_Control', 'control' ); } /** diff --git a/inc/customizer/options/upsells.php b/inc/customizer/options/upsells.php index 0da4d9ad3b..a9f2cb427e 100644 --- a/inc/customizer/options/upsells.php +++ b/inc/customizer/options/upsells.php @@ -417,6 +417,17 @@ private function section_upsells() { 'Neve\Customizer\Controls\React\Upsell_Section' ) ); + + $this->add_section( + new Section( + 'neve_scroll_to_top_upsell', + array( + 'priority' => 80, + 'title' => esc_html__( 'Scroll To Top', 'neve' ), + 'panel' => 'neve_layout', + ) + ) + ); } /** @@ -438,6 +449,37 @@ private function control_upsells() { ) ); + + $this->add_control( + new Control( + 'neve_scroll_to_top_cta_control', + [ 'sanitize_callback' => 'sanitize_text_field' ], + [ + /* translators: Module name for the upsell. */ + 'text' => sprintf( __( 'Unlock %s with the Pro version.', 'neve' ), __( 'Scroll To Top', 'neve' ) ), + 'button_text' => esc_html__( 'Get the PRO version!', 'neve' ), + 'section' => 'neve_scroll_to_top_upsell', + 'priority' => PHP_INT_MIN, + 'link' => $this->upsell_url, + 'class' => 'column-layout', + 'use_primary' => 'true', + ], + 'Neve\Customizer\Controls\Simple_Upsell' + ) + ); + + $this->add_control( + new Control( + 'neve_scroll_to_top_upsell_control', + [ 'sanitize_callback' => 'sanitize_text_field' ], + [ + 'section' => 'neve_scroll_to_top_upsell', + 'priority' => 2, + ], + 'Neve\Customizer\Controls\Upsells\Scroll_To_Top_Control' + ) + ); + $upsells = []; $upsells_banners = [];