New Landing How can we help? Cardinal Product/store banner text change

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Cardinal
  • #126384
    illustrate74
    Member
    Post count: 63

    I need to change the banner text from “out of stock” to “sold out” on the product image..please see the attached image

    Please can someone point me in the right direction to which file i need to make the alterations.

    the shop web address is – http://rmer1.com/shop

    Many thanks
    Bradley

    Attachments:
    You must be logged in to view attached files.
    #126392
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please insert given below php code at functions.php of your child theme.

    <?php
     
    /**
    * Change In Stock / Out of Stock Text
    */
     
    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'] = __('Sold Out', 'woocommerce');
    }
     
    return $availability;
    }
    ?>
    

    Thanks
    Mohammad

    #126401
    illustrate74
    Member
    Post count: 63

    Hi Mohammad, thank you!
    I had already added this code…but needed the code to change the the text overlay on the product photo?

    Is this possible?

    Many thankss
    Bradley

    #126421
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    See below:

    cardinal/woocommerce/content-product.php:

       98              if ( sf_is_out_of_stock() ) {
       99  
      100:                 echo '<span class="out-of-stock-badge">' . __( 'Out of Stock', 'swiftframework' ) . '</span>';
      101  
      102              } else if ( $product->is_on_sale() ) {

    cardinal/woocommerce/single-product/product-image.php:

    35                  if ( sf_is_out_of_stock() ) {
       36  
       37:                     echo '<span class="out-of-stock-badge">' . __( 'Out of Stock', 'swiftframework' ) . '</span>';
       38  
       39                  } else if ( $product->is_on_sale() ) {

    – Kyle

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

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register