Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinetrue
stylenone

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

...

Macros and Magento attributes composition options

For attributes composition you can use either predefined macros or you can combine various Magento attribute to create required composition

Image Added

Macros  

You can use predefined macros for certain type of operations

Code Block
titleExample
// decreasing the price by 5
[[{{price_final_include_tax}} - 5]]
 

...

Image Added

Attribute Merge

You can simply merge any selected attributes.

Code Block
title

...

Attribute merge example
// optimization of URL for better SEO
{{brand}}-{{size}}-only-{{price_incl_vat}}-{{currency}}
>> Adidas-L-only-55-Euro
 
// optimization of product names for better SEO
{{brand}} T-shirt {{name}} {{size}} for only {{price_incl_vat}} {{currency}}
>> Adidas T-shirt DoItNow XL for only 55 Euro

...

 
// note double curling brackets surrounding attribute codes

Image Added

Increase

...

price by 15%

...

You can increase selected price by

...

15% (the percentage amount is possible to adjust).

Code Block
title

...

Increasing the price by 15% example
// increasing the price by 15%
[[round({{nkp_price_final_include_tax}} * 1.15, 2)]]

...

 
// note double curling brackets surrounding attribute codes

Image Added

Increase price by 25

...

You can easily increase selected price by

...

25 (the increase amount is possible to adjust).

Code Block
title

...

Increasing the price by 25 example
// increasing the price by 25
[[round({{nkp_price_final_include_tax}} + 25, 2)]]

...

 
// note double curling brackets surrounding attribute codes

Image Added

Empty

...

Math Operation

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

Code Block
titleMath Operation example
// standard math operations
[[ +-*/ ]]

Empty Attribute Condition

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

Code Block
title

...

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

Image Added

Attribute Value

...

Condition

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

Code Block
title

...

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)
[[ ( {{nkp_price_final_include_tax}} > 100 ) ?  {{nkp_price_final_include_tax}}: {{nkp_price_final_include_tax}} + 20;]]
 
// note double curling brackets surrounding attribute codes

Image Added

Magento Attributes 

...

You can combine

...

 

 

 

Napsat podle toho jak se to pouziva na testu

Inspirace:

Attributes Mapping#Attributemerging

Attributes Mapping#Pricemargin

 

/wiki/spaces/koongo/pages/788136

/wiki/spaces/koongo/pages/788136

/wiki/spaces/koongo/pages/788136 - Javascript funkce volat v koongo connectoru nejdouvarious Magento attributes to export required results.

Image Added

Code Block
titleMagento 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]]