support

change the quantity textboxt to dropdownlist

Started by felani, November 30, 2015, 07:47:31 AM

Previous topic - Next topic

felani

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.

abantecart

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


$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

felani

Thanks for the tip...can you teach me how to set the option?

yonghan


felani

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...


llegrand

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

felani

#6
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

llegrand

#7
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

felani

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. 

llegrand

#9
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

Forum Rules Code of conduct
AbanteCart.com 2010 -