TEST MODE
Show details for 5 _ Additional Fields Pricing Script

5 _ Additional Fields Pricing Script

This Product

NOTE: An issue has been found with this function. This product will explain how this feature works, however at the time of writing (11/10/23) it will not function correctly. This will be fixed soon.

This example shows how we can use an uploaded CSV to control product properties other than the pricing.

Here, for instance, we have a columns in the uploaded CSV covering "Weight". By linking this within the pricing script configuration, we are able to control various product properties based on the attribute selection.

 

Within the configuration of the pricing script:

  • csvKey is the header within the CSV file
  • itemField is the name of the field requiring updating.

 

Fields able to be modified using this methodology include:

  • ****

 

Pricing script configuration

{
    "filePath": "Additional Fields.csv",
    "itemPropertyAdjustments": [{
        "csvKey": "Weight",
        "itemField": "Weight"
    }],
    "debugMode": true
}

Pricing script CSV

A B Price Weight
1 1 2 2
2 1 3 3
3 1 4 4
1 2 3 3
2 2 4 4
3 2 5 5
1 3 4 4
2 3 5 5
3 3 6 6
A *
B *
£2.00
Config qty column name null
Config qty useTierPrice false
Attributes length 2
Attribute name: A with value: 1
Attribute name: B with value: 1
Cached attributes length: 2
filename = Additional Fields.csv
columns initialized: A,B,Price,Weight
get csv price
Checking row matching for columnName = A row value= 1
columnName = A attrValue= 1 temp= 1
Checking row matching for columnName = B row value= 1
columnName = B attrValue= 1 temp= 1
Checking row matching for columnName = Price row value= 2
Checking row matching for columnName = Weight row value= 2000
Row: (1,1,2,2000) with index: 1 is matching: true
price column index=2
price from row = 2
set attributes from csv length = 0
set item properties from csv length = 1
property mapping csv key Weight column index=3
property mapping csv key Weight csv value= 2000
Setting item property: Weight. With current value: 0. To: 2000
Item field value after: 0
product cost column index=-1
unit price = 2