Home Forums WoodMart support forum Product Name Issue Reply To: Product Name Issue

#143088

Artem Temos
Keymaster

Hi,

Try to add the following PHP code snippet to the child theme functions.php

function woodmart_products_nav() {
    $next = get_next_post();
    $prev = get_previous_post();
    $next = $next ? wc_get_product( $next->ID ) : false;
    $prev = $prev ? wc_get_product( $prev->ID ) : false;
    ?>
        <div class="woodmart-products-nav">
            <?php if ( ! empty( $prev ) ): ?>
            <div class="product-btn product-prev">
                <a href="<?php echo esc_url( $prev->get_permalink() ); ?>"><?php esc_html_e('Previous product', 'woodmart'); ?><span class="product-btn-icon"></span></a>
                <div class="wrapper-short">
                    <div class="product-short">
                        <div class="product-short-image">
                            <a href="<?php echo esc_url( $prev->get_permalink() ); ?>" class="product-thumb">
                                <?php echo apply_filters( 'woodmart_products_nav_image', $prev->get_image() );?>
                            </a>
                        </div>
                        <div class="product-short-description">
                            <a href="<?php echo esc_url( $prev->get_permalink() ); ?>" class="product-title">
                                <?php echo $prev->get_title(); ?>
                            </a>
                            <span class="price">
                                <?php echo wp_kses_post( $prev->get_price_html() ); ?>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <?php endif ?>
            <a href="<?php echo apply_filters( 'woodmart_single_product_back_btn_url', get_permalink( wc_get_page_id( 'shop' ) ) ); ?>" class="woodmart-back-btn">
                <span>
                    <?php esc_html_e('Back to products', 'woodmart') ?>
                </span>
            </a>
            <?php if ( ! empty( $next ) ): ?>
            <div class="product-btn product-next">
                <a href="<?php echo esc_url( $next->get_permalink() ); ?>"><?php esc_html_e('Next product', 'woodmart'); ?><span class="product-btn-icon"></span></a>
                <div class="wrapper-short">
                    <div class="product-short">
                        <div class="product-short-image">
                            <a href="<?php echo esc_url( $next->get_permalink() ); ?>" class="product-thumb">
                                <?php echo apply_filters( 'woodmart_products_nav_image', $next->get_image() ); ?>
                            </a>
                        </div>
                        <div class="product-short-description">
                            <a href="<?php echo esc_url( $next->get_permalink() ); ?>" class="product-title">
                                <?php echo $next->get_title(); ?>
                            </a>
                            <span class="price">
                                <?php echo wp_kses_post( $next->get_price_html() ); ?>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
            <?php endif ?>
        </div>
    <?php
}

Regards