Developer forum

Forum » Integration » Stock location cache

Stock location cache

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

On a 9.18 solution I am importing stock into EcomStockUnit. That all works OK except that the backend doesn't show the correct numbers after import. It seems to be cache as I can get the correct numbers to show up when I:

1. Run the import job
2. Find the relevant product in the backend and open the Stock matrix
3. Confirm the correct numbers are there for each variant. Open a single variant's stock details screen and hit Save and close
4. Close the Stock screen and then hit Save and Close for the Product screen also.

It looks like I have to click Save and Close for both the stock level and the product to get the correct stock.

I tried clearing all caches under Settings I could think of (all the Stock ones and the Product ones) but stock won't be correct until I go through the steps above.

Is data cached in another location / cache that I can't see or clear from the backend?

Imar

 


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
can you check if you don't have enabled the option ""Disable cache clearing"" in the provider?
I can get it working with inserting the data into the EcomStockUnit table using sql and calling the "StockUnitService" -> refresh from the Settings.
The call for the clearing this service cache is included into the DW/Sql/Ecom providers but only when the rows were imported, so maybe no new rows inserted/updated/deleted?
BR, Dmitrij

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yeah, I have that unchecked. But it's also not clearing when I refresh the EcomStockUnit cache directly from the backend.

I sent you an animation by email that shows the following:

1. Stock on the frontend is zero
2. Stock in the database is 7
3. Stock on the product in the backend is 7
4. Refreshing EcomStockUnit doesn't change the stock
5. Going in to the stock entry, hitting Save and close for the Stock and then for the Product does clear the cache, and the next reload of the frontend then shows the correct value.

Am I missing something? Is there another cache?

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Imar,
still can not reproduce the issue, tried on the local copied website and also on your current site. Here are mine steps:

1) load the page with a product on the frontend and check the qty for the first variant 'VARGRP3868_S10_100' is 7
2) run sql query in backend: 
update EcomStockUnit set StockUnitQuantity = 8 where StockUnitProductId='prod4721' and StockUnitVariantId = 'VARGRP3868_S10_100'
3) clear service cache: Cache->ServiceCashes->StockUnitService -> Refresh

4) refresh the page from 1 and now 8 is shown instead of 7
5) run the query:
update EcomStockUnit set StockUnitQuantity = 7 where StockUnitProductId='prod4721' and StockUnitVariantId = 'VARGRP3868_S10_100'
6) clear StockUnitService
7) refresh the page from 1 and now 7 is shown as it was initially
Maybe it is some browser cache? How do you setup the stock in the database: sql or data integration import job?
BR, Dmitrij

 

You must be logged in to post in the forum