Developer forum

Forum » Integration » Multiple Product Units combined with a simple stock import

Multiple Product Units combined with a simple stock import

Davy Capiau
Reply

Hi ,

I have defined and imported different product units. As you can see in the screenshot below, the defined 'Sales unit' is always the base unit: "always 1 piece".

My source file with the stock quantities only has 1 line per product, because the stock amount is expressed in Sales Units. E.G. sku ABC with quantity 2984.

Where I'm stuck:

On the frontend clients should be able to order per Sales unit, Outer Box or Pallet. This is because they are used to it. But from a the vendor's technical point of view it are all just different amounts of base units.

How can I render the multiple product units-feature on the product page frontend, and at the same time use a simple import as explained above. This means no stock matrix.

Kind regards

 


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Davy,

I don't think that you have a default functionality for handling this scenario. Maybe someone from DW or the community can tell if I am wrong.

I have to admit that I have encountered something similar, once in my +10 years of working with DW, and what we did was customize the add-to-cart functionality and the checkout flow.

Your scenario requires that you change the minimum quantity and multiplier according to your configuration.

The user should change the unit to "Outer box", you should allow them to order one Outer box, and behind the scenes, you have to change in a hidden field the "translated" quantity to 10. Additionally, you have to save the unit option in an Orderlinefield if you want to replicate the same logic in the checkout flow.

I admit it's not an easy one, but it is doable with custom code.

Adrian

 

 
Davy Capiau
Reply

Hi Adrian,

Thanks for your feedback.

If it's not possible by default, why can we define a conversion value per unit as seen in the screenshot below? What is the use for that then?

 

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Davy,

I understand your confusion. I have to admit it was puzzling me as well, and that's why I have made a test on a standard swift before answering.

I was hoping that the definition would help with this particular case. But apparently, it does not.

If it would have been a general "conversion" rule, it should have been in the generic definition of the units and not in the Stock Matrix for each product.

Maybe DW can shed a light on it.

Thank you,
Adrian

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply

Hi Davy,

I believe that Adrian has already outlined it quite fine. You kinda want to use just 10% of the built-in functionality, and ditch the rest: the list of different units is fine (for frontend), but then you would like to disregard the rest. 

As I understand it, in your scenario and with standard Dynamicweb standard, an orderline with 1 "Outer Box" will have a quantity of 1, and will also contain an OrderlineUnitId that implicitly defines the quantity of 10 units. But you would actually like to have the OrtderlineUnitId cleared, and the quantity changed to 10. So, basically you are changing the order.

And this will not work well with Dynamicweb, and as I see it will be quite messy. You will present the order in one way in frontend, but you will have different data when reviewing the order in backend. And you will need to tamper the order receipt as well, and the content of the receipt will not accurately reflect the order as it looks in the administration.

So, as suggested by Adrian, I too will point to a custom implementation, making sure that all quantities on orderlines are always in single units.

I would probably just have my own list of unit-options, and when added to cart convert the selection into single units . Like '1 pallet' to 100 pieces (or what-ever). And keep both the chosen unit (1 pallet) and number of products (100) visible at the cart/receipt. This way it is fairly easily maintained.

I hope the above was helpful, and please write again if you believe I have either missed or misunderstood something from your posting.

BR
Snedker

 
Davy Capiau
Reply

Hi Morten,

Thank you too for clarifying. In understand now the possibilities on the order export side.

Remaining questions:

1) What about the import side? My stock source file expresses quantity in base units. Am i obliged to use the stock matrix and define quantity per type of unit? I would say not, because in the documentation I read the following:

"(...) Then, when the customer adds a box of pencils to cart and buys it, the correct number of pencils will be subtracted from the stock level of the product."

So if  I define the unit types and do a 'simple' stock update (no stock matrix) it should work? 

-  You state the following (see below). What is the other 90% I'm missing? Is there more to it than described here in the documentation?

"You kinda want to use just 10% of the built-in functionality"

Kind regards

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply
This post has been marked as an answer

Hi Davy,

Yes, you need to use the stock matrix as well. I believe the following will implicitly answer your questions. Example with to-do's in sequence:

Stock location (Settings > Ecommerce > Product catalog > Stock locations):

 

Product units (Settings > Ecommerce > Product catalog > Product units) :

From product details i click "Units" from menu, and set the unit of measure:

Back at product details view I select "Stock" from the menu:

So, in the example above I have 100 small boxes with pens, 10 big boxes and 10,000 pieces. In total:

Now, in the frontend I add one small box to the cart and place the order. The stock level now says:

Reviewing the order in backend:

And the orderline in the database:

And table EcomStockUnit after placing an order (with one 'Small box' deducted):

-----

So, if having an order that has orderlines in what-ever type of unit (pc, box, pallet, what-ever), and not base unit only, is something that does not work for you, then the Dynamicweb way of doing it is probably not suitable for your current project. And you need your own implementation.

I hope the above is helpful.

 

BR
Snedker

Votes for this answer: 1

 

You must be logged in to post in the forum