These are notes relating to pushing products from PIMS to Shopify online.
The pipeline lives in
factory.service/package.fullhouse/ObjServiceFHShopify.py — see that
module's .md for architectural detail (option levels, metafields,
image pipeline, dedup).
- For help/assistance: Michael, Owen
- Likely Clients: Charnette Hendricks (Full House)
- Server: db.janee.co.za
- DB:
core.axion, trader
- Package: FULLHOUSE (set
package: fullhouse in config.yaml)
- PIMS - This is a section of the Full House GO management system, hosted on fhgo.co.za.
trader - This database on db.janee.co.za is a copy of Full House's database and contains information about the different products.
- `core.axion`.data_shopify_variants - This table stores a list of items that have been previously sent to shopify, and provides a relationship between Full House's Product IDs and the Product ID's that are generated and used by Shopify.
- fhgo.co.za - This is the server that pushes products to shopify.
Products should be automatically pushed from the fhgo.co.za machine to the Shopify account so that Full House can display the products on their website.
Sometimes, however, some products get lost in the weeds and we need to go and manually push them to Shopify.
We need to receive a list of Product IDs from Full House for products that should be reflecting on the website but for whatever reason are not.
- Go to fhgo.co.za
- Sign in
- Click the button marked "Search for products" in the "PIMS" section.
- Search for a product via the Product ID field.
- The product should appear in the first table. Click the "Edit" button to pull up a page with the information on that product.
For products to be successfully pushed to Shopify, they need to pass a couple criteria:
- They must have a valid image uploaded to PIMS. On the product page, if there is a default image on the left side of the screen, then there is not a valid image and pushing the product to Shopify will fail.
- Also on the PIMS page for that product: "Display on website: Yes". If not "yes", then pushing to shopify will fail.
- Products with "DEAL" or "BUNDLE" in their names will also encounter additional checks before they can be pushed to Shopify.
Outlined below is the method that can be taken for each product ID that is not being displayed on Shopify:
- SSH into the fhgo machine and change directories
ssh -i "fullhousecpt.pem" admin@fhgo.co.za
cd /var/www/axion7/objects
sudo su
¶ Step 2. Try and manually push the product to Shopify
- Run the following command, replacing {{PRODUCT_ID}} with the 5 digit
Full House Product ID (e.g. 24866). For a multi-variant product (size
/ colour group), use the GROUP-<id> form — the singleton CLI
expands it into one Shopify product with N variants.
python3 factory.service/package.fullhouse/ObjServiceFHShopify.py singleton --sku {{PRODUCT_ID}}
python3 factory.service/package.fullhouse/ObjServiceFHShopify.py singleton --sku GROUP-23496
- Running this command should hopefully push the product to Shopify, as well as generate 2 entries in `core.axion`.data_shopify_variants. We can verify that there are entries in that table with the query:
SELECT *
FROM `core.axion`.data_shopify_variants
WHERE Sku = "{{PRODUCT_ID}}"
- The query above will return a product_id field. This is the product ID generated and used by Shopify. We can go into the Shopify dashboard and search for this product id. If no product results come up, then the product has not been successfully pushed to shopify. If we see the product in Shopify, we can move onto the next product. As a side note, we can also search for the Full House product ID within Shopify, but this is a little less robust as Shopify does not require that product ID and it can be a less reliable way of looking up products within Shopify.
- The next step is to investigate why this product has not made it to Shopify. Let's go to PIMS and look up this product via the Full House product ID.
- Let's verify that the requirements for being pushed to Shopify are being met (i.e valid image, Display on website: Yes)
- If either of these conditions are not being met, then we can let Full House know that the reason this specific product was not pushed is because it failed the requirements.
- It is possible that the product had previously been pushed to Shopify, generating entries in data_shopify_variants, but has since been removed from Shopify. Our entries in data_shopify_variants may now be stopping the new push to Shopify.
- It is also possible that a product may be part of a promotional campaign that is either not currently active, or the product may belong to multiple promotions and this is causing issues. Etc. In trader, go to the tables hp_promotion_detail. To see promotions:
SELECT
phd.*
FROM `trader`.promotion_detail pdt
LEFT JOIN `trader`.promotion_header phd
ON pdt.PR_ID = phd.PH_ID
WHERE pdt.PR_PRODUCTCODE = "{{PRODUCT_ID}}"
- Delete the entries in data_shopify_variants for the current product only.
DELETE
FROM `core.axion`.data_shopify_variants
WHERE Sku = "{{PRODUCT_ID}}"
- Retry the python command to push the products to Shopify.
- The product should now hopefully be pushed to Shopify. Verify as per the steps above.
For a specific promotion:
SELECT pdt.PR_PRODUCTCODE
FROM `trader`.promotion_detail pdt
LEFT JOIN `trader`.promotion_header phd ON pdt.PR_ID = phd.PH_ID
WHERE phd.PH_ID = "{{PROMOTION_ID}}"
where {{PROMOTION_ID}} is an incremental 3 digit ID (e.g. 308). Returns
the list of product IDs that need pushing.
The whole promo set is pushed via:
python3 factory.service/package.fullhouse/ObjServiceFHShopify.py batch-push promo
Other useful CLI commands:
| Command |
Use |
singleton --sku 24818 |
Push one product by SKU |
singleton --sku GROUP-23496 |
Push a variant group as one product with N variants |
singleton --sku 24818,25951,19633 |
Push several SKUs in one run |
batch-push promo |
Push all products in the active promotion |
batch-push active |
Push all currently active products |
sync-audit |
Compare Shopify vs trader; list mismatches |
sync-audit --fix |
Auto-clear cache + re-push mismatched SKUs |
promotions |
List past, current and upcoming promotions |
promo-email |
Branded promotion status report (HTML email) |
product --sku 24818 |
Read back a product from Shopify |
delete --sku 24818 |
Remove a product from Shopify |
recon |
Reconcile trader promo prices vs Shopify prices |
For each product, the push pipeline lands the following on Shopify:
- Product fields: title, descriptionHtml, vendor, productType, tags
(special, promotion name, brand, category, subcategory).
- Up to 18 product-level metafields under
my_fields namespace
(PUBLIC_READ): credit price/instalment/deposit/months, promotion
name/price/discount, on-promotion flag, guarantee/warranty
periods + extended warranty, stock level, lead time,
can-order flags, TV-licence flag.
- Variants with options (Size + Length for bedding, Colour for
furniture, etc.) and per-variant pricing.
- Variant-level metafields (
m_* keys + variant_level_description)
that reflect each variant's OWN credit, stock, lead time and
promo — bedding sizes (Single / Double / Queen / King) carry
their own credit amortisation values, not the parent's.
- Images from
local.documents/pims/<sku>_pims.jpg (primary) plus
<sku>_<n>_pims.jpg (gallery shots), uploaded once and
deduped on every push so re-pushes don't pile up CDN copies.
- Variants are linked to their per-size / per-colour image
automatically. When a variant has no PIMS file (e.g. King
sizes 23498 / 23519 in GROUP-23496) it falls back to the
master image so no variant goes blank.
After visually verifying a product on the Shopify storefront, mark
it confirmed in core.axion.data_shopify_confirmed:
INSERT INTO `core.axion`.data_shopify_confirmed
(ProductCode, Sku, ConfirmedBy, ConfirmedAt, ShopifyId, Notes,
Active, CreateDate, UpdateDate)
VALUES
('GROUP-23496', 'GROUP-23496', 'vheyn', NOW(),
'gid://shopify/Product/9222408569068',
'Per-variant credit, stock, image links verified live',
'Y', NOW(), NOW());