Home › Forums › WoodMart support forum › change the title of the product in wd-sticky panel › Reply To: change the title of the product in wd-sticky panel
November 10, 2022 at 3:07 am
#419965
Elise Noromit
Member
Hello,
Please add this code to the functions.php of the child theme:
if ( ! function_exists( 'woodmart_sticky_single_add_to_cart' ) ) {
function woodmart_sticky_single_add_to_cart() {
global $product;
if ( ! woodmart_woocommerce_installed() || ! is_product() || ! woodmart_get_opt( 'single_sticky_add_to_cart' ) ) {
return;
}
woodmart_enqueue_js_script( 'sticky-add-to-cart' );
woodmart_enqueue_inline_style( 'sticky-add-to-cart' );
if ( woodmart_get_opt( 'mobile_single_sticky_add_to_cart' ) ) {
woodmart_enqueue_inline_style( 'woo-mod-quantity-overlap' );
}
?>
<div class="wd-sticky-btn<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn' ); ?>">
<div class="wd-sticky-btn-container container<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn-container' ); ?>">
<div class="wd-sticky-btn-content<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn-content' ); ?>">
<div class="wd-sticky-btn-thumbnail<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn-thumbnail' ); ?>">
<?php echo woocommerce_get_product_thumbnail(); ?>
</div>
<div class="wd-sticky-btn-info<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn-info' ); ?>">
<div class="wd-entities-title"><?php the_title(); ?></div>
<?php echo wc_get_rating_html( $product->get_average_rating() ); ?>
</div>
</div>
<div class="wd-sticky-btn-cart<?php echo woodmart_get_old_classes( ' woodmart-sticky-btn-cart' ); ?>">
<span class="price"><?php echo wp_kses_post( $product->get_price_html() ); ?></span>
<?php if ( $product->is_type( 'simple' ) ) : ?>
<?php woocommerce_simple_add_to_cart(); ?>
<?php else : ?>
<a href="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="wd-sticky-add-to-cart button alt<?php echo woodmart_get_old_classes( ' woodmart-sticky-add-to-cart' ); ?>">
<?php echo true == $product->is_type( 'variable' ) ? esc_html__( 'Select options', 'woodmart' ) : $product->single_add_to_cart_text(); ?>
</a>
<?php Quick_Buy::get_instance()->output_quick_buy_button(); ?>
<?php endif; ?>
<?php do_action( 'woodmart_sticky_atc_actions' ); ?>
</div>
</div>
</div>
<?php
}
add_action( 'woodmart_before_wp_footer', 'woodmart_sticky_single_add_to_cart', 999 );
}
Best Regards