Table of Contents

General settings

The majority of the feed-specific attributes have been set up automaticaly but is some cases you may find usefull to adjust attribute behavior more specificaly.



Disabled row in Attribute mapping table means that the given row is already preconfigured according to the feed requirements and it is not possible to change that option.

Convert attribute value

In some cases you may need to convert Magento-stored attribute value to different XML feed value. Also, you canuse this feature for simple attribute translations.

Regular expressions

Support for regular expressions was improved in connector version 6.5.0.0. Thus, we encourage you to upgrade. For details see issue XML-642.

You can use regular expressions to convert attribute values. Regular expressions must be enclosed in slashes:

To convert all small "a" to big "A" letters in the attribute value, use the following regular expression:
From: /[a]/
To: A
This rule converts "BlackBerry 8100 Pearl" to "BlAckBerry 8100 PeArl".
 
To remove all HTML tags apart from I, EM, B, STRONG, UL, LI, U and BR
From: /\<((?!i\>|\/i|i\/|em\>|\/em|em\/|b\>|\/b|b\/|strong\>|\/strong|strong\/|ul\>|\/ul|ul\/|li\>|\/li|li\/|u\>|\/u|u\/|br\>|\/br|br\/)([^\>]*))\>/
To: empty

To transform all non-empty strings into TRUE
From: /.+/
To: empty

To export only image file name, instead of full image url. 
From: /.+\//
To: empty
For example value http://www.domain.com/media/catalog/product/t/0/t0001_love.jpg is transformed into t0001_love.jpg
 
To export sub-string till 2nd space.
From: /([^\s]+\s{1}[^\s]+)(.*)/
To: $1
For example value Invicta Speedway Chronograf 9211 is transformed into Invicta Speedway
 
To transform string which contains WOMEN to WOMEN and other strings to MEN.
Input: MEN, SNEAKERS or SNEAKERS, WOMEN

From: /.*WOMEN.*/  To: WOMEN
From: /^(?!WOMEN).*/  To: MEN

PHP function preg_replace () is used for conversions.

Attribute merging

This feature may be very usefull for better SEO!

In the columns Prefix and Suffix you may use special expressions allowing you to merge any attribute values and/or combine attribute values with constat values.

Color-{{attribute_code1}}-size-{{attribute_code2}}


Price margin

Since Koongo Connector version 6.5.0.0 you may use basic mathematical operations to handle price attributes or any numeric attribute values:

In Prefix or Sufix column you may use following expression to increases price by 15%.
[[{{price_final_include_tax}} * 1.15]]

// increasing the price by 25
[[{{price_final_include_tax}} + 25]]

Note that attribute code you may find in attribute detail under Catalog > Attributes > Manage Attributes.

Conditions

Empty Attribute Condition

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

// if value of the 'name' attribute is not empty the 'name' value is used, otherwise it is used the value of the 'description' attribute
  [[('{{name}}' != '') ? '{{name}}': '{{description}}']]
 
// 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.

// 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

Addition of a new attribute

If the given feed template allows it, you can add custom attributes at the end of Attributes mapping table:

Troubleshooting

Magento attribute displayed in red color

Following attributes missing in product flat catalog

Price including VAT export

Related articles