New Landing How can we help? Atelier change "sold out" text

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Atelier
  • #289032
    techtherapy
    Member
    Post count: 105

    Is there any way to change the “sold out” text to simply read “sold”? I tried to do it by replacing the text string in functions.php but that didn’t work.

    #289067
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Add this to your child theme’s functions.php file:

     /* PRODUCT BADGE
        ================================================== */
        if ( ! function_exists( 'sf_woo_product_badge' ) ) {
    	    function sf_woo_product_badge() {
    	    	global $product, $post, $sf_options;
    	    	$postdate 		= get_the_time( 'Y-m-d' );			// Post date
    	    	$postdatestamp 	= strtotime( $postdate );			// Timestamped post date
    	    	$newness 		= $sf_options['new_badge']; 	// Newness in days
    	    ?>
    		    <div class="badge-wrap">
    			    <?php
    
    			    	if ( sf_is_out_of_stock() ) {
    
    			    		echo apply_filters( 'woocommerce_sold_out_flash', '<span class="out-of-stock-badge">' . __( 'Sold', 'swiftframework' ) . '</span>', $post, $product);
    
    			    	} else if ($product->is_on_sale()) {
    
    			    		echo apply_filters('woocommerce_sale_flash', '<span class="onsale">'.__( 'Sale', 'swiftframework' ).'</span>', $post, $product);
    
    			    	} else if ( ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp ) {
    
    			    		// If the product was published within the newness time frame display the new badge
    			    		echo '<span class="wc-new-badge">' . __( 'New', 'swiftframework' ) . '</span>';
    
    			    	} else if ( $product->get_price() != "" && $product->get_price() == 0 ) {
    			    		echo '<span class="free-badge">' . __( 'Free', 'swiftframework' ) . '</span>';
    
    			    	}
    			    ?>
    		    </div>
    	    <?php }
    	}

    – Kyle

    #289361
    techtherapy
    Member
    Post count: 105

    thanks!

    #289368
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Great thanks to Kyle.
    Mohammad

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