change display of atributes options

Posts: 6
Joined: 03/20/2008

Hi,

In the atrributes code there is code (uc.atrribute.module at the end) to change the display (i.e. text, radio and select box), but there is no option for just plain text (no fields). I know that the options is there to CHOOSE for an atrribute option. But I want to use it to display 3 diffrent prices, so the customers can see it(and my client who uses multiple prices for multiple options doesn't need to dicribe it in the discription.

So basicaly what I want is that the options of the attributes is displayed as just text (not a field). But I don't know how to do that and maybe it would be a good idea to implament this kind of display in the next update.

Pieter

Posts: 535
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

I don't understand what you're trying to do here. You have a product with several attribute options, each with a different price, but you don't want the customer to be able to choose which one to add to the cart? You just want to display the options and price? Then how can you possibly sell those different products from you site? The only way I can imagine this would be necessary is if you just want a catalog where no purchases are allowed. In that case, overriding a theme function or the product template to just display the pricing would be my first approach. I don't see that changing Ubercart to add non-selectable attribute options would be useful or necessary.

--

<tr>.

Posts: 6
Joined: 03/20/2008

TR,

I know it sounds kinda weird to do it like this, but let me try to explain why something like this could be useful.

First of all I like the atrributes module because you can show multiple prices and it's just easy. There are other ways to do the above in better ways (coding is involved), but I'm tryin to make the pricing-methode for my client as easy as possible. The pricez change always every week, and every product has multiple prices. BUT (here it comes!) the prices are based on the qty the customer buys, so the attributes-options are there for displaying the multiple prices, if doing so the only thing my client has to do is change the options-prices, and it would be formatted in the way I want, without the client seeing any code.

And for the misunderstanding for how to sell those diffrent products: I have no diffrent products, only diffent prices that are based on the qty. And with the Custom Price Calculation Module I can hadle this. The code would be something like this:

if($item->qty > 9) {
  $item->price =[sell_price] - 1.00;
}
if($item->qty > 19) {
  $item->price = [sell_price] - 2.00;
}

I hope this clears it, and you see that it can be useful to show those attributes as non-clickable just for users-perspectif.

Btw thx for tryin to understand, but I still don't know what code to use to override that theme function, if you could help me with that?

*edit* My clients site will sell meat... yeah I know Eye-wink -> http://slagerij-islamcentrum.nl/producten (still testing, working local, will update the live site soon)

Pieter

Posts: 535
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

It sounds like what you really want is support for tiered pricing? I don't think attributes are a very good way to do that. Personally, I would write a small module which allowed you to enter multiple prices on the product edit form (or use CCK instead), then display these price tiers in a table on the product page instead of showing the Sell Price (do this by overriding theme_uc_product_sell_price, see http://www.ubercart.org/faq/617 for more info). Then, the Custom Price Calculation module could be used to set $item->price to the correct stored product price based on quantity. All price changes would be made in one place, on the product edit form, so this would be easy to maintain.

It's even easier if you have a formula you can use for the pricing that applies to all your products. For example, qty 1-9 full price, qty 10-19 5% off, qty 20-29 10% off, etc. - then instead of storing many prices for each product you can just use the formula in Custom Price Calculation and in the theme function.

--

<tr>.

Posts: 6
Joined: 03/20/2008

Maybe, I never heard of tiered prices. But if you think that's the way to do it, then could you (or some-one) please help me to do that. I know how to theme (html, css) in drupal, but I'am lost if you ask me to change the php-code, if you get me.

And maybe we could make this a working module.

Any help, please?

Pieter