WordPress.org

Support

Support » Plugins and Hacks » can i change the "New Badge" ???

can i change the "New Badge" ???

Viewing 4 replies - 1 through 4 (of 4 total)
  • MadsSafi
    Participant

    @madssafi

    Im also looking for a way to translate the little “New”-badge. I can se that it is not a graphic, but a small css-button(?) with a text-label. But where can the word “New” be translated inte other language/word? (and is it also possible to change the color of the button?)
    Hope someone have a solution…?
    🙂 Mads

    Plugin Author James Koster
    Participant

    @jameskoster

    You should be able to translate this string using the CodeStyling Localization plugin.

    MadsSafi
    Participant

    @madssafi

    Hi again,
    Thanks for your reply. But I have already tried with the plugin, and it wont work. 🙁

    BUT 🙂
    Im a happy man, because your answer made me look into it again, and I have now solved the problem. I found this code in “archive-customiser.php” and close to the end I have changed “New” to the danish “Ny”, and it works great now 🙂

    function woocommerce_pac_show_product_loop_new_badge() {
    				$postdate 		= get_the_time( 'Y-m-d' );			// Post date
    				$postdatestamp 	= strtotime( $postdate );			// Timestamped post date
    				$newness 		= get_option( 'wc_pac_newness' ); 	// Newness in days as defined by option
    
    				if ( ( time() - ( 60 * 60 * 24 * $newness ) ) < $postdatestamp ) { // If the product was published within the newness time frame display the new badge
    					echo '<p><span class="wc-new-badge">' . __( 'Ny', 'woocommerce-product-archive-customiser' ) . '</span></p>';
    				}

    Maybe this fix could also help ‘Bildfabrik’?

    Stay cool,
    🙂 Mads

    How do I change the WooCommerce New Product Badge button color?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘can i change the "New Badge" ???’ is closed to new replies.