Webshop pricing - creating cumulative price additions when combining seperate products

Author Message

steve walker

Friday 10 September 2004 3:37:54 am

Hi there,

This is the monster of all problems for me <gulp>... almost at the point of thinking its near impossible (due to the way Ez deals with prices etc), but there must be a way... It may be a situation of looking for some paid consultancy, but if someone could possibly come back with some pointers or degree of difficulty I'd be immensely grateful.

What I'm trying to do is create a webshop where a customer can choose an item (in this case a precious stone) and then has the option to either 'add to basket' or 'choose a ring to go with the stone'.

If they decide to choose a ring the id number and cost of the stone needs to be taken over to the 'choose a ring' page.

Here they will see a number of rings who'se price will be determined by:

<price> = <static cost of ring> + <cost of chosen diamond from previous page>

and this is the price value that gets added to the basket if they decide they want it.

In addition, the information that comes through on the order needs to contain data as to the stone they have chosen as well as the accompanying ring.

Can anyone out there give some input into this. I'd like to conclude over the next few days whether this is something I can do myself or if I really need to look for some paid external input.

Its absolutely critical I build this functionality in, and anyones ideas or direction would be a great relief as I'm worried I've taken on something bigger than I can chew!

Thanks, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Friday 10 September 2004 3:44:16 am

Its perfectly possible with eZ. Though the best way to handle is debatable. This is basically a product option situation. You have:

ring + no stone
ring + stone x
ring + stone y
etc.

I think the new multi option datatype would work for you. Its in 3.5 but i think you can just copy the code over to 3.4. Look at:

http://pubsvn.ez.no/websvn/listing.php?repname=nextgen&path=/&sc=1

and navigate to kernel/classes/datatypes/ezmultioption. I can have a go at pulling it out for you if you want.

If this doesnt work for you the other way to go is to use related objects to include the other objects. I've done this in the past.

paul

steve walker

Friday 10 September 2004 5:20:51 am

Paul,

Thanks for the response. Its something of a relief to know this achievable.

I'll investigate the info you've sent through and let you know how I get on. I guess there isnt any information on the new datatype as yet?

Cheers, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Friday 10 September 2004 5:32:47 am

I havent heard of anyone using it yet. I guess try it and see ;) It should be similar to the current ezoption datatype.

paul

steve walker

Friday 10 September 2004 5:33:39 am

Paul,

I'm trying to grab the files from the svn area, from:

http://pubsvn.ez.no/websvn/listing.php?repname=nextgen&path=%2Ftrunk%2Fkernel%2Fclasses%2Fdatatypes%2Fezmultioption%2F&rev=0&sc=1

but am finding that files like ezmultioptiontype.php are a image, see:

http://pubsvn.ez.no/websvn/filedetails.php?repname=nextgen&path=%2Ftrunk%2Fkernel%2Fclasses%2Fdatatypes%2Fezmultioption%2Fezmultioptiontype.php&rev=0&sc=1

Is possible to get the code file versions?

Thanks, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Friday 10 September 2004 5:55:45 am

The best way would be to check out the trunk with svn. If you prefer i could wrap up the files as an extension and send them across.

paul

Bård Farstad

Friday 10 September 2004 5:59:52 am

Here is an example of a shop which uses this feature.
http://www.minelinser.no/content/view/full/5009/

And here:
http://ez.no/products/online_editor

I recommend trying to shop the last product to see how this feature works ;)

--bård

Documentation: http://ez.no/doc

steve walker

Friday 10 September 2004 6:50:22 am

Bard,

In the case of the Ez OE products - arent these just 4 distinct products that happen to include OE as part of the package?

Steve.

http://www.oneworldmarket.co.uk

Bård Farstad

Friday 10 September 2004 7:10:51 am

Steve,

no the OE product is one product in eZ publish ( our ez.no installation ). This product has a price of 0$ and we price the different options, using the option datatype.

--bård

Documentation: http://ez.no/doc

Paul Forsyth

Friday 10 September 2004 7:12:33 am

Steve,

Hope that code works for you :)

I just posted an offtopic but slightly relevant thread here:

http://ez.no/community/forum/suggestions/rfc_repository_for_backporting_useful_features_from_3_5

paul

steve walker

Monday 13 September 2004 5:28:21 am

Paul,

Thanks for the extension - works like a dream. If anyone would like a copy of it before 3.5 is released mail me via steve _at_ oneworldmarket.org and I'll pass it on.

A couple of questions:

- In my product type, there are always the same 6 additional multi options - is it easy to hardcode the options into the class so that all products have them, as opposed to having to add the 6 options everytime you add a new product (they have 600 products at any one time!)

- The multioption uses a dropdown to represent the additional product options - how difficult would it be to add an image to represent the product option?

Many thanks for the help on this.

Steve.

http://www.oneworldmarket.co.uk

steve walker

Monday 04 October 2004 7:10:08 am

Hi there,

Multi option is up and running - but with one snag...

If I choose a multioption and then 'add to the basket' the price in the basket is the price of the product *without* the addition of the option.

Is there a basket or ezprice hack required so that it picks up the price thats the addition of both, as well as product details of the additional option?

Thanks, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Monday 04 October 2004 8:52:14 am

Ah, yes. I didnt look closely enough at how the multioption was carried through. A small change is needed to basket.php.

I've committed the 3.5 version of basket.php to pubsvn. Replace your current kernel/shop/basket.php with this one.

In addition, when you display your multioption datatype make sure it is within the <form> tags. Otherwise the information is not passed through to basket.php. I just made this mistake ;)

paul

steve walker

Tuesday 05 October 2004 5:59:24 am

Paul,

It works in terms of getting the additional options to the checkout page, but the cost still doesnt seem to integrated into the product... so I get:

Quantity 	VAT 	Price 	Discount 	Total Price 	 	
12211129 	
 	17.5 % 	£ 1,814.20 	0% 	£ 1,814.20 	 	
Selected options

Additional Rings	Ring 6	£ 500.00	
Subtotal Inc. VAT: £ 1,814.20

The price of the product is 1814.20... the 500 pound additional price is there but not added in.

When you checked it did you see this price being integrated?

Regards, Steve.

http://www.oneworldmarket.co.uk

Paul Forsyth

Tuesday 05 October 2004 8:10:44 am

I forgot another class ;)

Look at pubsvn again at: backports/3.5 to 3.4/extension/ezmultioption/kernel/classes/ezproductcollectionitem.php

Replace in your current kernel. It has the update for the multioption inside.

paul

steve walker

Tuesday 05 October 2004 9:53:31 am

Excellent, thanks Paul.

Its now working fine!

Steve.

http://www.oneworldmarket.co.uk

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.