How to use command to format attribute output?

Output Formatting Command:

Using the output formatting command, it is possible to format any attribute value, for example, converting the product title to Uppercase, Lowercase, String Replace, etc. Every formatter should be enclosed with the third bracket and must have space before every parameter. All supported formatting commands are listed below: 

		[substr 0 80], [...]
Formatter Description Schema Command
strip_tags Remove all html tags  [strip_tags]  [strip_tags], […]
       
htmlentities Convert all applicable characters to HTML entities [htmlentities]  [htmlentities], […]
clear Remove all non utf-8 characters from the string  [clear]  [clear], […]
substr Truncate the string [substr from to] [substr 0 80], […]
str_replace  Replace any string  [str_replace => from => to] [str_replace => ABC => XYZ], […] or

to replace comma, the command will be
[ str_replace => ABC => comma ]

preg_replace  Replace any string  [preg_replace  from  to] [preg_replace /abc/ qwe], […]  
ucwords  Uppercase the first character of each word in the string [ucwords]  [ucwords], […]
ucfirst  Make the string’s first character uppercase  [ucfirst]  [ucfirst], […]
strtoupper Transform the string to upper case [strtoupper]  [strtoupper], […]
strtolower Transform the string to lower case [strtolower] [strtolower], […]
convert Change price currency [convert  from to ] [convert USD AUD] or  [convert AUD CHF], […]
number_format Format a number with grouped thousands [number_format decimals]

Number of decimal = 1 or 2 (any number)
Decimal separator = point or comma or space
Thousand Separator = point or comma  or space
[number_format] or 
[number_format 2] or
[number_format 2 point] or
[number_format 2 comma] or  
[number_format 2 point space]  or     
[number_format 2 point comma]  or
[number_format 2 point point ] .  or
[number_format 2 comma point ], […]
urlToUnsecure Convert all URLs to HTTP format [urlToUnsecure] [urlToUnsecure], […]
urlToSecure Convert all URLs to HTTPS format [urlToSecure] [urlToSecure], […]
  only_parent
 Only add a variable product info  [only_parent]   [only_parent], […]
  parent Variable product info if variable value is not empty else variation  info [parent]
 [parent], […]
  parent_if_empty Add variable product info if the variation info is empty. 
Example: Product Description
[ parent_if_empty]
[ parent_if_empty], […]
strip_shortcodes Delete shortcodes from the string [strip_shortcodes] [strip_shortcodes] , […]

Example image to use Output formatting commands:

How to use command to format attribute output

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.