How To
- Debugging product prices
- Modifying stock levels (for e.g. all stock -1)
- Modifying attribute values and using Formulas
Debugging product prices
There a few positions which need to be checked. Read this article first to understand how product price updates work. In general:
- We collect prices from your suppliers / product feeds
- Based on "unique field" in the export profile (usually EAN code) we compare similar products and choose the cheapest product as base price
- After we have determined product base price, pricing rules are applied and price markup / discount is added
Please note that repricing rules can be individual per export profile. Make sure you check which pricing rules are applied to your specific export profile.
So, lets say you suspect that exported product price is not the way it should be. Navigate to Tools → Product Price Checker and use "Search Criteria" form to enter product details. After you click "Search" - product information will appear on the right side.
There can be multiple rules applied to the product. This example above shows that Pricing rule #205 is applied, product base / starting price was 21.6337 and the output result is 22.719585.
Modifying stock levels (for e.g. all stock -1)
In this article we will explain how to modify exported stock levels. This is useful when you want to reduce the risks of overselling. For example, if your supplier has 5 items in stock, but you want to export 4. Or if they have 1 item, then you export 0.
Step 1. Create a dynamic attribute
We will use the dynamic attribute which will hold the custom stock values. Navigate to "Dynamic attributes" and click "Add attribute". Lets give this attribute a code custom_qty
and select type "number":
Click create to save this selection.
Step 2. Assign dynamic attribute values
We can now assign values to this dynamic attribute. Click on a green icon "Values list":
New window will open. Click "Add value" and a pop-up will open. Make selection as in the example below (if product stock is greater or equal to 1, than custom_qty
will be reduced by 1):
Click "Create" and your new value rule will be saved. Create one more value as a fallback - in case quantity from supplier is less or equal to 1, we will assign 0:
Note the priority field - it has to be higher than the the first value we created. Click "Create" to save this value and your whole values list would look something like this:
That is it - we now have the dynamic attribute with reduced stock levels by 1.
Step 3. Test it (optional)
Before you start exporting this newly created attribute, we recommend to test and make sure it works the way you wanted.
This will allow to see original and modified stock side by side. Save the template and execute it (add it to queue). Once it's status becomes "Completed" - open the generated file in the results tab.
See our example CSV. Columns C and D - custom_qty
has smaller value than qty
.
Step 4. Add "Custom QTY" to your export profile template
Open you preferred export profile and add this custom_qty
attribute to the template (most often you will want to use this instead of the original qty
).
That is it! If you have any questions - do not hesitate to contact us.
Modifying attribute values and using Formulas
As you have noticed, almost every product attribute can be accessed in export templates or dynamic attributes with an expression like {attr:attribute_code}
. In this section we will explain, how you can modify attribute values or make some manipulation with them.
Retrieving the N-th element of an Array
Some attributes can have multiple values (for example one product can be assigned to multiple categories). Depending on your Export profile template, our app will automatically select first category or do some needed modifications.
However, if you use the static file export (CSV / XML / JSON), you can set to export only the N-th category. If attribute is not array (for example string, integer), it will skip modification.
Here are a few examples:
{attr:categories|[0]}
- will return the first element of and array{attr:names|[english]}
- you can get array element by key{attr:names|[en]|[label]}
- multidimensional arrays are also supported
Serialization to JSON
{attr:categories|json}
- if Categories value is array, then this modifier will convert it to JSON string
Value type conversion
Wise2Sync mainly holds two types of supplier attributes: numeric and text. You can switch between types like this:
{attr:qty|txt}
- Typecast conversion to String |txt
. Value will be converted to String type{attr:qty|int}
- Typecast conversion to Int |int
. Value will be converted to Int type{attr:length|float}
- Typecast conversion to Float |float[:precision]
. For example {attr:length|float:2} will convert Length value to Float type with precision of 2.
Examples
#1 Product volume. Lets say, you want to calculate total product volume in cubic meters, when you supplier only provides with, height, and length in centimeters.
What you do is create a dynamic attribute with type "number" and set a value expression:
{attr:length|float}/100 * {attr:height|float}/100 * {attr:width|float}/100
#2 Custom product name. Lets say you would like to have have custom product names, which would include product Category label as a prefix. So, what you would do is create a textual dynamic attribute "Custom Name" and set its value as follows:
{attr:lab_val_category|[0]} - {attr:name}
So if your product name was "Funny Sunshine 101" and it belongs to a category "Eye Glasses", then product "Custom name" would be "Eye Glasses - Funny Sunshine 101".
Support across the Wise2Sync App
Type | Expression | Example | Dynamic Attributes | Export profile Templates | Repricing Rules |
Array element value | |[n] |
{attr:category|[0]} |
Yes | Yes | No |
Array serialization to JSON | |json |
{attr:tags|json} |
Yes | Yes | No |
Value type conversion | |txt , |int , |float[:precision] |
{attr:length|float:2} |
Yes | Yes | No |
Numeric operators | ceil(..) , floor(..) , round(..) , abs(..) |
ceil({attr:length|float}) |
Yes | Yes | Yes |
Find lowest / highest value | min(..) , max(..) |
min({attr:price}, 0) |
Yes | Yes | Yes |
Current Date | {date:format} |
{date:Y-m-d} |
Yes | Yes | No |