• Im new on wordpress and shortcodes. I have no idea how can i add custom text after the stock amount on product page:

    https://gyazo.com/a7a5ac281c23b7f5f258437df5a87a55

    shortcode im using:

    [slw_product_locations show_qty=”yes” show_stock_status=”no” show_empty_stock=”yes”]

    • This topic was modified 3 years, 1 month ago by xroc.
    • This topic was modified 3 years, 1 month ago by xroc.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @xroc

    You can by adding the code snippet below to your theme functions.php file:

    add_filter( 'slw_shortcode_product_location_stock', function( $location_stock, $location ) {
    	$location_stock .= ' my custom text here'; // add your text here
    	return $location_stock;
    }, 10, 2 );
    Thread Starter xroc

    (@xroc)

    Hey, thank you for the response.

    One more thing. Is there way to add different text after each location? Like The ETA on each location

    And If there is over 25 products on stock is there a way do display like 25+ and not like 26, 27 etc?

    • This reply was modified 3 years ago by xroc.
    • This reply was modified 3 years ago by xroc.
    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @xroc

    Just do this:

    add_filter( 'slw_shortcode_product_location_stock', function( $location_stock, $location ) {
    	if( $location_stock > 25 ) {
    		$location_stock .= ' (25+)';
    	}
    	return $location_stock;
    }, 10, 2 );
    Thread Starter xroc

    (@xroc)

    Thanks for responses. Is there a way we can live chat regarding the plugin? i have few problems and its easier to troubleshoot on a live chat. jere.m.seppa@gmail.com email me if possible 🙂 thank you

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @xroc

    Send me an email please.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding custom text after stock amount’ is closed to new replies.