Forums / Developer / ezsimplestockcheck contribution

ezsimplestockcheck contribution

Author Message

Stuart Fenton

Thursday 08 December 2005 9:55:00 am

I've added a new contribution to the community.

The extension enable simple stock control of items to be sold. When creating an item for sale simply enter an attribute with an identifier called "quantity".

Then when it is purchased it decrements the quantity field by the quantity ordered.

It's not very elegant but is perfect from small solutions.

Were using it for a training company that sells a specific number of places on the course. This decreases the available slots as they are filled.

Regards
Fats

Contibution is here:
http://ez.no/community/contribs/workflow/ezsimplestockcheck

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Lukasz Piech

Thursday 05 July 2007 7:18:37 am

Hi,

When I activate this extension it disables other workflow events, ie shopsender and others

How to prevent it?

Lukasz

Stuart Fenton

Thursday 05 July 2007 1:55:34 pm

Hi there.

The extension modifies the objects added to the basket one after the other but this should not interfere with other workflows.

Have you tried using it at the end of your workflows or using it inside a multiplexer?

Regards
Stuart

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Lukasz Piech

Sunday 08 July 2007 1:53:37 am

Hi

This is not the problem here. The problem is that whenever i activate the simple stock check in Extensions in Admin interface it disables another extension - shopsender in a sense that the weokflow event for shopsender dissapears.

Lukasz

Lukasz Piech

Sunday 08 July 2007 2:01:04 am

OK. SOLVED.

Apparently it indeed interferes with shopsender but there is a solution for this:
Instead of activating it in admin interface you need to add it to /settings/override/site.ini.append.php

ActiveExtensions[]=ezsimplestockcheck

then it works OK

Lukasz

Lukasz Piech

Sunday 08 July 2007 2:23:35 am

Another thing though

Is it possible to create a custom view that lists all products and the quantities?

Has anyone done this already?

Lukasz

Eivind Marienborg

Monday 19 November 2007 12:27:53 am

In my webshop I have different sizes of the same product, using the option data type, for example tshirts in small, medium and large sizes. The relevant would then be to know the remaining quantity of each size.

Is there any plans on extending this contribution to handle this type of scenario, or is there anonther contributuin enabling this?

Stuart Fenton

Wednesday 21 November 2007 2:57:54 am

You could create three separate Quantity attributes, one for each size, then check which one was selected during checkout and reduce the quantity of that attribute.

This would do what you need.

-- Stuart

stuart@grandmore.com
http://www.grandmore.com

Joe Lancros

Wednesday 07 April 2010 3:35:35 am

Hey,

Did you ever get ant further with this contribution. I am developing a site that sells products in 'bundles' (the products are made up of different items) thus I need to check the options before reducing the quantity of that attribute, as pointed out by Stuart but I have no idea how to call the product options up in the stock-check workflow php.

The task gets more complex as some products use the same items, thus the quantities must take into account all the products that have been sold.

Any ideas or example code would be much appreciated

Joseph

eZ debug

Timing: Jan 18 2025 02:50:23
Script start
Timing: Jan 18 2025 02:50:23
Module start 'content'
Timing: Jan 18 2025 02:50:24
Module end 'content'
Timing: Jan 18 2025 02:50:24
Script end

Main resources:

Total runtime1.1316 sec
Peak memory usage4,096.0000 KB
Database Queries216

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0082 589.1406180.8359
Module start 'content' 0.00820.9938 769.9766679.0781
Module end 'content' 1.00210.1295 1,449.0547340.4375
Script end 1.1315  1,789.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3624210.0002
Check MTime0.00160.1376210.0001
Mysql Total
Database connection0.00100.085510.0010
Mysqli_queries1.037691.68952160.0048
Looping result0.00190.16932140.0000
Template Total1.096396.920.5481
Template load0.00210.184220.0010
Template processing1.094296.695820.5471
Template load and register function0.00010.009510.0001
states
state_id_array0.00170.147910.0017
state_identifier_array0.00100.084020.0005
Override
Cache load0.00180.1607550.0000
Sytem overhead
Fetch class attribute can translate value0.00140.121050.0003
Fetch class attribute name0.00140.1215110.0001
XML
Image XML parsing0.00140.127750.0003
class_abstraction
Instantiating content class attribute0.00020.0159130.0000
General
dbfile0.00670.5939330.0002
String conversion0.00000.000530.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
13content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs