Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Wilson 11 posts 114 karma points
    Feb 19, 2020 @ 14:02
    Andrew Wilson
    0

    Only allow for a single quantity

    Is it possible to restrict variant quantities to 1, but allow multiple purchases of a variant?

    The reason for this is to allow for a customised product.

    In the example of an engraved widget. Widget A in Blue would have an extended data field "message" of "Happy Birthday" but Widget A in Blue would have an extended data field of "Happy new Haircut".

    You couldn't have multiple quantities because the extended data would either be ignored or overwritten and you would get two blue widgets with the same message - not what we want.

    Is this possible?

  • Dave Clinton 31 posts 106 karma points
    Feb 19, 2020 @ 14:22
    Dave Clinton
    0

    Hi Andrew,

    I had a similar issue on a previous project, it requires a bit of customisation (or our method did) but essentially if you add each variant with a unique code then they should be added as separate line items with their separate extended data.

    Hope that helps, if not let me know and I'll try and dig out some code!

    Dave

  • Andrew Wilson 11 posts 114 karma points
    Feb 19, 2020 @ 15:45
    Andrew Wilson
    0

    I've run out of ideas on this, so if you've got any snippets which might put me on the right track it would be very much appreciated.

  • Andrew Wilson 11 posts 114 karma points
    Feb 19, 2020 @ 14:47
    Andrew Wilson
    0

    Hi Dave

    Thanks for the quick reply. I figured it might be something like that.

    I am setting the ExtendedData inthe AddingItem event, so I assume that changing/invalidating one of the Guid's would cause the required behaviour.

    public override ActionResult AddBasketItem(StoreAddItemModel model)
    {
        ((Basket)Basket).AddingItem += OnAddingBasketItem;
    

    Am I on the right track? Any code would be useful.

    Cheers, Andrew.

  • Dave Clinton 31 posts 106 karma points
    Feb 22, 2020 @ 13:28
    Dave Clinton
    0

    Hi Andrew,

    The approach we took was to create a custom basket controller based on the FastTrack version. We also created our own custom AddItem model although I dont think that will be strictly necessary for what you need as we had a few additional bits to do with custom pricing which is why we opted for that approach.

    Have you got a copy of the Merchello source code? If not I'd definitely recommend pulling down a copy as we found there wasn't much in the documentation for this type of customisation.

    I've not been able to load up the project we did this in for a code snippet but I will do when I get a chance if it would help.

    Dave

Please Sign in or register to post replies

Write your reply to:

Draft