Add to basket quantity field ?

Author Message

H-Works Agency

Monday 12 March 2007 5:38:15 am

Hi all,

How can we add a 'quantity' field in the addtobasket action ?

By default its always '1' that is added and its seems hard coded as the 'item_count' variable.

Its a strange behavior as every shop should feature the possibility to allow consumer to choose their own value in the product full view.

Thanx in advance for help.

Martin

EZP is Great

Bruce Morrison

Monday 12 March 2007 4:02:20 pm

Hi Martin

I've had a quick look over the code (3.8.6) and it would appear that there is no facility to allow for what you want. You'd have to create a custom module or patch the corew to achieve this.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

christian bencivenni

Saturday 17 November 2007 11:59:11 am

No one had found a way?

Lo' F.

Sunday 17 April 2011 9:01:35 am

This post is relatively old, anyway...

I wanted to integrate an input field too, allowing clients to define the quantity directly from the product page and.. here's the way:

the kernel/shop/basket.php has it already pre-defined...

...


if ( $http->hasPostVariable( "Quantity" ) )
    {
        $quantity = (int)$http->postVariable( "Quantity" );
        if ( $quantity <= 0 )
        {
            $quantity = 1;
        }
    }
    else
    {
        $quantity = 1;
    }
...

...just need to add the input field inside the form

...


<input type="text" name="Quantity" size="2" value="1" />
...

Might save some time to some others.. that's it!

loredanaebook.it

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.