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 matter should be enclosed with the third bracket and have space before every parameter. All supported formatting commands are listed below: 

[substr 0 80], […]

Formatter Description Schema Command:

FormatterDescriptionSchemaCommand
strip_tagsRemove all HTML tags [strip_tags] [strip_tags], […]
htmlentitiesConvert all applicable characters to HTML entities[htmlentities] [htmlentities], […]
clearRemove all non-utf-8 characters from the string [clear] [clear], […]
substrTruncate 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], […]
strtoupperTransform the string to upper case[strtoupper][strtoupper], […]
strtolowerTransform the string to lowercase[strtolower][strtolower], […]
convert
NOTE: This command is not functional anymore
Change price currency[convert  from to ][convert USD AUD] or  [convert AUD CHF], […]
number_formatFormat 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 ], […]
urlToUnsecureConvert all URLs to HTTP format[urlToUnsecure][urlToUnsecure], […]
urlToSecureConvert all URLs to HTTPS format[urlToSecure][urlToSecure], […]
only_parent Only add a variable product info [only_parent]  [only_parent], […]
parentVariable product info if variable value is not empty else variation  info[parent] [parent], […]
parent_if_emptyAdd variable product info if the variation info is empty. 
Example: Product Description
parent_if_empty][ parent_if_empty], […]
strip_shortcodesDelete shortcodes from the string[strip_shortcodes][strip_shortcodes] , […]

Example image from CTX Feed to use Output formatting commands:

How to use command to format attribute output
CTX Feed Free
4 thoughts
  1. Hi!
    I want to replace all empty descriptions with a “there’s no description here!” description.
    Is there a command for “empty” or something similar?
    I was thinking about the str_replace command, but I can’t find the word for empty.
    Thanks!

    1. Hi! You can do it using Dynamic attribute if you are using the pro version of CTX Feed. To know how, please, contact us from here – webappick.com/contact

  2. Hi,

    If I want to put all the product title in lowercase except the first string of each word .
    An Example would be:
    My Website: SNEAKERS BLUE
    I need: Sneakers Blue
    In the output type I can make this: ucwords , strtolower ?

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.