Forums / Setting Up Categories, Products, Attributes / Attribute to show actual price

Attribute to show actual price

Locked

Views: 3,217

Results 1 to 12 of 12
This thread is locked. New replies are disabled.
17 Sep 2007, 10:36 PM
#1
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Attribute to show actual price

I asked this a few days back, but it was tagged on the end of an old thread, so, having had no response, I have a feeling it fell out of view, so...

I need the attribute price to show the actual price of that variant. I cannot set the base price to 0 because there are several thousand products and the prices of products will change...and the client wants to have a base price for ease of updating.

Products all have different sizes. Ratio of price:size will remain reasonably constant, so, the requirement is to set up products with base price (easy to update) and size attributes, priced by attribute using Price Factor and OFFSET (no need to update). The plus sign before the Attribute Price is not wanted ...

So NOW how do I get the attribute price to display the actual price of that variant as opposed to the difference?

Is this even possible without going into the code and perhaps adjusting the display? Is there a mathematical solution which I've missed?

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

18 Sep 2007, 4:21 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute to show actual price

Is this true for ALL attributes and product prices?

So if the display showed the attribute price based on price factor/offset plus the product price then this would be correct for ALL products where attributes are used?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

18 Sep 2007, 8:00 AM
#3
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

Yes... that's correct.

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

19 Oct 2007, 10:42 AM
#4
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

Have you any further thoughts on this Linda? I still haven't managed to figure it out.

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

19 Oct 2007, 12:24 PM
#5
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

OK, I can see HOW to make this work, but I'm not sure (=haven't a clue) how to find the starting point to implement the change...

With a Base Price set, the Price factor in place and a Price Offset of 1, then the attribute price displayed = the actual price of that option value less the base price, so I need to add code to change the display of the attribute price to be calculated price using price factor+ the calculated value of the Price Offset.

What are the names of the 2 variables I'm looking for and where do I add the echo statement?

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

19 Oct 2007, 2:17 PM
#6
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

Hmm - doesn't look as if it's as simple as that (now wandering about in functions_prices)

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

19 Oct 2007, 2:59 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute to show actual price

Could you post an exact example of one of your Product's settings from the product to the attributes and what you see now and you want to see? :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

19 Oct 2007, 3:09 PM
#8
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

http://www.midlandwaterlife.com/algizin-g-clears-greencloudy-water-from-p-1263.html ...

the prices on this example which we want displayed for the attributes would be £10, £40, £80 and £160.

As it is set now, adding a variant to cart gives the correct price in the cart.

Product is set at Priced by attributes, base price £10

Attribute have:

Price Factor :1 Offset: 1
Price Factor :3 Offset: 1
Price Factor :7 Offset: 1
Price Factor :15 Offset: 1

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

20 Oct 2007, 5:46 PM
#9
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

Oh Linda, Linda...pleeeease don't leave me dangling again!! :cry:

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

21 Oct 2007, 5:00 AM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Attribute to show actual price

Try this ...

Remove the Attribute Prefixes ...

Change the file for the display to include the products_price around lines 146 - 164 or so:
/includes/modules/attributes.php

to read:

                    if ($products_options->fields['options_values_price'] != '0' and ($products_options->fields['product_attribute_is_free'] != '1' and $product_info->fields['product_is_free'] != '1')) {
                      // show sale maker discount if a percentage
                      $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
                      $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
                    } else {
                      // if product_is_free and product_attribute_is_free
                      if ($products_options->fields['product_attribute_is_free'] == '1' and $product_info->fields['product_is_free'] == '1') {
                        $products_options_display_price= TEXT_ATTRIBUTES_PRICE_WAS . $products_options->fields['price_prefix'] .
                        $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . TEXT_ATTRIBUTE_IS_FREE;
                      } else {
                        // normal price
                        if ($new_attributes_price == 0) {
                          $products_options_display_price= '';
                        } else {
                          $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
                          $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
                        }
                      }
                    }

I have to fool with this more for the first attribute's price that starts with no value ... but it's close :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Oct 2007, 9:30 AM
#11
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: Attribute to show actual price

EXCELLENT!! :clap:

I can see how the "no value" situation would be rather tricky to resolve, and unless you have a burning curiosity to figure it out, then please don't spend on more time on it on my behalf. To me - and hopefully to the client - the end result is now clear enough.

Thank you.

Development Manager @ JSWeb Ltd - suppliers of Applepay/Googlepay for Zencart
20 years with Zencart !

4 Nov 2010, 3:04 PM
#12
524cw avatar

524cw

New Zenner

Join Date:
Sep 2008
Posts:
53
Plugin Contributions:
0

Re: Attribute to show actual price

This works great for displaying the full price in your attribute dropdowns. I have been running into some problems when a product is on special, though.

It seems that the price displayed in the dropdown is different from the price added to the cart when the product is on special.

The price displayed in the dropdown is base price (not discounted) + discounted attribute price. The price added to cart is the correct discounted base price + discounted attribute price.

Would there be any quick way to fix this?

Here is an example: http://www.shinetrim.com/zencart/index.php?main_page=product_info&cPath=71&products_id=370

Ajeh:

Try this ...

Remove the Attribute Prefixes ...

Change the file for the display to include the products_price around lines 146 - 164 or so:
/includes/modules/attributes.php

to read:

                if ($products_options->fields['options_values_price'] != '0' and ($products_options->fields['product_attribute_is_free'] != '1' and $product_info->fields['product_is_free'] != '1')) {
                  // show sale maker discount if a percentage
                  $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
                  $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
                } else {
                  // if product_is_free and product_attribute_is_free
                  if ($products_options->fields['product_attribute_is_free'] == '1' and $product_info->fields['product_is_free'] == '1') {
                    $products_options_display_price= TEXT_ATTRIBUTES_PRICE_WAS . $products_options->fields['price_prefix'] .
                    $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . TEXT_ATTRIBUTE_IS_FREE;
                  } else {
                    // normal price
                    if ($new_attributes_price == 0) {
                      $products_options_display_price= '';
                    } else {
                      $products_options_display_price= ATTRIBUTES_PRICE_DELIMITER_PREFIX . $products_options->fields['price_prefix'] .
                      $currencies->display_price($new_attributes_price + $product_info->fields['products_price'], zen_get_tax_rate($product_info->fields['products_tax_class_id'])) . ATTRIBUTES_PRICE_DELIMITER_SUFFIX;
                    }
                  }
                }
> 
> I have to fool with this more for the first attribute's price that starts with no value ... but it's close :smile: