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.

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 17 2025 23:50:32
Script start
Timing: Jan 17 2025 23:50:32
Module start 'layout'
Timing: Jan 17 2025 23:50:32
Module start 'content'
Timing: Jan 17 2025 23:50:33
Module end 'content'
Timing: Jan 17 2025 23:50:33
Script end

Main resources:

Total runtime0.7741 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.1563152.6250
Module start 'layout' 0.00540.0032 741.781339.4531
Module start 'content' 0.00860.7639 781.2344626.6875
Module end 'content' 0.77250.0015 1,407.921916.1563
Script end 0.7740  1,424.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4931160.0002
Check MTime0.00130.1704160.0001
Mysql Total
Database connection0.00080.106810.0008
Mysqli_queries0.699290.3276680.0103
Looping result0.00070.0848660.0000
Template Total0.744596.220.3722
Template load0.00240.304620.0012
Template processing0.742195.872720.3711
Template load and register function0.00010.014110.0001
states
state_id_array0.00050.064910.0005
state_identifier_array0.00160.205920.0008
Override
Cache load0.00200.2587450.0000
Sytem overhead
Fetch class attribute can translate value0.00060.082930.0002
Fetch class attribute name0.00160.205280.0002
XML
Image XML parsing0.00140.174930.0005
class_abstraction
Instantiating content class attribute0.00000.0033110.0000
General
dbfile0.00090.1216260.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs