Forums / Developer / Shop Donation / Comment46914

Author Topic

Bruce Morrison

Wednesday 14 February 2007 5:21:20 pm

Comment46914

Hi All

I've looked into how the shop handles prices and I think that with the right datatype and some very minor core changes you could utilise the custom datatype method.

The first step would be to add your datatype to the array in eZShopFunctions::productDatatypeStringList
http://pubsvn.ez.no/nextgen/trunk/kernel/shop/classes/ezshopfunctions.php

To make things more flexible these values could be moved to the shop.ini

You would then have to craft the datatype to use the options mechanism provided by the ezOption datatype (and used throughout the shop code) to collect an arbitrary value.

@/dev/null
To clarify your list, any custom datatype solution would require kernel changes as the kernel currently deals with a static list of datatypes for pricing.

The list so far as I see it is:
a) Custom datatype & kernel mods
b) Collecting donation amount, storing in session and adding via workflow at checkout time (like shipping)
c) Allow users to create donation "content class" and add to basket as regular product (possible quantity issue)

I've dropped any major kernel mods from the list as you'd be pretty much one your own with support.

@Claudia
It looks like you have solved c) quite nicely. Any chance of adding it as a contribution?

The problem I see with using a trigger is again the updateprices() function. As the post data is not there anymore when this is called, we have a problem.Maybe one could get around that by storing the custom prices somewhere permanently and adapting the functions accordingly.

The value could be stored in the session. I haven't done any major work with the shop for a while so I not sure just how the shipping workflow and the workflow to add this functionality would fit in.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish