Quote:

Posts: 105
Joined: 01/11/2008

Quote:

First of all, you should open a new topic for tis, since it has nothing to do with CSV import. (Maybe an admin could move this topic?)
Second... How much different prices do you want? I'm in a simular situation, and I'm making use of the "list price" and "sell price" field available in UberCart, as I only need 2 standards.

I edited the function uc_cart_get_contents(), so the price returned gets switched based on a condition. As you can see in my test here below, I tried it with the user id of the admin and an anonymous user. The admin gets sell_price, others get list_price. of course, the if statement could also contain a role id or something else. I haven't yet continued on this code to make it descent and reusable. I'm open to any hints on how to do this the proper way Eye-wink I'll be coding on this in a few days.

$item->cost = $product->cost;
/* COWORKS EDIT */
global $user;
if($user->uid == 1){
$item->price = $product->sell_price;
}else{
$item->price = $product->list_price;
}
//$item->price = $product->sell_price; // this was the original line there
$item->weight = $product->weight;
$item->data = unserialize($item->data);

As this is sort of the "root" function for the prices mentioned in the cart and checkout, the switch here is taken all the way in to the order process.
I hope this kind of helps, if you need more then 2 prices, I don't think there's a module available for that right now. A lot also depends on the fact if you want different prices without any key between them or let's say a vast discount of x % or y $. In the latter, you might find results in the discounts module (which I have no experience with.)

Is this used as an over ride or do I modify one of the core cart files "uc_cart.module"

Thanks for the info

$100 - Need module for dual pricing By: end user (24 replies) Thu, 02/07/2008 - 21:43