Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Qty box only needed on certain products  (Read 2409 times)

Offline BDLG

  • Newbie
  • *
  • Posts: 25
  • Karma: +3/-0
    • View Profile
    • BDL Graphics
Qty box only needed on certain products
« 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.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: Qty box only needed on certain products
« Reply #1 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.

Please  rate your experience or leave your review
We need your help to build better free open source ecommerce platform for everyone. See how you can help

Offline BDLG

  • Newbie
  • *
  • Posts: 25
  • Karma: +3/-0
    • View Profile
    • BDL Graphics
Re: Qty box only needed on certain products
« Reply #2 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!

Offline BDLG

  • Newbie
  • *
  • Posts: 25
  • Karma: +3/-0
    • View Profile
    • BDL Graphics
Re: Qty box only needed on certain products
« Reply #3 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

Offline BDLG

  • Newbie
  • *
  • Posts: 25
  • Karma: +3/-0
    • View Profile
    • BDL Graphics
Re: Qty box only needed on certain products
« Reply #4 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.

 

Powered by SMFPacks Social Login Mod