How To

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:

  1. We collect prices from your suppliers / product feeds
  2. Based on "unique field" in the export profile (usually EAN code) we compare similar products and choose the cheapest product as base price
  3. 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.

Price lookup

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":

Create new dynamic attribute

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":

Dynamic attributes 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):

Dynamic attribute value

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:

Dynamic attribute value with priority 999

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:

Dynamic attribute values list

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.

Navigate to "Export profiles" and create a new export profile with type XML / CSV / JSON. Select your preferred output format and create a simple export template similar to this:

Custom stock test export template

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.

Custom stock test CSV

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

Volume#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

 

Setting up product import to CS Cart

In this article we will explain how you can use native and powerful CS Cart product import feature and import products from Wise2Sync.

CS Cart

Use following steps to setup product import from Wise2Sync App to your CS Cart store.

1. Create export profile

Login to your account at app.wise2sync.com and navigate to "Export profiles". Click "Add profile" in the top right corner and select "Basic V2 (XML, CSV or JSON)" exporter.

2. Setup general preferences

Name your export profile, select main preferences. In this example we will use output format XML (CS Cart can also accept other formats like CSV as well). You can read more about Preferences tab in this article.

Important part here is to include full image paths in the export file. Select "Use full image path" and enter one of your Access tokens (left menu Tools → API Access Tokens).

cs_cart_export_Profile_settings.png

3. Setup export Template

CS Cart has a built in field mapping feature which comes handy when mapping Wise2Sync fields to CS Cart fields. Add some elements to the template:

cs_cart_template.png

As always, you can add as many mapped attributes in the export template. CS Cart requires "vendor" field to be present in the XML file. For this you can create a dynamic attribute or just use a blank attribute like we did:

cs_cart_vendor_attribute.png

We've skipped settings in the product filter tab. As always, when testing we recommend to filter some products and do not perform test imports with full / large catalogs.

4. Create download link

After you've created your export profile and assigned some repricing rules - you need to run the export profile (if your have an "auto" type export profile - it will be executed automatically on certain time slots).

Once export profile turns back to "Completed" status, your export file is ready (to double check - open your export profile and navigate to "Export Results" tab. There you should see one or more files.

Tip: if export file size is a few kilobytes - it might be that no products were exported. Open and view the export XML file to verify this. Most likely, you will need to adjust filtering options to include more products.

Last step is to create a download link. Read this article here how to do it. It would look similar to this:

https://app.wise2sync.com/api/exporters/..../results/latest?access_token=YTc0M2E2MDAyZTg0MTQ0MTVlYWJjN2Q2M......
5. Set up product import in CS Cart

Login to your CS Cart admin panel and navigate to Administration → Import data → Products. You can find more information how to set up product import on their help page: How To: Import Products and Product Data.

Create new import and apply following settings:

cs_cart_product_import_config.png

URL: use the one you generated in Step 5.
XML Target node: "items/item"

6. Map fields in CS Cart

Fields mapping in CS Cart is standard. We used such mapping as an example:

cs_cart_field_mapping.png

Save your settings and perform a test import in CS Cart. Your new products should be imported!