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.

eZ debug

Timing: Jan 29 2025 23:51:41
Script start
Timing: Jan 29 2025 23:51:41
Module start 'layout'
Timing: Jan 29 2025 23:51:41
Module start 'content'
Timing: Jan 29 2025 23:51:41
Module end 'content'
Timing: Jan 29 2025 23:51:41
Script end

Main resources:

Total runtime0.0135 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1250151.2109
Module start 'layout' 0.00470.0021 739.335936.6484
Module start 'content' 0.00680.0055 775.984494.2344
Module end 'content' 0.01230.0012 870.218833.9922
Script end 0.0135  904.2109 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002014.6956140.0001
Check MTime0.00096.7377140.0001
Mysql Total
Database connection0.00085.769610.0008
Mysqli_queries0.002216.513630.0007
Looping result0.00000.065210.0000
Template Total0.00096.510.0009
Template load0.00074.992010.0007
Template processing0.00021.435310.0002
Override
Cache load0.00053.565410.0005
General
dbfile0.002316.825780.0003
String conversion0.00000.054740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs