Working with a new client on eZ Publish last month we came across an unusual request for multiple fixed priced addons. On the surface it sounds like a simple request until you get down into the nuts and bolts of what that means, what you have to store and how it all fits together in the realm of eZ Publish.
Why oh why would you ever request such a thing? In the case where you are a distributor across multiple countries you run into the unique problem of wanting to fix your price list to ignore foreign exchange fluctuations. This price book approach works well offline and really well in spreadsheets… in eZ Publish it simply doesn’t exist, until now.
When looking at the requirements for the implementation it became immediately apparent there were two datatypes very close to the functionality we were looking to introduce, the multi-price datatype and the multioption2 datatype.
- Multioption2 provides an enhanced product option datatype that allows you to specify product additions, their prices and associated images along with rules for how these options can be chained together.
- Multi-price integrates directly into to multi-currency system to provide automatic or fixed pricing for given products.
This gave an excellent base for extending multioption2 to support multi price values. The resulting datatype uses the same underlying option and rule logic from multioption2 with the multi-price functionality of the multiprice datatype allowing customisable fixed or automatic pricing based on forex rates.
The extension remains rough around the edges and will be tidied up in coming project enhancements and released back to the community should it be of value to others.