Developer forum

Forum » Ecommerce - Standard features » How to get stock location feature to work on product variants?

How to get stock location feature to work on product variants?

Allan Iversen
Allan Iversen
Reply

Hi,

I am not able to get the stock location feature to work on product variants. 

I have added a stock location, added stock unit (pcs) and entered a stock quantity on a specific product variant.
The stock location and stock unit is versioned in the language used on the website.

In addition to this I have enabled the stock location to the ecommerce shop. 

All good? - or am I missing something?

In the product detail page I would like to be able to display and/or select the mentioned stock location on the specific product variant. But I can not. No stock locations are available through the StockLocations loop and also the StockUnits loop is empty.

In addition I have tried to add the product variant with cartcmd=add and stocklocation=[stocklocationid] but no reaction - only the default inventory is decreased.

Am I missing some configuration, is it not possible or is it some kind of bug?

Using the same approach with a product without variant works - but then the stock location set up is always decreased not the default inventory (no default stock location is defined in shop settings). 


Replies

 
Nicolai Pedersen
Reply

Hi Allan

I can get the data out using this setup - maybe the yellow is what is missing?

  • No stock location set on the website 
  • Works with or without setting the default unit on the product
  • I have added a unit on the product using the units dialog

If this is not it - can you tell us your version and maybe provide some screenshots of product setup (unit and stock section), you stock locations, stock table on the product and units on the product.

Thanks!

 
Allan Iversen
Allan Iversen
Reply

Hi Nicolai,

The customer solution is running on DW 9.8.11. I guess this might be the issue. As I understand the "unit" part has been changed in later versions? This might be reason why all this is not working with variants.

Actually I already had set the "Unit and stocks" part on the product.

We will have to try upgrading to DW 9.10 but as I understand - even IF I get this to work I might run into another issue regarding the original stock on the product when using stock locations: - I see this behaviour already on products without variants.

From:

https://doc.dynamicweb.com/forum/ecommerce-standard-features/stock-value-not-rendered-correctly-when-using-stock-locations?PID=1605

As soon as you add units to a product, the rendering will skip the stock available on the product it self as it cannot be used. It will then take the first stock level from the stock table that matches the unit and location.

If you specify a default stock location on the website settings, that will be used to find the stock level for that location and unit. If no location is specified, it will use the first matching unit regardless of the location. 

This is by design.

 

We will try to figure this out - thanks for your answers.

 

You must be logged in to post in the forum