Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added scroll to top cta #4202

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions assets/customizer/css/upsells.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
23 changes: 21 additions & 2 deletions inc/customizer/controls/simple_upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
?>
<div class="nv-simple-upsell">
<div class="<?php echo esc_attr( $class ); ?>">
<?php if ( ! empty( $this->text ) ) { ?>
<p><?php echo esc_html( $this->text ); ?></p>
<?php } ?>
<?php if ( ! empty( $this->link ) && ! empty( $this->button_text ) ) { ?>
<a target="_blank" rel="external noreferrer noopener" href="<?php echo esc_url( $this->link ); ?>" class='button button-secondary'>
<a target="_blank" rel="external noreferrer noopener" href="<?php echo esc_url( $this->link ); ?>" class='button <?php echo esc_attr( $button_class ); ?>'>
<?php echo esc_html( $this->button_text ); ?>
<span class="components-visually-hidden"><?php echo esc_html__( '(opens in a new tab)', 'neve' ); ?></span>
</a>
Expand Down
Loading
Loading