Page tree
Skip to end of metadata
Go to start of metadata

You can combine attribute values with text values or define math operations and conditions. You can select available macros to see example statements.

Macros  

You can use predefined macros for certain type of operations.

Attribute Merge

You can simply merge any selected attributes.

Attribute merge example
// optimization of URL for better SEO
{{brand}}-{{size}}-only-{{price_final_include_tax}}-{{currency}}
>> Adidas-L-only-55-Euro
 
// optimization of product names for better SEO
{{brand}} T-shirt {{name}} {{size}} for only {{price_final_include_tax}} {{currency}}
>> Adidas T-shirt DoItNow XL for only 55 Euro
 
// note double curling brackets surrounding attribute codes

Handling numeric attributes

 You can increase or decrease values of numeric attributes. 

  • You can use any basic mathematical operators, such as +, -, * and /

Rounding

Rounding is done automatically according to the specification of given feed or channel.

Increase price by 15%

You can increase selected price by 15% (the percentage amount is possible to adjust).

Increasing the price by 15% example
// increasing the price by 15%
[[{{price_final_include_tax}} * 1.15]]
 
// note double curling brackets surrounding attribute codes

Increase price by 25

You can easily increase selected price by 25 (the increase amount is possible to adjust).

Increasing the price by 25 example
// increasing the price by 25
[[{{price_final_include_tax}} + 25]]
 
// note double curling brackets surrounding attribute codes

Empty Math Operation

You can use various types of math operations to combine attributes and values.

Math Operation example
// standard math operations
[[ +-*/ ]]

Conditions

Empty Attribute Condition

You can set a condition to export non-empty values only.

Empty Attribute Condition example
// if value of the 'meta_title' attribute is not empty the 'meta_title' value is used, otherwise it is used the value of the 'name' attribute
 [[('{{meta_title}}' != '')? '{{meta_title}}': '{{name}}';]]
 
// note double curling brackets surrounding attribute codes

Attribute Value Condition

You can define a value condition to modify exported value based on the input value.

Attribute Value Condition example
// if product price is higher than 100 then use product price as the final price, otherwise increase the price for 20 (adding 20 as shipping costs)
[[({{price_final_include_tax}} > 100) ? {{price_final_include_tax}} : {{price_final_include_tax}} + 20]]
 
// note double curling brackets surrounding attribute codes

JS functions and conditions

You can use various js functions.

Example
//Export sku only if it is longer than 6 characters, otherwise export empty string
[['{{sku}}'.length > 6 ? '{{sku}}': '']]

Timestamp settings (Facebook channel)

Facebook feed requires to set the "sale_price_effective_date" in the format below:

2017-01-03T00:01-0100/2017-01-26T23:59-0100


You can do it be setting 2 conditions. 

 

//For "g:sale_price_effective_date FROM" attribute
[[ ("{{special_from_date}}" != "")? "{{special_from_date}}T00:01-0100":"" ]]
 
//For "g:sale_price_effective_date TO" attribute
[[ ("{{special_to_date}}" != "")? "{{special_to_date}}T23:59-0100":"" ]]

 

 


Store Attributes 

You can combine various Store attributes to export required results.

Magento Attributes combinations example
// decreasing the price by 5
[[{{price_final_include_tax}} - 5]]
 
// use cases for shipping cost export
// if product prices is higher than 50 then set shipping price as 3.5, else zero price Ci.e. free shipping)
[[({{price}} > 50) ? 0 : 3.5]]
 
// if products weight is higher than 100 then increase shipping cost by 10, else export base shipping cost
[[{{weight}} > 100) ? {{shipping_cost}} : {{shipping_cost}} + 10]]

 

 

  • No labels