New Landing How can we help? Themeforest Theme Support Nota Changing the "sold out" text to "coming soon"

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Nota
  • #317357
    yeager444
    Member
    Post count: 13

    Greetings. We also need to know how to change the text on our products from “sold out” to “coming soon” when we’re out of inventory. Thanks!

    #317368
    David Martin – Support
    Moderator
    Post count: 20834

    Please install and activate the supplied child theme, inside the child theme functions.php file paste this and change “Sold out”.

        /* PRODUCT BADGE
        ================================================== */
        if ( ! function_exists( 'nota_woo_product_badge' ) ) {
    	    function nota_woo_product_badge() {
    	    	
    	    	global $product, $post;
    	    	$nota_options = nota_get_theme_opts();
    	    	
    	    	$postdate 		= get_the_time( 'Y-m-d' );		// Post date
    	    	$postdatestamp 	= strtotime( $postdate );		// Timestamped post date
    	    	$newness 		= $nota_options['new_badge']; 	// Newness in days
    			$percentage_off = sf_product_get_sale_percent( $product->id );
    			
    			$extra_class = $out = $percentage_off = "";
    	
    			if ( nota_is_out_of_stock() || $product->is_on_sale() || ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp || $product->get_price() != "" && $product->get_price() == 0 ) {
    		    	if ( nota_is_out_of_stock() ) {
    		    		$out .= '<span class="out-of-stock-badge">' . esc_html__( 'Sold out', 'nota' ) . '</span>';
    		    		$extra_class = "sf-out-of-stock";
    		    	} else if ( $product->is_on_sale() ) {
    		    		$out .= apply_filters('woocommerce_sale_flash', '<span class="onsale">'.esc_html__( 'Sale', 'nota' ).'</span>', $post, $product);
    		    		$extra_class = "sf-on-sale";
    		    	} else if ( ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp ) {
    		    		// If the product was published within the newness time frame display the new badge
    		    		$out .= '<span class="wc-new-badge">' . esc_html__( 'New', 'nota' ) . '</span>';
    		    		$extra_class = "sf-new-stock";
    		    	} else if ( $product->get_price() != "" && $product->get_price() == 0 ) {
    		    		$out .= '<span class="free-badge">' . esc_html__( 'Free', 'nota' ) . '</span>';
    		    		$extra_class = "sf-free-stock";
    		    	}
    		    	echo '<div class="badge-wrap ' . esc_attr( $extra_class ) . '">' . $out;
    	    		echo '</div>';
    	    	}
    	   }
    	}
    #317384
    yeager444
    Member
    Post count: 13

    Ok, excellent. Actually, my client wants to add coming soon to the choices, so there would be “in stock”, “sold out”, and “coming soon”. Is that possible? Thanks.

    #317407
    David Martin – Support
    Moderator
    Post count: 20834

    Glad to help. That is not possible as it’s not part of WooCommerce functionality, rather it’s plugin/customisation territory.
    You could re-name “Sold out” to coming soon?

    Thanks.

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