Author Topic: change the quantity textboxt to dropdownlist  (Read 7539 times)

Offline felani

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-1
    • View Profile
change the quantity textboxt to dropdownlist
« on: November 30, 2015, 07:47:31 AM »
Hi, Felani from malaysia here..

Can anyone help me how can i change the quantity input textbox in product view to dropdownlist or selectbox?

Thanks.

Offline abantecart

  • Administrator
  • Hero Member
  • *****
  • Posts: 4358
  • Karma: +298/-10
    • View Profile
    • Ideal Open Source Ecommerce Solution
Re: change the quantity textboxt to dropdownlist
« Reply #1 on: November 30, 2015, 08:30:13 PM »
This is possible with some HTML and PHP coding.

You need to edit storefront controller product/product in public function main()
https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/product/product.php

You need to add selectbox type of HTML element instead input for

Code: [Select]
$this->data['form']['minimum'] = $form->getFieldHtml(
array(
'type'  => 'input',
'name'  => 'quantity',
'value' => $qnt,
'style' => 'short',
'attr'  => ' size="3" '));
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 felani

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-1
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #2 on: December 01, 2015, 08:02:32 AM »
Thanks for the tip...can you teach me how to set the option?

yonghan

  • Guest
Re: change the quantity textboxt to dropdownlist
« Reply #3 on: December 01, 2015, 08:27:38 AM »
Hi, if you are referring to product option then there is a manual for it. http://docs.abantecart.com/pages/catalog/products/attributes.html

Offline felani

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-1
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #4 on: December 05, 2015, 11:14:40 AM »
hye,

Need some help.

How can i fix the insert quantity in product page, i mean i only gave an option bulk quantity for eg. 100 @ 200 @ etc...


Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #5 on: December 05, 2015, 12:17:58 PM »
it is a bit unclear exactly what you want to accomplish.   But if it is a way to give customers a different pricing depending in the quantity they buy,  then promotions is the tab on the product you need to use.

Here's the docs about it
http://docs.abantecart.com/pages/promotions/discounts.html

Lee

Offline felani

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-1
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #6 on: December 05, 2015, 10:01:16 PM »
I mean the quantity box i wont allow customer to fill in, but ask them to select the quantity because i'm selling bulk quantity 100pcs, 200pcs..just wont allow to fill for eg; 150pcs, 250 or 350.. etc
« Last Edit: December 05, 2015, 10:04:26 PM by felani »

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #7 on: December 05, 2015, 11:10:20 PM »
look at this item on the demo cart -  it is an example of giving number of items and the pricing point.   It is a result of apply the discount as described in the previous link I gave you for the document ion on how to do this.

http://demo.abantecart.com/index.php?rt=product/product&product_id=81

If these are pre-packaged sizes then this is probably a better way -  using options for the sizes - then they select the package size they want

http://demo.abantecart.com/index.php?rt=product/product&path=49_50&product_id=64

docs info here:

http://docs.abantecart.com/pages/catalog/products/attributes.html

Lee
« Last Edit: December 05, 2015, 11:38:35 PM by llegrand »

Offline felani

  • Newbie
  • *
  • Posts: 15
  • Karma: +0/-1
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #8 on: December 05, 2015, 11:45:16 PM »
Yes i already use this and i dont have any problem on that, but what i mean is the quantity box.

the scenario is, let say customer want to buy 120pcs, but i not selling this quantity. i only sell in bulk quantity 100pcs@200@300...so i just want the customer choose the quantity is set by us. 

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: change the quantity textboxt to dropdownlist
« Reply #9 on: December 06, 2015, 11:01:07 AM »
Take a look at my screenshots for using Options  with package sizes set up in the Global Attributes and then added to the test part product.

If you only allow them to select a pre-package size option  then they can not input 120 pcs when you sell only in multiples of 100.

Lee

PS  if the way the option pricing difference is displayed is not to your liking  look at this extension that presents it differently

http://marketplace.abantecart.com/index.php?rt=product/product/reviews&path=&product_id=319
« Last Edit: December 06, 2015, 11:49:02 AM by llegrand »

 

Powered by SMFPacks Social Login Mod