Calling Developers!
We are reenergizing our code contribution process! Learn More

Maximum quantity a product(-bundle) can be bought per customer

Options
DavidGreiner
DavidGreiner Spryker Backend-Developer Spryker Solution Partner Posts: 7 🧑🏻‍🚀 - Cadet

Hey there!

is there an out of the box solution to define a maximum amount a product(-bundle) can be bought by a customer?

If not, what would be a good approach here? I could imagine a table that uses SKU and customer number mapping to count how often a particular SKU has already been purchased by a particular customer. But this table could possibly become quite inperformant. This information would also have to be available in the frontend in order to hide articles accordingly or at least prevent them from being added to the cart and purchased.

I would be happy to get some ideas :)

Best Answer

  • profuel
    profuel SSA Sprykee Posts: 37 ✨ - Novice
    Answer ✓
    Options

    hi, nice to see you in our Community!

    I would still go with the separate table to account and limit number of purchases.

    Additionally, I'd include this data into the product data (both Redis and ES) in order to have it available instantly.

    I'm not sure what you mean by performance issues here, since this property is not much more complex then, let's say, measurement units or attributes.

Answers

  • profuel
    profuel SSA Sprykee Posts: 37 ✨ - Novice
    Answer ✓
    Options

    hi, nice to see you in our Community!

    I would still go with the separate table to account and limit number of purchases.

    Additionally, I'd include this data into the product data (both Redis and ES) in order to have it available instantly.

    I'm not sure what you mean by performance issues here, since this property is not much more complex then, let's say, measurement units or attributes.

  • DavidGreiner
    DavidGreiner Spryker Backend-Developer Spryker Solution Partner Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    Hey Andrey! Nice to see you too ;)

    Thank you very much for your answer.

    In the meantime, I implement it in exactly this way.

    Do you know if Spryker has plans to introduce such a feature?

    Best, David

  • profuel
    profuel SSA Sprykee Posts: 37 ✨ - Novice
    Options

    I'm glad that the answer has helped!

    I'm sorry to say, but this feature is not yet planned.