This is not an issue but more of a request when you have some time. Would it be possible to add some type of implementation that would allow you to set a discount to auto apply based on role?
I was thinking a good spot to add it would be right above the "Qualifying type" on the edit discount rule page. Maybe have a select box similar to the products select box but list the current roles. Another thought would be to maybe have a check box that says Allow all roles. When this is checked the module wouldn't try to check the role before applying the discount. I could offer a small bounty as well. $20 - $40 sent via paypal. Thanks alot.

Comments

ferrangil’s picture

Subscribing.

I will need to apply a 5% of discount for the users with an specific role.

It seems the http://drupal.org/project/uc_coupon module is able to do that, but I'm not sure if uc_discount_alt is. Any ideas?

goodsesignusa, did you tried the uc_coupon module?

gooddesignusa’s picture

I tried to use the uc_coupon module but it didn't offer what i needed. It was awhile ago so I can't remember exactly. I already uninstalled it so i can't just turn it back on. But ryangroe the author of this module has contacted me and said he is going to try to work this function in. I haven't had a chance to talk to him yet but i will post back next week.

ryangroe’s picture

Thank you for you patience. I've been moving this week and it didn't go as smoothly as I'd hoped. So I'm behind on my bug fixes. I will get to this on Tuesday.

gooddesignusa’s picture

Thanks a lot ryangroe. I think i found another bug but I'm not sure.
Say for example you set up 2 discounts.
1 discount that runs if you have a minimum quantity of 2 product a's. and another discount that runs if you have a min quantity of 3 product a's.
If you add 3 product a's both discounts will be applied. Not sure if maybe have a greater than or less than. I can re post this as a separate issue if you want.
Thanks again ryan for your hard work. I will throw you some donations to buy you some beers or something :)

ferrangil’s picture

I'm not sure if this is available right now, but could you set 2 conditions for a discount?
For the first discount you will need to check if you have more than 1 a product and less than 3 a product, or an easier way, check if the number of a products is = 2. Otherwise, (for 1 or 3, 4, 5...) other cases will apply.

ryangroe’s picture

Sorry, ferrangil, only one condition is available to trigger a discount. There would be too many changes required to make this work. Also, please open a new issue or send me a personal message rather than commenting on an unrelated issues, as I might have missed this.

ryangroe’s picture

gooddesignusa,

I will wrap up testing of the role-based filtering tonight and have a beta for you. Thanks for your patience.

gooddesignusa’s picture

Thanks a lot ryangroe. If you want to email me with some info so i can send a donation your way :)

ryangroe’s picture

As for a donation, you can use this link:
https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=ryan@groe.org...

Thanks.

ryangroe’s picture

Assigned: Unassigned » ryangroe
Status: Active » Needs review

This feature has been added to beta 9 and needs testing.

ryangroe’s picture

One note: there appears to be a bug in the drupal MySQL column update script that leads to the following error on upgrade:
Failed: ALTER TABLE {uc_discounts} ALTER has_role_filter SET NOT NULL

It is not fatal, the module will still work though it is obviously not ideal. You can go in with myphpadmin and make the column not null to be safe.

swill’s picture

Do you know what the mysql should be? I do not have phpmyadmin on my machines and I have not been able to figure out the correct syntax to do this. Has anyone?

swill’s picture

@ #4 - gooddesignusa
This issue is already being tracked here: http://drupal.org/node/405394

ryangroe’s picture

I think the command should be (remember to add your drupal table prefix if you are using one):
ALTER TABLE uc_discounts MODIFY has_role_filter tinyint NOT NULL

gooddesignusa’s picture

I want to thank you a lot ryangroe. I haven't installed it yet to test. Hopefully this weekend I will be able to. Monday I will be going back into work and will get my boss's cc to make a donation. Thanks again

ryangroe’s picture

Not a problem. This is something I think will be valuable overall to the module. Please give it a thorough test. I tried to test all new section of code but as you know it is still listed as "beta" code, so please try it on a test site before installing it on a live system.

gooddesignusa’s picture

I will prob test it for a day. Its going on a site that will be going live in about a week. Its just going to be a 10% discount on total on all products. So shouldn't be too much testing right ?

ryangroe’s picture

The code has been pretty stable over the past few versions. So you should only need to test the new role filter.

gooddesignusa’s picture

So I've had some time to do some testing. Seems like if i setup a discount to apply to all products with a discount of .05%. Regardless if the role filter is checked or not I get this error after i try to press the Submit Order on the Review order page.
"Discounts have changed. Please review your cart and continue checkout." If you try to click Submit order again it just displays the same error.
I will try to do some more testing tomorrow / monday. Thanks again.

gooddesignusa’s picture

Sent some money your way today. Willing to send some more. Thanks for your hard work already and hope to hear from you soon.

ryangroe’s picture

Thank you for the donation, gooddesignusa. I'm happy my module is being put to good use. If you need more changes let me know. If you can after you are done testing please mark this issue as closed.

gooddesignusa’s picture

Ok doing some more testing and it seems the error: "Discounts have changed. Please review your cart and continue checkout." is happening when i'm using the Credit Card & WPS PRO. If i enable normal paypal mode and use that for a check out it lets me press the submit order button on the review page with no problems.
If I use a credit card through paypal wps pro i get that msg and if i press submit again it just says the error again. Stopping you from completing the transaction. I have the older version of the module before the role addition running on another site. I will enable the CC and set it up and see if this issue is its own thing or related to this new feature. Thanks again. Oh and my boss isn't shy about throwing you more money ;).
--
If anyone is curious this is the site that will be going live soon with ubercart 6.x-2.0-beta6 and hopefully this discount module :). The discount mod isn't a show stopper so i'm not worried. Right now the site is pass protected
http://snoutsdirect.com
username:bmp
pass:snouts

gooddesignusa’s picture

This is using the Credit Card Payment with Paypal's WPS pro. On the beta9 I was Not using the new role feature you added.
Testing on Discounts 6.x-1.0-beta6 doesn't seem to have a problem at the review order page. The order gets completed no problem.

Testing on Discounts 6.x-1.0-beta9 seems to have the problem. On the site with beta9 i tried to disable the tax modules and google Ana just curious if that would change anything. Didn't stop the error from showing / stopping the user from completing the order.

Doing some more testing and it seems that error only shows up if you use a Percent Off discount AND use the CC. Using the normal paypal with percent doesn't show the error.

I hope i helped narrow down where the bug could be hiding. Thanks again.

ryangroe’s picture

The idea behind that warning was if the applied discounts changed in any way from checkout to review to submit the module would make the user verify the new discount totals. It makes sense that percent off is the most sensitive to this problem because a change of a couple cents will probably effect the amount of a discount. I'll take a look and see if I can see anything that would cause this and get back to you with some debug files probably tomorrow night.

gooddesignusa’s picture

Thanks a lot for your help. I appreciate it.

gooddesignusa’s picture

I wonder if thats the problem. If so I wonder why using the Credit Card causes it to happen but not normal paypal.

gtfourdreams’s picture

for discounts per item, filtered by roles:
http://www.ubercart.org/forum/support/5838/different_role_prices_do_you_...

in laymen terms, you can set a user group 'reseller'. and for product 'Widget', non-resellers get retail pricing of $99.95, whereas resellers get the product for $50.00 after they log-in. you can also make a secondary 'favorite reseller' and give them the product for $45.00, and so on.

notes: you will have to set the discount PER product. the module is a hack from http://drupal.org/project/uc_multiprice and greenbeans is looking for a developer. maybe it can even be added to this module?

greenbeans’s picture

(subscribing)

Now that I investigate, I think this module may actually be able to cover the use case the "hack" linked to on the UC site was meant to address, by filtering by role and not requiring a code to activate.

Using this module, is there a way to display the discounted price to the user before adding the product to their cart?

ryangroe’s picture

>>Using this module, is there a way to display the discounted price to the user before adding the product to their cart?

You can use the codeless_discounts_field module to show codeless discounts on the products page. I am also working on another sub-module to show the discounted price on the product page if the discount is codeless or has a minimum quantity of 0 or 1 .

ferrangil’s picture

FYI - It works just fine on my site. Some users with role X get a 5% off :)

damienmckenna’s picture

This is just what I need too, will try it and let you know how it works.

ezra-g’s picture

Status: Needs review » Closed (fixed)

This feature was committed a while ago so I'm closing this issue. For any bugs related to this feature, please open a new issue.