Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Multiply 3 attributes to give the price?

Multiply 3 attributes to give the price?

Views: 1,069

Results 1 to 10 of 10
20 Dec 2011, 4:57 PM
#1
leezer avatar

leezer

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Multiply 3 attributes to give the price?

Hello there Zenners

I have a problem, my client wants to multiply 3 attributes together to get a price, at the moment all the attributes do is add together all i require is a straight up multiplication of these 3 attributes.

I am semi skilled with zen cart however I have never come across this problem until now, any help or feed back is much appreciated.

here is a link to my site currently in development with the problem in question.

http://www.quickwoodshop.com/index.php?main_page=product_info&cPath=3&products_id=3&number_of_uploads=0

Thanks in Advance

Lee

version: 1.3.9h

20 Dec 2011, 5:04 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

Probably not possible, unless you significantly adapt the whole attributes system.

see: http://www.zen-cart.com/forum/showthread.php?t=140653

20 Dec 2011, 7:27 PM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: Multiply 3 attributes to give the price?

It certainly is possible. You have to write a bunch of custom logic but it can be done.

20 Dec 2011, 8:35 PM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

Trust Scott on this one, then. He's written a couple of mods for me over the years and they've worked a treat.

21 Dec 2011, 8:41 AM
#5
leezer avatar

leezer

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

Thanks you for the feed back lads much appreciated would anyone of you know where I should start to change the code?

It is a shame that something so powerful as Zen Cart does not have a multiply facility on it, I know where i would put it, right in the attributes controller in the box which only allows + and - values that would work a treat.

Thanks again

Lee

21 Dec 2011, 8:48 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Multiply 3 attributes to give the price?

Attributes do have a "price factor" feature which multiplies the base price by whatever you specify; I don't know if three attributes with price factors would each multiply the base price and work together, but if they do, that might address your situation.

Multiplying attributes is only one of innumerable possible ways to want to have attributes interact, and there is no simple way to include a reasonable selection of these dependencies without bloating the code more (attributes are already one of the potentially most processing-intensive parts of Zen Cart).

21 Dec 2011, 8:50 AM
#7
leezer avatar

leezer

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

Thanks mate I will look into it.

21 Dec 2011, 9:10 AM
#8
leezer avatar

leezer

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

I had a look at the price factor and found it unsuitable for my needs, looks like i'll have to look into code :(

21 Dec 2011, 9:33 AM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Multiply 3 attributes to give the price?

Too bad... Good luck with your work. If you get results, it would be valuable to post back and share what you find.

I understand attributes are going to be enhanced in v2.0. They will still not include dependencies, but it would be a really good idea if their code could be configured to easily hook in and insert custom dependencies. With the OOP coding focus of v2.0, that might be a possibility. We can hope!

21 Dec 2011, 10:47 AM
#10
leezer avatar

leezer

New Zenner

Join Date:
Dec 2011
Posts:
8
Plugin Contributions:
0

Re: Multiply 3 attributes to give the price?

indeed it would be a very good idea if we could add our own custom code in there, I did have a look at the attributes_controller.php but after about an hour of playing around I gave up.

I returned to my client and he have now found an alternative solution to possibly solving this problem using categories to narrow down the choices, only time will tell.

thanks for all your help

lee