Viewing 7 posts - 1 through 7 (of 7 total)
  • #153293
    sukiya
    Member
    Post count: 218

    Hi everybody,

    is it possible to put a different text if a product is reduced instead of “sale”?

    please look into the attachment to see what I am talking about.

    thanks a lot!
    best wishes,
    Lisa

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

    Hi,
    Please try this plugin https://wordpress.org/plugins/woocommerce-smart-sale-badge/faq/.
    Thanks
    Mohammad

    #153318
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Hi

    Please see below for the files and line numbers you need to edit:

    /Applications/MAMP/htdocs/neighborhood/wp-content/themes/neighborhood/woocommerce/content-product.php:
    
       81  				echo '<span class="out-of-stock-badge">' . __( 'Out of Stock', 'swiftframework' ) . '</span>';
       82  
       83: 			} else if ($product->is_on_sale()) {
       84  
       85: 				echo apply_filters('woocommerce_sale_flash', '<span class="onsale">'. __( 'Sale!', 'swiftframework' ).'</span>', $post, $product);
       86  
       87  			} else if (!$product->get_price()) {
       ..
      197  			 * woocommerce_before_shop_loop_item_title hook
      198  			 *
      199: 			 * @hooked woocommerce_show_product_loop_sale_flash - 10
      200  			 * @hooked woocommerce_template_loop_product_thumbnail - 10
      201  			 */
    
    /Applications/MAMP/htdocs/neighborhood/wp-content/themes/neighborhood/woocommerce/content-single-product.php:
    
       42  		 * woocommerce_show_product_images hook
       43  		 *
       44: 		 * @hooked woocommerce_show_product_sale_flash - 10
       45  		 * @hooked woocommerce_show_product_images - 20
       46  		 */
    
    /Applications/MAMP/htdocs/neighborhood/wp-content/themes/neighborhood/woocommerce/single-product/product-image.php:
    
       24  			echo '<span class="out-of-stock-badge">' . __( 'Out of Stock', 'swiftframework' ) . '</span>';
       25  		
       26: 		} else if ($product->is_on_sale()) {
       27  				
       28: 			echo apply_filters('woocommerce_sale_flash', '<span class="onsale">'.__( 'Sale!', 'swiftframework' ).'</span>', $post, $product);
       29  				
       30  		} else if (!$product->get_price()) {

    – Kyle

    #153320
    sukiya
    Member
    Post count: 218

    Hi Mohammad & Kyle,

    thanks for your advices.
    so do you think its better to work with the plugin or with the product-php?

    best wishes,
    Lisa

    #153321
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    The plugin will not work as we have overwritten the one from woocommerce in the theme. You’ll need to edit the files that I mentioned

    – Kyle

    #153438
    sukiya
    Member
    Post count: 218

    Hi Kyle,

    thank you!

    this is working!

    best wishes,
    Lisa

    #153439
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    No problem

Viewing 7 posts - 1 through 7 (of 7 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