Shop - custom options

Author Message

Norman Leutner

Tuesday 29 July 2008 9:12:04 am

We're currently working an a module which allows to add products to the basket with custom options. In this case the option is a relation of the product itself to make products more maintainable.

We're trying to work without any kernel hacks. To prevent issues when updating the system.
Everything works fine, the data is stored correctly into the database within our module.

Now the problem:

The standard basket.php and confirmorder.php call a function to update the prices.

$basket->updatePrices();

The function itself fetches the object once again, calculates the prices and stores! them
once again instead of fetching the prices from the ezproductcollection_item and ezproductcollection_item_opt tables directly.

I don't really get the point why this is done by fetching the object.
Is there a special reason for this? This currently prevents us to add new functionality to the shop without hacking the kernel.

Thanks in advance

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Pascal Specht

Wednesday 30 July 2008 12:13:21 am

Hi Norman,

well, I understand your frustration about having to touch the kernel, I was confronted to the same dilemma:

my experience is that whenever it comes to seriously modifying the pricing model, (i.e. I added price ramps (Staffelpreise in german), different prices per siteaccess, usergroup and currency, missing prices, coupons and product bundles), the work overhead to circumvent hacking is greater that the maintenance issue. At the end of the day it was way more work to prevent hacking the kernel than maintaining 9 modified kernel files. So I wouldn't bother too much about having to modify these, as long as they are correctly handled in SVN, documented etc.

kernel/shop/ezshopoperationcollection.php
kernel/shop/add.php
kernel/classes/ezbasket.php
kernel/shop/basket.php
kernel/shop/operation_definition.php
kernel/shop/classes/ezsimpleprice.php
kernel/shop/confirmorder.php
kernel/classes/ezorder.php
kernel/classes/ezproductcollectionitem.php

Best regards,
</Pascal>

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 19 2025 01:04:52
Script start
Timing: Jan 19 2025 01:04:52
Module start 'layout'
Timing: Jan 19 2025 01:04:52
Module start 'content'
Timing: Jan 19 2025 01:04:53
Module end 'content'
Timing: Jan 19 2025 01:04:53
Script end

Main resources:

Total runtime0.9670 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0079 589.0547152.6094
Module start 'layout' 0.00790.0034 741.664139.4141
Module start 'content' 0.01130.9542 781.0781538.5391
Module end 'content' 0.96550.0014 1,319.617212.1875
Script end 0.9669  1,331.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3276160.0002
Check MTime0.00130.1370160.0001
Mysql Total
Database connection0.00210.215910.0021
Mysqli_queries0.908293.9232540.0168
Looping result0.00060.0596520.0000
Template Total0.935296.720.4676
Template load0.00170.180220.0009
Template processing0.933496.531420.4667
Template load and register function0.00010.010910.0001
states
state_id_array0.00110.108910.0011
state_identifier_array0.00100.106220.0005
Override
Cache load0.00150.1551310.0000
Sytem overhead
Fetch class attribute can translate value0.00080.085020.0004
Fetch class attribute name0.00120.126040.0003
XML
Image XML parsing0.00460.475420.0023
class_abstraction
Instantiating content class attribute0.00000.000840.0000
General
dbfile0.00510.5287230.0002
String conversion0.00000.000940.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
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs