Home Forums Basel – Premium Template The SOLD OUT, SALE labels don't show

This topic contains 12 replies, has 2 voices, and was last updated by Xtemos Studio Xtemos Studio 1 week ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #8594

    coris8
    Participant

    Hi,
    I’v just installed your theme/child theme and have an issue with the SOLD OUT and SALE labels as they don’t show at all on my website…
    Also you told about the possibility of having the label in rectangular form to fit the length of the translated texts. Would it be possible to prepare rectangular labels for me?
    Many thanks in advance

    Private Content Hidden
    #8596
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Hello,

    Could you please provide us your admin access so we could check why labels are not shown firstly?

    Regards

    #8597

    coris8
    Participant

    Thank you in advance 🙂

    Private Content Hidden
    #8600
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Very strange, but it is not visible only on the shop page. Could you please disable all additional plugins to check is it a plugin issue or not? We check with default theme and see that it is not Basel related problem.

    Regards

    #8602

    coris8
    Participant

    Hi,
    Many thanks 🙂 the bug came from the plugin: WooCommerce Product Archive Customiser
    I still don’t see the label on the product page though.. any idea?
    Thanks

    #8607
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Hello,

    We just checked and see that Sale label is displayed on the product page. But “Sold out” is not viewed on single product page in WooCommerce by default.

    Regards

    #8619

    coris8
    Participant

    Hi,
    Actually I would really need the label sold out to display on the product page too. Can you help me doing that?
    Also the sold out text is now translated and I think a rectangular label would be a better option for me. Can you help?
    thank you!

    Private Content Hidden
    #8628
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Hi,

    If you want to show this badge on the single product page you need to create a file in the child theme /basel-child/woocommerce/single-product/sale-flash.php and put this code inside

    
    <?php
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    global $post, $product;
    
    ?>
    <?php if ( $product->is_on_sale() ) : ?>
    
    	<?php echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( 'Sale!', 'woocommerce' ) . '</span>', $post, $product ); ?>
    
    <?php endif; ?>
    <?php if ( ! $product->is_in_stock() ) : ?>
    
    	<?php echo apply_filters( 'basel_stock_flash', '<span class="out-of-stock-label">' . __( 'Sold out', 'basel' ) . '</span>', $post, $product ); ?>
    
    <?php endif; ?>

    Regards

    #8629
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Here is a CSS code to make them rectangular

    .onsale, .out-of-stock-label {
        border-radius:0;
        width:auto;
        height: auto;
        line-height: 1;
        padding: 10px 10px;
    }
    #8636

    coris8
    Participant

    Hi,
    Thank you! the rectangular label looks great!
    And thanks for the php code, we are a step closer 😉 but: the label appear on the left and not on the main picture as it should and as it does on sale items. Do you know how to fix it? I’d like to have the SOLD OUT label displaying like the SALE label on product page.
    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #8639
    Xtemos Studio
    Xtemos Studio
    Keymaster

    Hello,

    Great, try this CSS to make SOLD OUT label position to right

    .product-images .out-of-stock-label {
    	right:15px;
    	left:auto;
    }

    Regards

    #8648

    coris8
    Participant

    Works perfectly thanks!

    #8658
    Xtemos Studio
    Xtemos Studio
    Keymaster

    You are welcome!

Viewing 13 posts - 1 through 13 (of 13 total)

The topic ‘The SOLD OUT, SALE labels don't show’ is closed to new replies.