Owl Cloud Services
Shopware 5 Connector
Shopware 6 Connector
Chaining format plugins
Now that you know the basics of format plugins, it’s time to get our hands dirty with a few configuration examples.
In this tutorial we will create some example configurations by chaining plugins together.
The used format plugins will only be skimmed over. To learn more about what each one can do, please check out the format plugin category to the left.
To showcase the output, the SimpleExcel-Connector will be used. However, you can follow along using any connector.
Loading The Value
Let’s say we have the weight of a product in kilogramm:
Our target system requires wheight given in gramms, so we need to transform it.
Let’s start by adding the value to our datamap and exporting the formatted value.
This will result in the following output:
As you can see, we didn’t just export the value, but also the unit. This also means, this is a text, which can’t be used to calculate anything. To calculate we first need the raw, numeric value.
To get the raw value, export the value unformatted:
That’s much better! Now we can add our actual transformation.
Now that we have a numeric value, we need to add another plugin to our configuration.
Open the setting of the CS unformatted value plugin.
Once there select mathematical operation for formatting the result value (shown in red).
After selecting the plugin, save your options.
Following that, open the configuration of the new plugin by either selecting it in the tree to the left or clicking the gear icon (shown in green).
Transforming Kilogramm To Gramm
Transforming the value is pretty straightforward. All we have to do is multiply by a thousand.
This is an example configuration with rounding and no digits after the decimal point.
After exporting we now have our wheight in gramms:
You can chain plugins to format a value in several steps.
A Plugin will use the previous plugins value as input. However, some plugins do not need an input and will simply ignore it.
There is no limit to the amount of plugins you can chain. Use as many plugins as you want or need!