Skip to content
  • There are no suggestions because the search field is empty.

GPC Apac - Sparesbox, AMX, Rare Spares, and Resto Country Spares

Review GPC Apac - Sparesbox, AMX, Rare Spares, and Resto Country Spares

What Deb thinks is missing

Product groups by price (implications due to the dev work)

Do we need anything specific re refunds?

 Sparesbox Specific Information

Currently, Sparesbox has one Production account on m4 and one dev account that is not actively used.

Sparesbox Price

Sparesbox has had custom development work so that Omnivore can pull the marketplace price from Shopify metafields

The eBay price development work replaced the standard Shopify price field with the eBay price metafield so when looking at price in the Omnivore product page you will be seeing the eBay price in all standard price fields except in the Amazon product view (where you will see the Amazon price).

Neither eBay price nor Amazon price is updated by webhooks

eBay

Sparesbox has had custom development work so that Omnivore can pull the eBay price from a Shopify metafield named "ebay_price"

Changing the price doesn't create a webhook, so Omnivore will not get an automatic price update. If Sparesbox make a minor edit elsewhere and Shopify creates a webhook, then we update the product including the price.

Note: The price seen in the product page

Amazon

Sparesbox has had custom development work so that Omnivore can pull the Amazon price from a Shopify metafield named "amazon_price".

Sparesbox Marketplace Product Blocking

Sparesbox has custom development that uses a Shopify Metafield to decide what marketplaces the individual product is listed to. The metafield is named sales_channel metafield. If we can see the string eBay the product will list to eBay, if we read Amazon string it will list to Amazon. e.g the following would list to both marketplaces:

"value": "[\"Amazon\",\"eBay\"]"

If for example, this was "value": "[\"eBay\"]" the product would be blocked from listing on Amazon, and in the Omnivore product page you would see Amazon Australia validation error: blocked by product filter rules

Sparesbox Dispatch/Handling Time

eBay

Development work was done so that Sparesbox could supply us with a metafield named handling_time which is sent to eBay at a product level. There needs to be a corresponding business policy to assign to as it does not overwrite the handling time . The default business policy takes precedent (as per eBay dev response - https://citybeachsoftware.freshdesk.com/a/tickets/138710).

You will see this in the data sent to eBay link from an individual product page like this

5

 

Amazon

For Amazon, the handling_time metafield has been hard coded to FulfillmentLatency which is set at a product level and overwrites the site wide setting

The handling_time value is managed by Sparesbox as a product-level metafield

NB: the same 'handling_time' metafield is used in both Amazon and eBay.

Sparesbox Ktypes

They upload a file into our seft server in /home/sparesbox/products/

The file must be named ktypes*

The file is expected to have a header with at least the columns "id" and "ktypnr" which is all we use.

The id value we save it as "sku" in the ktype_data table and we should have it as variant mpn.

The script upload-ktypes.sh will upload the file to their account on m4 via Omnivore v1 api, that creates a job named "external product import"

https://m4.omnivore.com.au/job/list?type=EXTERNAL_PRODUCT_IMPORT&siteId=9745

The job is set to fail if the file is smaller than a given size, currently 40MB. This was a fix for them uploading bogus small files on top of the real production one. If the job fails, we confirm with them if the file size is correct and adjust the limit in the code.

The script runs now every hour, but since they only upload one file per day, the actual upload and job happen once per day:

crontab -u sparesbox -l

0 * * * * /home/sparesbox/upload-ktypes.sh

30 * * * * /home/sparesbox/dev-upload-ktypes.sh

cat /home/sparesbox/upload-ktypes.sh

#!/bin/sh

if [ "`ls /home/sparesbox/products/ | grep ktypes | wc -l`" != "0" ] ; then

FILENAME=`ls -tr /home/sparesbox/products/ktypes* | head -1`

echo About to upload file $FILENAME

curl -s --request POST -T $FILENAME "https://sparesbox-api:uVdGkYklbC8VpSsoe4YH3nbf5xfwf6av@m4.omnivore.com.au/v1/retailers/sparesbox/jobs/external_products"

gzip -9f $FILENAME

mv -f $FILENAME.gz /home/sparesbox/archive/products/

fi

The job uses SparesboxHelper.loadKtypesFromFile() to load the csv file content into am Omnivore table named ktype_data with the associated domain class KtypeData.

The eBay product encoder uses MarketplaceProduct.findKtypes() that in turn uses the KtypeData.

If a record is found, the XML payload will contain one element ItemCompatibilityList multiple with multiple elements named Compatibility.

How to see if an individual product has ktype data in Omnivore

Example

This product

https://m4.omnivore.com.au/product/view?retailerCode=sparesbox&sku=8082740707587

The Sparesbox product identifier/sku is the MPN in Omnivore, ie P0297063

The ebay marketplace product shows about 90 ktype values:

https://m4.omnivore.com.au/marketplaceProduct/view/85109960

 
 
  
  

Ktype
16921

Looking at the last import job:

https://m4.omnivore.com.au/job/view/1377307617

EXTERNAL_PRODUCT_IMPORT

{"file":"/opt/omnivore/files/retailer/incoming/sparesbox/sparesbox1709085607925.xml","wasOriginatedByUser":true,"pageSize":10000,"pageNumber":22,"totalProcessed":219199,"initialDbRowCount":214907,"fileSize":66360999,"finalDbRowCount":221235}

Find the file on the server then search for the product key, the value should be in the first column (the "id"):

grimnir@newm4p2:/opt/omnivore/files/retailer/incoming/sparesbox$ grep P0297063 sparesbox1709085607925.xml

P0297063,"20403,20408,23185,23186,23706,11262,11263,20512,108401,25249,124559,124430,22749,25334,30269,128783,30268,25250,25333,124431,13670,13671,13672,13739,13740,13741,14657,14658,14659,14915,14916,14917,15110,16272,16274,16275,16277,16591,16921,16922,16924,17239,17240,17242,17243,17540,17541,17543,17681,17682,17683,17684,17686,17690,24611,25242,25243,25299,25332,27417,27418,29581,7853,7854,7855,7859,7860,7861,120614,120615,120619,120621,122629,123147,25248,124030,20513,125833,25302,28860,25977,9522,9523,108391,128782,128787,128788,124018",0297063

Or look on the sftp server.

root@172-105-177-117:/home/sparesbox/archive/products# zgrep P0297063 ktypes_sparesbox_28_february.csv.gz

P0297063,"20403,20408,23185,23186,23706,11262,11263,20512,108401,25249,124559,124430,22749,25334,30269,128783,30268,25250,25333,124431,13670,13671,13672,13739,13740,13741,14657,14658,14659,14915,14916,14917,15110,16272,16274,16275,16277,16591,16921,16922,16924,17239,17240,17242,17243,17540,17541,17543,17681,17682,17683,17684,17686,17690,24611,25242,25243,25299,25332,27417,27418,29581,7853,7854,7855,7859,7860,7861,120614,120615,120619,120621,122629,123147,25248,124030,20513,125833,25302,28860,25977,9522,9523,108391,128782,128787,128788,124018",0297063

AMX Specific Information

AMX Price

AMX has had custom development work similar to Sparesbox above so that Omnivore can pull the eBay price from Shopify metafield named "ebay_price"

AMX Product Blocking

AMX has had custom development work similar to Sparesbox above so that Omnivore can block products by marketplace using the same metafield named sales_channel. If the sales channel marketplace name is not showing on the product metafield this will show as a Validation error: blocked by product filter rules

Rare Spares and Resto Country Spares Specific Information

These retailers have much of the same functionality as per Sparesbox, with the exception of Ktypes and .

ebay_price - Uses a metafield to take the price from. If there is no variant level metafield ebay_price, the price will be $0 and thus product will error.

sales_channel blocking - Unless there is a product level metafield called sales_channel, with either ebay, amazon or trade me (case insensitive), the product will not be listed on the respective marketplace. If the sales channel marketplace name is not showing on the product metafield this will show as a Validation error: blocked by product filter rules

HandleByTimeFor eBay, we take the value from eBay Order payload and send this to the retailer in an Order metafield. The value is the expected handling time in which the order should be shipped by