If this is your first visit, check our documentation. To post, register or login.

Price as attribute

Locked

Started by tdslori on 21 Aug 2007, 8:27 PM · Views: 11,874

Results 1 to 20 of 24
This thread is locked. New replies are disabled.
21 Aug 2007, 8:27 PM
#1
tdslori avatar

tdslori

New Zenner

Join Date:
Sep 2004
Posts:
30
Plugin Contributions:
0

Post #1 by tdslori

I know this has been discussed and I've read thru them all. I have a client who is selling custom gift baskets, where the buyer can choose the value of the basket. I have set up a drop down attribute:

Custom Made Gift Baskets
Starting at: $25.00
Please Choose:
Value
25.00
50.00 (+$25.00)
75.00 (+$50.00)
100.00 (+$75.00)
125.00 (+$100.00)

But they want the value in ( ) to not show as it will confuse their customers. Is this an option?

Thank you.

21 Aug 2007, 8:35 PM
#2
ajeh avatar

ajeh

Oba-san

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

Post #2 by ajeh

Set the Product as:
Product Price: 0.00
Priced by Attribute YES

Set your Attributes to their actual value without the prefix ...

Now it will pick up the lowest option value of the option name groups and build the display price from that ...

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 Aug 2007, 8:49 PM
#3
tdslori avatar

tdslori

New Zenner

Join Date:
Sep 2004
Posts:
30
Plugin Contributions:
0

Post #3 by tdslori

Thanks Ajeh, do you mean like this:

I must be missing something as ther is still a value int he parenthesis:

25.00 (+25.00)

but at least they match now, is that all we can do or can it just show the price with no parenthesis?

TY

21 Aug 2007, 8:52 PM
#4
tdslori avatar

tdslori

New Zenner

Join Date:
Sep 2004
Posts:
30
Plugin Contributions:
0

Post #4 by tdslori

by removing the option value it now show just
(+25.00)
(+50.00)
etc

is this what you meant? :0)

21 Aug 2007, 8:55 PM
#5
ajeh avatar

ajeh

Oba-san

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

Post #5 by ajeh

You can set the Product Price to 0.00

Set the Product as Priced by Attribute YES

Do NOT enter the + on the Price Prefix ... leave it blank ...

Enter the Attribute Price ...

If you don't like the parens you will need to customize the attributes.php module and not show those ...

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 Aug 2007, 10:17 PM
#6
tdslori avatar

tdslori

New Zenner

Join Date:
Sep 2004
Posts:
30
Plugin Contributions:
0

Post #6 by tdslori

Gotcha! Thanks so much.....sometimes you gotta wack me on the head before it sinks in :-)

19 Nov 2009, 7:01 PM
#7
richuno avatar

richuno

New Zenner

Join Date:
Nov 2009
Posts:
4
Plugin Contributions:
0

Post #7 by richuno

I have found a work around solution to achieve the results that were desired here.

You need 3 pieces of information to set a variable that will show the actual price in the dropdown menu.

I am working with these variables:

Base price of item (as set in proctuct price page): $7.20
dropdown items set a 10pc order at the base price of 7.20, while selecting a 20pc order at $13.00

The formula works as follows:

Desired total (ie $13) + Additional price to reach that price (ie. 5.80 [[ 7.2+5.8=13]]) / base price (7.2) = offset price

Using that formula : (13+5.8)/7.2=2.6111

so, our item has a base price of $7.20, in attributes we set the 20pc dropdown price as 5.8 (do not set the +), price factor:0 price offset:2.611

now our dropdown =:

SELECT
10pc
20pc ($13.00)

in your cart a 10pc order will be set to $7.20, whereas a 20pc order will be set to $13.00. It does not add the 13 to the base 7.2

Hope it was not too confusing!

20 Nov 2009, 11:41 PM
#8
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Post #8 by mvstudio

I think I found a problem? :huh:

I have products, set up with price by attributes.

Conducting some tests I found if no attribute is selected at the time of adding the product to cart, the item is added to cart with a price of $0. This shouldn't happen right?

I checked on both my stores and this issue is happening on both. Both stores have the latest version of zencart even with the default template. This might seem not a big deal, but I think it is.

Has anyone reported this before? any solution to this issue? I tried looking for the solution on the forum with no luck.

Thanks!

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

20 Nov 2009, 11:54 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

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

Post #9 by schoolboy

mvstudio:

I think I found a problem? :huh:

I have products, set up with price by attributes.

Conducting some tests I found if no attribute is selected at the time of adding the product to cart, the item is added to cart with a price of $0. This shouldn't happen right?

I checked on both my stores and this issue is happening on both. Both stores have the latest version of zencart even with the default template. This might seem not a big deal, but I think it is.

Has anyone reported this before? any solution to this issue? I tried looking for the solution on the forum with no luck.

Thanks!

You need to create option VALUES for each option name - call them "Please select XXXX" (where XXXX is whatever you want them to select.)

Then, add these option VALUES to the list of existing values for a given product, but make it DISPLAY ONLY and set it as the DEFAULT VALUE.

If customers fail to make a choice of any other value, they will get an ALERT message, and will be prevented from adding the product to the cart until they make an appropriate selection.

See such a set-up in operation HERE

20 years a Zencart User

21 Nov 2009, 6:45 AM
#10
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Post #10 by mvstudio

schoolboy:

You need to create option VALUES for each option name - call them "Please select XXXX" (where XXXX is whatever you want them to select.)

Then, add these option VALUES to the list of existing values for a given product, but make it DISPLAY ONLY and set it as the DEFAULT VALUE.

If customers fail to make a choice of any other value, they will get an ALERT message, and will be prevented from adding the product to the cart until they make an appropriate selection.

See such a set-up in operation HERE

Thanks for your reply. I've tried to open your website like 5 times already, but is painfully slow on both firefox and IE, every time your server crashed, just thought you would want to know.

Anyhow, the solution you are given me if I'm not wrong is not for Product Priced by Attribute, but instead attributes for a base price product?... Since I can't see what you were referring to, I better explain. I'm using Product Priced by Attributes, price is set to 0 so prices are set per attribute. I can't use DISPLAY ONLY or the Starting at message is left blank which is not what I want. Even with your settings though, product can be added to the cart with 0 price. I'm using check boxes, and I've tested with radio buttons and same thing.

So you can see what I'm talking about http://www.byvalenti.com/store/index.php?main_page=product_info&cPath=1&products_id=8

By default the first higher value is selected, but if you deselect all and click on the add to cart button, item is added to cart with a price of 0 anyways. No error message is sent out, which I find it very weird, especially since you mention your store sends out an error message?

I tried to replicate this same issue with the default template and same thing. I checked on random websites I know use the zen cart and same thing item can be added to cart with no price which could present problems with clients trying to purchase free products when in reality they are not free.

Someone else seems to be having the same problem? http://www.zen-cart.com/forum/showthread.php?t=138613&highlight=quantity+cart+message

Thanks for any help.

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

21 Nov 2009, 10:39 AM
#11
schoolboy avatar

schoolboy

Totally Zenned

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

Post #11 by schoolboy

OK I had a look at your example and I think your difficulty lies in the use of CHECKBOXES for selection.

Checkboxes are used when a particular attribute can have SEVERAL choices.

EG:

I sell a t-shirt that can be customized to have any array of the following colours as stripes: Red, Green, Blue, Yellow.

A customer wants his t-shirt to have red AND green AND blue stripes, but NOT yellow. So he ticks the checkboxes for red, green and blue, but leaves the yellow checkbox un-ticked.

Another customer wants his t-shirt to have yellow AND blue stripes, but NOT red or green. So he ticks the checkboxes for yellow and blue, but leaves the red and green checkboxes un-ticked.

Checkboxes are for this AND that AND something else... I can tick no boxes, one box, two boxes ... or all of them.

You need an OR choice, not AND.

For OR choices, you must use radio buttons or dropdowns. The customer can only make ONE choice.


If you want you customers to be able to buy Square AND Round AND mini bars of soap, you may have to set these up as separate products.

20 years a Zencart User

21 Nov 2009, 3:27 PM
#12
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Post #12 by mvstudio

Thank you for the reply, that info is something I didn't find anywhere, how could it be added to the tutorial to help others in the same situation?

The problem seems to happen also with radio buttons under certain conditions as well, although of course one can be set up as default solving the situation.

If no default is set up and no selection is made, item can also be added to the shopping cart and no error message is sent out, this shouldn't happen right? an error message should be sent out right?

What portion of the code validates the form and triggers the error message? where can I find it?

Thanks again for shedding some light! :smile:

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

21 Nov 2009, 5:23 PM
#13
ajeh avatar

ajeh

Oba-san

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

Post #13 by ajeh

The best thing to do on Attributes is to always make a Default Display Only Option Value such as:
Your selection
Pick One
What do you want?
What's your favorite color
select from below ...
etc. etc. etc.

By setting this Option Value as:
Default YES
Display Only YES
Sort Order 0

you will always "force" the customer to pick a choice that is "intentional" and not "accidental" or "omitted" ... :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!

22 Nov 2009, 5:39 AM
#15
gjh42 avatar

gjh42

Black Belt

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

Post #15 by gjh42

If no default is set up and no selection is made, item can also be added to the shopping cart and no error message is sent out, this shouldn't happen right? an error message should be sent out right?

There are many situations where it is acceptable for no selection to be made, or for the default selection to be added unless some other choice is made, so the default behavior needs to stay as is. Otherwise, we would see people complaining about not being able to make a radio/dropdown selection optional...

22 Nov 2009, 5:49 AM
#16
gjh42 avatar

gjh42

Black Belt

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

Post #16 by gjh42

It is also possible to hide the "display only" radiobutton so that only the actual choices are visible. Each button has an id and can be targeted individually.html <input type="radio" name="id[6]" value="113" id="attrib-6-113" /><label class="attribsRadioButton one" for="attrib-6-113">14K Gold Sizes 4 - 7.5 ( $325.00 )</label><br /> <input type="radio" name="id[6]" value="114" id="attrib-6-114" />... If you have the same set of attributes applied to a number of products, each one will have the same id on every product. You can add to your stylesheet something like```
#attrib-6-113 {display: none;}

23 Nov 2009, 9:58 AM
#17
schoolboy avatar

schoolboy

Totally Zenned

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

Post #17 by schoolboy

mvstudio:

Thank you for the reply, that info is something I didn't find anywhere, how could it be added to the tutorial to help others in the same situation?

This is basic HTML form-building protocol - not exclusive to zencart. I make the assumption that people who manage websites have basic knowledge of html and web-forms.

mvstudio:

The problem seems to happen also with radio buttons under certain conditions as well, although of course one can be set up as default solving the situation.

If no default is set up and no selection is made, item can also be added to the shopping cart and no error message is sent out, this shouldn't happen right? an error message should be sent out right?

What portion of the code validates the form and triggers the error message? where can I find it?

Thanks again for shedding some light! :smile:

The action to trigger the alert (and prevent adding the item to the cart) is governed by YOU creating an option VALUE that is configured "DISPLAY ONLY". In the "legend" menu of the attribute controller you will see a series of coloured buttons. When they are INACTIVE, they have a little " X " in them.

When they are made ACTIVE and applicable to an option VALUE, they change colour.

The DISPLAY ONLY icon - when applied to an option value, will change from " X " to YELLOW.

Then... either set this as DEFAULT, or (when you create your values) give it the lowest sort order, and get the option values to display in sort order.

20 years a Zencart User

4 Jun 2010, 9:13 AM
#18
dilani_ruwanmali avatar

dilani_ruwanmali

New Zenner

Join Date:
Feb 2010
Location:
Sri_lanka
Posts:
26
Plugin Contributions:
0

Post #18 by dilani_ruwanmali

mvstudio:

I think I found a problem? :huh:

I have products, set up with price by attributes.

Conducting some tests I found if no attribute is selected at the time of adding the product to cart, the item is added to cart with a price of $0. This shouldn't happen right?

I checked on both my stores and this issue is happening on both. Both stores have the latest version of zencart even with the default template. This might seem not a big deal, but I think it is.

Has anyone reported this before? any solution to this issue? I tried looking for the solution on the forum with no luck.

Thanks!

:smile: when you adding the attributes to the product make the very first attribute's "Default Attribute
to be Marked Selected: to yes"(orange color background in the bottom of the page) then it will defaulty selected. problem solved..:clap:

22 Nov 2010, 10:18 PM
#19
khopek avatar

khopek

Totally Zenned

Join Date:
Aug 2006
Location:
portlandish, oregon
Posts:
795
Plugin Contributions:
0

Post #19 by khopek

Going back to what the OP posted....how exactly does one remove the values in the perenthesis '()'? I am not sure what to look for/how to search for the values that show in perenthesis in the attributes.php file.

23 Nov 2010, 4:06 AM
#20
gjh42 avatar

gjh42

Black Belt

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

Post #20 by gjh42

A way to do this without touching the code would be to redefine the constants that make the parentheses () to include a CSS class, then set that class to display: none;

In /includes/languages/english/your_template/product_info.php

Line #42 : define('ATTRIBUTES_PRICE_DELIMITER_PREFIX', ' ( ');
Line #43 : define('ATTRIBUTES_PRICE_DELIMITER_SUFFIX', ' )');

change to

define('ATTRIBUTES_PRICE_DELIMITER_PREFIX', ' <span class="attribPrice">/COLOR;
define('ATTRIBUTES_PRICE_DELIMITER_SUFFIX', ' )[COLOR="Red"]</span>
');

then add to your stylesheet
.attribPrice {display: none;}