Forums / General / Add to basket quantity field ?

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

eZ debug

Timing: Jan 29 2025 13:47:36
Script start
Timing: Jan 29 2025 13:47:36
Module start 'content'
Timing: Jan 29 2025 13:47:36
Module end 'content'
Timing: Jan 29 2025 13:47:37
Script end

Main resources:

Total runtime0.1188 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 587.9219180.8438
Module start 'content' 0.00510.0046 768.765697.9609
Module end 'content' 0.00980.1090 866.7266526.0234
Script end 0.1187  1,392.7500 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00302.5460200.0002
Check MTime0.00120.9859200.0001
Mysql Total
Database connection0.00090.749410.0009
Mysqli_queries0.081168.27751410.0006
Looping result0.00080.68291390.0000
Template Total0.108691.510.1086
Template load0.00100.810810.0010
Template processing0.107690.636310.1076
Override
Cache load0.00070.562510.0007
Sytem overhead
Fetch class attribute can translate value0.00040.352110.0004
XML
Image XML parsing0.00020.167610.0002
General
dbfile0.00584.9072200.0003
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

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

Time used to render debug report: 0.0002 secs