Forums / Developer / Shop - on the fly creation of a product

Shop - on the fly creation of a product

Author Message

Quoc Huy Nguyen Dinh

Thursday 19 May 2011 8:40:03 am

Hi

Being not familiar with the shop extension, I was wondering if this is possible.

Let say the shop is selling services not real products. There would be no object of type 'Product' in the CMS. But there is a form where you ask several things and depending on what the user is choosing in the form, the script would generate multiple fields: name of service, options, info about the user, info about the user related to the service, price etc... and push that virtual product in the basket.

Cheers

Marko Žmak

Thursday 19 May 2011 11:41:53 am

Hm, what about having a product class with fileds of type selection, object relation(s)...?

I supose having redundant fields in the product class wouldn't hurt much...

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Quoc Huy Nguyen Dinh

Friday 20 May 2011 6:28:44 am

The idea is to sell courses then ask questions such as:

  • how many people attending
  • name, firstname, age of each attendants
  • and other stuffs

But that would also be good for selling custom stickers for example where the text on the sticker is user input.

So it would be a product with information collection.

That's why It thought of collecting the infos and make then product.

I have'nt had the change yet to dig in the shop's code but maybe putting a product in the basket and then creates the order is just a matter of filling in the fields based on the product fields' value. Or are entries in basket and entries in order tightly bound to the product object itself.

Marko Žmak

Friday 20 May 2011 6:47:45 am

"

The idea is to sell courses then ask questions such as:

  • how many people attending
  • name, firstname, age of each attendants
  • and other stuffs

But that would also be good for selling custom stickers for example where the text on the sticker is user input.

So it would be a product with information collection.

That's why It thought of collecting the infos and make then product.

I have'nt had the change yet to dig in the shop's code but maybe putting a product in the basket and then creates the order is just a matter of filling in the fields based on the product fields' value. Or are entries in basket and entries in order tightly bound to the product object itself.

"

Maybe this could help to get you in the right direction:

  • http://share.ez.no/forums/developer/product-creation-before-adding-to-basket

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Quoc Huy Nguyen Dinh

Tuesday 24 May 2011 12:21:53 pm

Thanks Marko,

I will have a look at it.

scrieler _

Wednesday 06 July 2011 1:38:28 am

Every Object with price attribute is a product.

I would create a product with the needed options and would try to use the comment as information collector. This part u have to extend to your needs.

eZ debug

Timing: Jan 17 2025 21:11:30
Script start
Timing: Jan 17 2025 21:11:30
Module start 'content'
Timing: Jan 17 2025 21:11:31
Module end 'content'
Timing: Jan 17 2025 21:11:31
Script end

Main resources:

Total runtime0.7917 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 596.0703180.8359
Module start 'content' 0.00590.6267 776.9063671.4141
Module end 'content' 0.63260.1590 1,448.3203341.3203
Script end 0.7916  1,789.6406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.5800210.0002
Check MTime0.00170.2165210.0001
Mysql Total
Database connection0.00070.091510.0007
Mysqli_queries0.688586.96522050.0034
Looping result0.00260.32492030.0000
Template Total0.763896.520.3819
Template load0.00210.267820.0011
Template processing0.761696.204520.3808
Template load and register function0.00010.014210.0001
states
state_id_array0.00090.115010.0009
state_identifier_array0.00080.102120.0004
Override
Cache load0.00180.2276450.0000
Sytem overhead
Fetch class attribute can translate value0.00280.348140.0007
Fetch class attribute name0.00130.170380.0002
XML
Image XML parsing0.00180.228040.0005
class_abstraction
Instantiating content class attribute0.00000.0031110.0000
General
dbfile0.00901.1415370.0002
String conversion0.00000.000830.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
3content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/quote.tpldatatype/ezxmltext/quote.tplextension/ezwebin/design/ezwebin/override/templates/datatype/ezxmltext/quote.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 8

Time used to render debug report: 0.0001 secs