PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 2/22/2018 8:08 PM by  Will Strohl
hide quantity for product
 6 Replies
 1 Subscribed to this topic
 1 Subscribed to this forum
Sort:
You are not authorized to post a reply.
Page 1 of 212 > >>
Author Messages





New Member






--
1/22/2018 12:47 PM
    Hello,

    I have a client who wants to have the quantity hidden in the product details. The reason is my client only provide one of a kind artwork and never prints or anything similar. My client's customers have asked why there is a quantity available and if that means what they are buying is not one of a kind.

    I can see the following property for the product object: [b]Hotcakes.Commerce.Catalog.Product[/b]
    public bool [h]HideQty [/h]{ get; set; }

    and I can see the following check in the product details view of the default viewset: [b]_ProductDetails.cshtml[/b]
    notice the check of the VM property [h]Model.LocalProduct.HideQty[/h]

    [code=markup] if (!Model.LocalProduct.HideQty)
    {
    <div class="dnnFormItem">
    @Localization.GetString("Quantity")

    </div>
    }[/code]
    I can not see where to set this value. Can someone help me understand this property and tell me if there is a way I can set this myself for products in the store?

    Thanks





    Advanced Member






    --
    1/23/2018 12:21 PM
    If you want hide quantity text on product details you can simply change the above code in this way:
     

    or in this way:

    [CODE]





    New Member






    --
    1/23/2018 12:54 PM
    thanks scippy,

    I am comfortable changing the code in the viewset to "hide" this input. Over the last day's research, I have found that this bool value can only be set when the product is marked as allowing a user-supplied price. I was hoping there was some way to do this from the Store Admin Pages because then it would allow it to be applied to specific products. If I change the viewset then I have to create a different view for each product type based on whether or not I want the quantity displayed.

    Unless someone else has an idea of how to do this from the admin pages I think I have to use the method you outlined.





    Advanced Member






    --
    1/24/2018 7:17 AM
    Hi Jordan,
    to archive this from the Store Admin Pages you can simple create two templates in Products view folder, one with quantity (index) and one without quantity(indexNoQTY), remember you have also to add a new _ProductDetailsNoQTY (where you hide the quantity) and add localization files in LocalResources folder.
    After in Store Admin product page you will be alble to select the Template you want for each product.





    Veteran Member






    --
    2/8/2018 5:39 PM
    Scippy's advice is spot-on. The hidden field value is probably going to be the better solution. You'll also need to update the cart view since it also exposes the quantity field along with an update action.

    If this is a mission-critical site, I'd also suggest creating an action delegate to ensure that the quantity is always one upon adding the product to the cart and going to the checkout from the cart. This will prevent any tampering.

    https://hotcakescommerce....-Integration-Project
    Will Strohl, Upendo Ventures Hotcakes Cloud | Get Support | Code Support Official Cloud & Support provider for Hotcakes
    You are not authorized to post a reply.
    Page 1 of 212 > >>


    Loading
    • Sign-up for the Hotcakes Community Newsletter: