20 replies [Last post]
samhodge's picture
Offline
Joined: 05/08/2009
Juice: 19
Was this information Helpful?

G'Day Folks,

I havent started experimenting yet, but what I need to do is fairly clear.

For each product I want a two prices: Retail and Wholesale.

By default the Retail price will be displayed, but for those resellers who have passed the test of being a genuine wholesale client, they will be displayed the Wholesale price.

I dont mind overloading MSRP and Buy and Sell price to make it simpler.

I have been gathering knowledge and have found the following modules that might help me out:

http://drupal.org/project/uc_discounts_alt current project but I imagine this is dynamics rules based rather static data

http://www.ubercart.org/contrib/4790 for access permission to use stock price for wholesalers, but I believe it hides the field altogether.

http://drupal.org/project/uc_views using this I could manage the data displayed based on user, and perhaps manage the data posted to the "add to cart ()" and "cart display ()" functions

I havent done anything past hello world with php, and I have been using drupal for two weeks.

But I can code happily in Python for a living and do C++ when it has to go really fast, so I am not scared easily by syntax and logic.

What would people recommend as the best route forward to reaching my aim?

If you want to check out the awesome site I cut my teeh on in drupal http://www.hodge.net.au/sam

The retail site is still a work in progress.

Sam

bighead's picture
Offline
Joined: 03/07/2009
Juice: 90
Re: Pricing based on User : Retail for Anon and Retail, but Whol

If you are looking only for two prices solution for EVERY product, then you could try Alternative Prices module. You can modify the basic price by PHP equations - so its simple to use. And the resulting prices are reflected in cart and checkout too.
But if you are looking for some more robust solutions, then I think the use of "stock prices" in combination with Views are now the best one.

samhodge's picture
Offline
Joined: 05/08/2009
Juice: 19
Thanks for the advice

I will see if a rule based thing between "retail = 2.5 * wholesale" for instance

but I would prefer to see "SELECT PRICE FROM RETAIL" and "SELECT PRICE FROM WHOLESALE"

That way you dont need to rely on a relationship, but just rely on the data

bighead's picture
Offline
Joined: 03/07/2009
Juice: 90
Re: Thanks for the advice

I would like to see that function too Eye-wink. If you manage to find some, let me know...

Tezla's picture
Offline
Joined: 05/11/2009
Juice: 9
Re: Thanks for the advice

I’m an Intermediate Drupal 6.x user, but new to UberCart 2.x. I’m also confused about the definitive way to do a Retail/Wholesale site. Since all these stores are on the Internet, this store feature request comes up quite a bit.

Of course, Retail only is easy. Wholesale only (but showing the same items … but as non-purchase-able items with MSRP price) is also not too hard, but this solution doesn’t appear to be modifiable to do Retail/Wholesale.

I could be wrong, but (coming from my experience with osCommerce and ZenCart) the part missing seem to be true Pricing Levels (with Role based control). Hopefully this will be added one day to core. I think UberCart is simply too cool and powerful not to have it.

To get Retail/Wholesale to work, I read in the forums that people are doing various solutions with varying degrees of success. It just seems like a work-around to me. The only problem I have with work-arounds is that they eventually catch up with me (usually in the form of a core function or required module compatibility conflict).

At this point, I really just need step-by-step directions to a fully compatible solution. I would really be interested to hear what either one of you come up with.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Re: Thanks for the advice

So, I devised a reseller pricing module that works with Lyle's Discount Framework. I haven't had a chance to put it up on d.o yet, but I'd love to get your feedback on the version attached to this post. It adds an extra reseller pricing field to products. Then, through conditional actions you have to setup a product discount predicate that applies the reseller price based on some condition like user role or something. When I release it, I'll be sure to have full docs. Eye-wink

AttachmentSize
uc_reseller.zip 8.68 KB
samhodge's picture
Offline
Joined: 05/08/2009
Juice: 19
Thanks!
Ryan wrote:

So, I devised a reseller pricing module that works with Lyle's Discount Framework. I haven't had a chance to put it up on d.o yet, but I'd love to get your feedback on the version attached to this post. It adds an extra reseller pricing field to products. Then, through conditional actions you have to setup a product discount predicate that applies the reseller price based on some condition like user role or something. When I release it, I'll be sure to have full docs. Eye-wink

Thanks for the effort Ryan that was an awesomely quick response time

Will this work with Ubercart Discount Alternative uc_discount_alt ?

Would it make sense to merge these branches?

It seems that uc_discount seems to have gone a little stale with regard to Drupal 6 support, as in it is still a dev version and uc_discount_alt is in beta.

Its all pretty subjective, but I would like to be able to develop the site without running the risk of losing a lot of work due to framework changing under me.

I will give it a go this weekend, or maybe take a day off work on friday to experiment.

I am more than happy to be a beta tester for you, and if there is anything I can do with coding im happy to help, but my skillz are lacking a tad in php and db stuff.

But I have seen several requests for Reseller and Retail, structure, so its worth doing it well.

Sam

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
samhodge wrote:It seems that
samhodge wrote:

It seems that uc_discount seems to have gone a little stale with regard to Drupal 6 support, as in it is still a dev version and uc_discount_alt is in beta.

Forgive me if I have a few other things on my plate. Sticking out tongue

Actually, I haven't done a whole lot of work on uc_discount because I haven't gotten a lot of feedback from users. I'm not sure how well it actually addresses their needs, so I don't know where to improve it.

samhodge's picture
Offline
Joined: 05/08/2009
Juice: 19
Lyle wrote:samhodge wrote:It
Lyle wrote:
samhodge wrote:

It seems that uc_discount seems to have gone a little stale with regard to Drupal 6 support, as in it is still a dev version and uc_discount_alt is in beta.

Forgive me if I have a few other things on my plate. Sticking out tongue

Actually, I haven't done a whole lot of work on uc_discount because I haven't gotten a lot of feedback from users. I'm not sure how well it actually addresses their needs, so I don't know where to improve it.

Sorry Lyle

Ill give it a go and see if anything breaks and give you some feedback, thanks for the response.

I know what its like to be busy

Sam

Tezla's picture
Offline
Joined: 05/11/2009
Juice: 9
Thanks Ryan. Ok, I got those

Thanks Ryan.

Ok, I got those 2 modules. I'll try it out and let you know.

samhodge1972's picture
Offline
Joined: 06/19/2009
Juice: 17
Better late than never
Ryan wrote:

So, I devised a reseller pricing module that works with Lyle's Discount Framework. I haven't had a chance to put it up on d.o yet, but I'd love to get your feedback on the version attached to this post. It adds an extra reseller pricing field to products. Then, through conditional actions you have to setup a product discount predicate that applies the reseller price based on some condition like user role or something. When I release it, I'll be sure to have full docs. Eye-wink

Sorry I have been noodling around with things and have put the reseller pricing on the backburner

I will try this out now

sorry for the tardy response

samhodge's picture
Offline
Joined: 05/08/2009
Juice: 19
conditional actions to apply a discount at the cart?

Hey Guys

With a little bit of overloading of the buy and sell price I have managed to display what the reseller price is in a views2 page that is only accessible to resellers.

And I would be happy with just applying the reseller discount at the checkout, it would kind of drive them there and feel like they are getting a bargain when they are close to the point of sale.

I have installed uc_discount and added a predicate, but it doesnt seem to apply for the roles : Superuser, Staff and Reseller.

Is there a video tutorial or something about the conditional actions, I feel like I am doing something wrong.

I need to do a few other conditional actions : ie shipping is free above a certain amount of flat fee, tax not applicable for overseas customers.

I need to get pretty familar with the whole predicate and conditional actions but my dunce cap is firmly in place at the moment, anyone care to lend a hand?

Sam

CowboyBandit's picture
Offline
Joined: 10/23/2009
Juice: 9
Sam, Were you able to

Sam,
Were you able to address and fix your problem? I am running into the same issue and almost the same scenario. I need to
1. provide discounts to members based on roles
2. Adjust shipping based on roles and/or number of products purchased

I am guessing that I will need to use conditional actions and predicates but am new to both. Any insight you have would be helpful.

hoZt's picture
Offline
Joined: 07/28/2009
Juice: 9
Re: Re: Re: Thanks for the advice

I am coming on this discussion a bit late and have just started testing the uc_reseller module. It does work well, but it does not allow for reseller pricing in options. Would this be hard to add?

Much thanks!

Uncle Mickey's picture
Offline
Joined: 12/02/2010
Juice: 5
Three decimal places and doesn't show reseller price

I installed the most recent version of Lyle's uc_discount_framework and your uc_reseller module. The discount field shows up in the product configuration but it always adds three zeros after the decimal point even if I don't put in a decimal point or change it to two zeros and even though I've entered the reseller price I can't get it to show up on the site's product page even though I'm logged in.

In Home » Administer » Store administration » Configuration ... I can't see a way to add the filed to be displayed in "displayed product fields"

I created a Conditional action - Trigger named "View Reseller Pricing" and the only trigger option even close to select from was "Calculate Line Item Discounts" ... and set the Conditions Group to " AND. If all of these conditions are TRUE." plus selected "authenticated User and Store Manager".

Please tell me what I'm missing or doing wrong, it will be very greatly appreciated. (Especially after spending a couple of days trying to make this work!)

The reseller pricing doesn't show up at checkout, either.

Many thanks for any help you can provide.

Uncle Mickey's picture
Offline
Joined: 12/02/2010
Juice: 5
Three decimal places and doesn't show reseller price

I tried the "price-per-role" module and it solved my problem. Wholesale prices can now be set and seen only by authorized roles.

stockli's picture
Offline
Joined: 12/03/2008
Juice: 55
Common Pricing hook?

I've been doing quite a bit with the uc_discount module in the last few days, and it works great for what I need to do, for the most part. My particular situation is that I have a client that runs a regular end-user store that also allows for B2B transactions if you are logged in as a wholesaler. So I don't want to use discount "codes" (like uc_discounts_alt requires), and I want discounted prices to be displayed across the site as if they are normal prices. So once a reseller logs in, they see the same product catalog, with prices set to 50% of retail.

uc_discount works great for that, but there's quite a bit of trouble with interoperability with other modules that I've run into. The biggest problem is that uc_discount relies on hook_uc_price_handler to alter product prices, which makes perfect sense, but a lot of other modules don't call uc_price when they do calculations. A lot of the time they just call uc_cart_get_contents, and then sum up the cart contents directly from the cart items. That means that any shipping module that quotes shipping based on order total (such as uc_tablequote), or the uc_coupon module, don't get the updated order total based on product discounts applied by uc_discount. I've modified these modules to use uc_price with a context that will fire the CA trigger in uc_discount_price_handler_alter, but this is obviously not a great solution.

So it seems like there should be some low-level hook allowing you to stack up price modifiers that get applied every place that a price is requested, or that prices should be modified before they get added in the cart so that once it's in the cart it doesn't have to get modified every time you want to display it. This seems to be the idea with hook_price_handler_alter, but it's too easy (and too commonplace) for other modules to circumvent it. Plus if I want to do something like display a cart total on every page, I have to make sure that I set up the correct context for uc_discount_price_handler_alter to do its thing before I call uc_price. This means lots of unnecessary node_loads on each page. A better solution would be to just generate a cart total and store it in the session when a product gets added or deleted, so I'll probably end up doing that eventually.

But these are just the results of a couple days of hair pulling Eye-wink. This is my first large-scale site with Ubercart, as all of the others have been pretty straightforward web stores with small product catalogs. This is also my first site with v2, so if my comments above are way off base, please let me know. I'd love to be wrong!

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Common Pricing hook?

In the other module writers' defense, the uc_price() code is pretty new, so hopefully it will just be a matter of time before they start to integrate it. I had the advantage of using uc_discount to test that uc_price() was being used all over Ubercart correctly.

I feel like uc_price() is the kind of "low-level" hook you're looking for. In addition to applying all of the price alterers, it caches its results so that identical contexts shouldn't need to cause the new price to be recalculated. As far as it being too easy to get around, I would think of it like the t() function. You're supposed to use it every time you display text on a page so that it will be translated. It just takes some developer training to know how and when to use it.

stockli's picture
Offline
Joined: 12/03/2008
Juice: 55
Good to know...

Thanks for the quick response... Great, I'm glad to hear that I was on the right track with uc_price. I hope it does catch on soon, because the power available via that modifier stack will be great! Smiling

A follow up question about uc_price, if you don't mind...

It's great that uc_price caches internally, but since I have to generate identical contexts to make that work, I still have to load a lot of nodes every time I call uc_price just to make sure that the context is the same. A good example is summing up a cart total based on uc_cart_get_contents... Since each line item doesn't have an associated node loaded already, but uc_price needs to have a node in context, I have to load all of those nodes every time I sum the cart total. Is there a better way for me to do that?

Thanks!

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Good to know...

I don't think you have to worry about it. node_load() caches its results as well, and uc_cart_get_contents() is already calling it for every item in the cart.

stockli's picture
Offline
Joined: 12/03/2008
Juice: 55
Cool!

Ah, it does cache! I hadn't noticed that before... Awesome, I will proceed as before. Thanks!