Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Can I make attribute selection REPLACE product price, instead of adding to it?

Can I make attribute selection REPLACE product price, instead of adding to it?

Views: 2,122

Results 1 to 10 of 10
26 Jan 2010, 12:42 AM
#1
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Can I make attribute selection REPLACE product price, instead of adding to it?

Is there a way to make an attribute selection REPLACE the product price, instead of being added in addition to it? And I cannot start with a base price of $0, this workaround is no good for my situation.

I am pricing all of my products by attribute. I have the Dual pricing wholesale module installed, which displays a different price for every wholesale level. This is why I would like the price to be displayed, but not used in calculation when selecting attributes.

example:
Product A
Price each: $5

Quantity dropdown:
5 units ($25)
10 units ($50)

Unfortunately, when the product is added to cart, the extra $5 is added as well. For ease of use, I don't want the quantity dropdown to say +$15. I want it to say exactly the price that it should be.

Any ideas how to do this?

Thanks!!!
:bigups:

26 Jan 2010, 5:30 AM
#2
tino_schlegel avatar

tino_schlegel

Totally Zenned

Join Date:
Nov 2007
Location:
Melbourne, Australia
Posts:
532
Plugin Contributions:
0

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Its not the best solution to use attributes for quantity discounts. Look in the module section for a module that addresses you problem. I know that is something from that software guy. Look at the website for a module that suits your needs.

26 Jan 2010, 8:38 AM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Unfortunately, when the product is added to cart, the extra $5 is added as well. For ease of use, I don't want the quantity dropdown to say +$15. I want it to say exactly the price that it should be.
You need to use the offset and factor to not add to a base
Best that can be done is to supress the +($?.??)

You did state that you are pricing by attributes and if so you should not have a base price entered though

26 Jan 2010, 3:48 PM
#4
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Thank you for your suggestions. My situation is complex, so this is the only way.

  • I've got Dual Pricing installed, so I enter the price for each group (Group A, Group B, etc) into the main product price. So I cannot set that to $0.
  • I know Quantity Discounts is the best way to offer discounts. However, because my client wants different levels of wholesale pricing, I cannot use this feature because it will apply globally to all wholesale customers.
  • I have the attribute setup as a "price factor" so if they select quantity of 4 units, it will multiply that customer's base price by 4. I cannot set the offset, becuase it would have to be a different offset for each customer, which is not a feature of the Dual Pricing add-on.

I was hoping for a switch in the admin that might turn off the "adding" of the product price to an attribute, but since there is not, can you point me to a place in the shopping cart or attributes file where I can remove the product price from being added in the code? Or even subtract the original product price after it's all been calculated?

Thanks again!

26 Jan 2010, 5:46 PM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

I have the attribute setup as a "price factor" so if they select quantity of 4 units, it will multiply that customer's base price by 4. I cannot set the offset, becuase it would have to be a different offset for each customer, which is not a feature of the Dual Pricing add-on.
Offset is a percentage - it will take the base and whatever offset you have specified f
So to remove 1 unit of price set it to 1.00
I've got Dual Pricing installed, so I enter the price for each group (Group A, Group B, etc) into the main product price. So I cannot set that to $0.
Dual - pricing... is this only 2 prices?
group A & B can be set to a percentage in the group setup all groups can have a different perxentage....will calc upon viewing cart

For most anything else you are gonna require some crafty custom coding

26 Jan 2010, 6:11 PM
#6
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Kobra, thanks for the response :)

I did not know the offset was a percentage, i thought it was a solid price, thanks for letting me know that!

Now, here's the thing... and I guess i should've said earlier, but i thought it was inconsequential til now...

I also have the Hidden Wholesale module installed. Most products have a retail price of $0 so they'll be hidden. But some are showcased on the front end with a price of $1 (although price is hidden).

Now, the products with a retail price of $0 are calculating fine into the cart. But it's the ones with a $1 price on the front end, that are getting the extra $ added. Only becuase the attributes are adding into this price, instead of ignoring/replacing it.

Now, i could change the attribute offset i suppose. But then, every time my client wants to show or hide a product, they'll need to not only change the price of the product to $1, but they also need to go into the attributes and change the offset. which is just confusing.

Anyhow, you can see that probably the easiest thing to do is simply change the cart code to ignore the base price when adding the attribute price. This will be a global fix for the whole site, and works for both the $1 and $0 products.

I know some PHP, so custom coding is great for me! just point me in the right direction/ file location :)

Thanks!

26 Jan 2010, 6:21 PM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Not overridable but start with /includes/classes/shopping_cart.php
And follow the logic and calcs

26 Jan 2010, 7:23 PM
#8
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

Thanks,

but about which line should i focus on? And what variable?

26 Jan 2010, 10:54 PM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

I seldom look at this file so you will have to search for where the price is being called and especially attribute additions

27 Jan 2010, 5:28 PM
#10
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Can I make attribute selection REPLACE product price, instead of adding to it?

OK, seems that i have successfully found the line and edited it! :clap:

If anyone else needs this, just search for this line:

'final_price' => ($products_price + $this->attributes_price($products_id)),

and replace with this:

'final_price' => ($this->attributes_price($products_id)),

voila!