skroutz / developer.skroutz.gr

The Skroutz developer platform
https://developer.skroutz.gr
Other
33 stars 17 forks source link

Multi-dimensional size variations #211

Open SolidSnakeGr opened 1 year ago

SolidSnakeGr commented 1 year ago

Hello, I am implementing a plugin solution for a client of mine that uses multi-dimensional size variations. The specific product type I'm referring to is a mattress that is variable on length, width and height so the actual dimension is generated as AxBxCcm and is required for every variation.

My issue is that when all options are collected together in the parent size definition it crosses the 1000 characters limit causing the validator to drop it. I'll try to break this down using an example:

One specific product has way too many variations:

Length: 170 to 210 cm with a 2cm step. Width: 70 to 180 cm with a 2cm step. Height: 12, 20, 28 cm (3 options)

The way price is handled accross these variations is based on width and height options, while length dimension even though it is variable it is set as "any" in the options and play no part in price adjustment.

The price in ranges using width and height only: Width: 70-90cm in relation to height 12cm options have the same price. Width: 70-90cm in relation to height 20cm options have the same price but different than the above case. Width: 92-100cm in relation to height 12cm options have the same price but different than the 70-90cm x 12cm options. etc.

I successfully export all variations with the variations size like this: `

... 170x70x12cm ... ... 170x72x12cm ...

... `

However in the parent product where all of them are concatenated like this: <size>170/70/25, 172/70/25, ...</size> ...the string is becoming huge causing the validator to reject it.

It is important for us to allow the user to select a specific dimension in a 2cm step because this is one of our selling advantages and we need to keep it that way. What is the best course of action to dynamically handle such cases?

mrwhizzy commented 1 year ago

Hello, since you are using variations (and each one of them has a size attribute), the parent product is not required to have a size attribute as well.

Therefore, you should be able to proceed in generating the XML with size variations for a given product, without having a size attribute on the parent product.

However, currently size variations are only supported in Fashion (and similar) categories.

Size variations are not supported for dimensions, as in the case you've described.

We are working on adding support for dimensions as well, but right now it is not supported yet.