Changing "Sold Out" image overlay text

Home Forums Jevelin Theme Changing "Sold Out" image overlay text

Home Forums Jevelin Theme Changing "Sold Out" image overlay text

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • WHD
    Participant

    Is there any way to change the text that appears on the “Sold Out”  bubble that shows on the woocommerce product image?  It’s not pulling it from the regular woocommerce “availability” field.

     

    Thanks.

    Hi @WHD,

     

    I hope you are well today and thank you for your question.

     

    You can change it as described in the following pages.

     

    https://www.templatemonster.com/help/woocommerce-how-to-change-in-stock-out-of-stock-text-displayed-on-a-product-page.html

    http://kb.oboxthemes.com/articles/how-do-i-change-the-out-of-stock-text/

     

    Best regards,
    Shufflehound team

    WHD
    Participant

    I’ve already done that and it changes the text within the body on the product page, but does not change the bubble text that overlays on the images.  As mentioned, that doesn’t seem to be using the standard woocommerce availability value.

    Attachments:
    You must be logged in to view attached files.

    Could you please share me the page URL from your site where it is displaying so that i can help you to change it?

    WHD
    Participant

    Sure here it is:

    https://socialsparklingwine.com/buy/

     

    And you’ll see if you click through to a product and look below the description it says “Back in Stock Soon”, which is coming from this:

     

    add_filter( ‘woocommerce_get_availability’, ‘wcs_custom_get_availability’, 1, 2);
    function wcs_custom_get_availability( $availability, $_product ) {

    // Change Out of Stock Text
    if ( ! $_product->is_in_stock() ) {
    $availability[‘availability’] = __(‘Back In Stock Soon!’, ‘woocommerce’);
    }
    return $availability;
    }

    WHD
    Participant

    This is the html output of the part I’m trying to change:

     

    <span class=”sh-popover-mini sh-popover-mini-dark sh- fadeIn” style=”visibility: visible; animation-name: fadeIn;”>Sold out</span>

    I can see it is displayed by the following theme code added in the theme file /jevelin/woocommerce/loop/sale-flash.php so it is translation ready.

     

    if ( $product->is_in_stock() && $product->is_on_sale() ) {
    	echo apply_filters( 'woocommerce_sale_flash', '<span class="sh-popover-mini">' . esc_html__( 'Sale!', 'jevelin' ) . '</span>', $post, $product );
    } else if( ! $product->is_in_stock() ) {
    	echo apply_filters( 'woocommerce_sale_flash', '<span class="sh-popover-mini sh-popover-mini-dark">' . esc_html__( 'Sold out', 'jevelin' ) . '</span>', $post, $product );
    }

     

    You can change this translation ready text either by translating the theme or using any of the following plugins. Please note the theme domain is jevelin

     

    https://wordpress.org/plugins/say-what/

    https://wordpress.org/plugins/real-time-find-and-replace/

     

     

     

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