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>
|