Versions Compared

Key

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

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

 

  1. Macros - You can use predefined macros for certain type of operations

     

    • Attribute Merge - Simple merge of selected attributes

      Code Block
      titleExample
      // 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
    • Increase Price by 15% - Increase of selected price by 15 %

      Code Block
      titleExample
      // increasing the price by 15%
      [[round({{nkp_price_final_include_tax}} * 1.15, 2)]]
       
      // note double curling brackets surrounding attribute codes
    • Increase price by 25 - Increase of selected price by certain amount - [[round({{nkp_price_final_include_tax}} + 25, 2)]]

      Code Block
      titleExample
      // increasing the price by 25
      [[round({{nkp_price_final_include_tax}} + 25, 2)]]
       
      // note double curling brackets surrounding attribute codes
    • Empty Math Operation - Various math operations  


    • Empty Attribute Condition - Export non-empty attribute value

      Code Block
      titleExample
       // 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

      Code Block
      titleExample
      // use cases for shipping cost export
       
      // 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
  2. Magento Attributes - You can combine various magento attributes to get required results

...