AbanteCart Community

Shopping Cart Operations => Support => General Support => Topic started by: BDLG on July 21, 2021, 07:00:47 PM

Title: Qty box only needed on certain products
Post by: BDLG on July 21, 2021, 07:00:47 PM
Need opinion on best way to go about this.
I have different products with different needs for the QTY box (Shows on product page and in cart and is not a block that can just be hidden). For business cards I want them to select the qty from a select box (see attachment. By putting product price at 0 and making this list, the customer has to choose between 50, 100 and 250 cards and gives a specific price for that selection. This works perfectly.  But on these business card pages I do not want the other QTY box to show .

   Now on other pages I want the default QTY box for things like Copies/prints and flyers because they can give me an exact qty that they need, and the price is per page.

How can I delete or hide the QTY box from some, but not all product pages. I don't know much about hooks but I could probably learn, unless there is any other suggestion on how to go about this.
I'd love your thoughts on this and if I need a hook, what should I look at to learn

Thanks in advance.
Title: Re: Qty box only needed on certain products
Post by: abantecart on July 22, 2021, 04:51:16 PM
You can make qtty field as a hidden field with value of 1

Here is the template/line where it is shown
https://github.com/abantecart/abantecart-src/blob/47badf1f852a3cb2c35b5c978b4eb165766b578a/public_html/storefront/view/default/template/pages/product/product.tpl#L174

Here where you can change to hidden:
https://github.com/abantecart/abantecart-src/blob/47badf1f852a3cb2c35b5c978b4eb165766b578a/public_html/storefront/view/default/template/pages/product/product.tpl#L174

If you do not use extension/hook for this change, it can be wiped after next upgrade. Keep this in mind.

Title: Re: Qty box only needed on certain products
Post by: BDLG on July 22, 2021, 06:48:10 PM
Thank you so much for the information. I will try later tonight and post the outcome.
You are all wonderful!
Title: Re: Qty box only needed on certain products
Post by: BDLG on July 22, 2021, 11:49:14 PM
You can make qtty field as a hidden field with value of 1

Here is the template/line where it is shown
https://github.com/abantecart/abantecart-src/blob/47badf1f852a3cb2c35b5c978b4eb165766b578a/public_html/storefront/view/default/template/pages/product/product.tpl#L174

Here where you can change to hidden:
https://github.com/abantecart/abantecart-src/blob/47badf1f852a3cb2c35b5c978b4eb165766b578a/public_html/storefront/view/default/template/pages/product/product.tpl#L174

If you do not use extension/hook for this change, it can be wiped after next upgrade. Keep this in mind.

Did you mean to give me 2 of the same template line? Just wondering if you meant to send me link to another file to change
Title: Re: Qty box only needed on certain products
Post by: BDLG on July 25, 2021, 02:39:25 PM
I am still looking for a solution. I am trying to figure out what Abantecart was saying in previous post but for some reason I am just not understanding what I am to do. If anyone else has any ideas, please let me know.
Thanks to all.