The ultimate discount module

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

Several shops I (or I will) maintain have serious discount issues. There is the coupon discount module I developped or the discount module, but no one can fit complex needs. Mine only provide discount via coupons, and shows discount only on checkout. The others is abandonned and nobody seems to want to work on it. In addition, I think, as this module was written on the begining of ubercart, it would be better to start from scrach use more the ubercart API.

That's why I'm planning to (try) to write an ultimate discount module, something powerfull enought to fit most of store owner needs, I think I will develop this module for drupal 6.

To do the job well, I need several advices from the ubercart dreamteam.

In a quick brainstorming, I thought to implement the discount system as the tax system. Regarding through the tax system, you have a form in which you set on what you want to apply a tax, and then, you can define conditions via conditional actions.

I thought use the same system for discounts, provide a powerfull form in which you can precisely choose which product (class, individual product, product in a taxonomy term, etc...) you want to apply a certain discount amount, and then, manage the conditions via conditional actions (to restrict a discount on a user, order total amount, etc...)

Do you think it is a good way to go ? For the already implemented conditions, I noticed that they all are related to orders. It will be possible to use these conditions before ? for example on a node page, to directly show the discounted priced to customers in the product page if he fill the conditions ?

Another question : I would like to apply discount per product, no as a line item. Because, in the case you set up different discounts, for different products, adding a single discount line item is confusing for the user that don't know exactly what is discounted. This way would oblige me to alter the sell price of the product, do you think it's a good solution ?

If you have some more experience to share, warning or advices to give, don't hesitate.

Thank you for future reply

zmove

Posts: 23
Joined: 10/07/2007

In a quick brainstorming, I thought to implement the discount system as the tax system. Regarding through the tax system, you have a form in which you set on what you want to apply a tax, and then, you can define conditions via conditional actions.

i think that's a great place to implement this. I remember that some time ago, once i realized there were conditions in place for tax, allowing NY sales tax on clothing to be restricted to purchases over $110, everything became clearer.

Off the top of my head, if there is a $discounted_price or something, could theme_discount_selling_price($price, $discounted_price).
Though initially this may be a lot without delicate caching depending on $user

have serialized cart_links been brainstormed for newsletter integration?!

will each coupon have it's own cid again? or should the coupon_code be the primary key itself?

"while supplies last" may also need to be planned for as limited quantity "bonus pack/price" of a particular product.

Thank you for introducing this thread.

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi,

I'm still hesitating about the port of the already existing discount module or a complete rewriting with conditional actions.

By breaking my head all the week-end on this dilemma, my heart lean on the port of the discount module. But this can change depending on the Ryan or Lyle answer ^^.

In fact, I would like to know till where the integration of this module would go. As it's in heavy development, it's pretty hard to imagine what the possibilities it would provide, that's why I have some questions.

ATM conditional actions seems to deal with the order object only for conditions. It is planned to have some triggers like "user is viewing a product", "user is adding a product to the cart", etc...

Will conditional actions be embeddable ? I mean that the actual UI for discount module is pretty well done, and I would like to not oblige an user, to set up a discount and then, change page to add some conditions into it.

And, the last but not the least, do you have a date estimation about a CA release (with API documentation) to make implementation easier. My deadline is pretty short, I have to make something working before the end of october, I would like to know if it's could be doable with CA with this deadline.

More generally, I would like to opinion of the Ubercart team about a discount module, what would you do if you were me ? Eye-wink

Posts: 2271
Joined: 08/07/2007
AdministratoreLiTe!

If I were you, with your deadline, and knowing what I do about conditional actions ( Eye-wink ), I would probably port the discount module as it is. There's a lot of stuff I'd like to see happen for conditional actions, but I can't guarantee that it'll be done by the end of October.

As far as embedding the conditions forms, I think Ryan told me once that he's going to put that off until UC 3. It's a feature he's wanted to do from the beginning, but the necessary code changes would delay Ubercart being on Drupal 6 for too long.

We've converted all of the Ubercart conditions and actions from Workflow-ng, but we haven't converted any of its own. That wouldn't be hard to do, since the hooks work basically the same way. In fact, ca.module could probably just invoke the rules hooks and convert them for us. I want to talk with fago before doing something like that, though.

Considering how that conversation can change the way things go, there's no way I can speculate on a delivery date of conditional actions. I hope that doesn't come as a surprise. Evil

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Ok thank you Lyle,

I finally made the same conclusion than you and worked on the port of the discount module. I think I will be able to release it soon. Porting 5.x to 6.x is more easy than expected when you understood well the change in the menu and form API.

I saw the latest release of CA provided the action form, congratulation ! Do you think you will be able to post somewhere an API documentation for CA to be able to help you to add some more "common" conditions workflow-ng provided like checking the user role etc... ?

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

Hi there,

Here is a first snapshot of my port to d6 and uc2 of the discount module

It seems to works well but I need more testers to give me feedback

AttachmentSize
uc_discounts.zip45.73 KB
Posts: 1
Joined: 09/29/2008

I'm sure this isn't the only one, but as I played around with the ported version of the discount module, autocomplete gave me some errors.

The path: admin/store/discounts/2/conditions/add (Add Condition -- Taxonomy property)

When I specify a Vocabulary, Drupal attempts to autocomplete, and here's the error:

An HTTP error 404 occurred.
http://.../discounts/taxonomy/autocomplete
From what I understand, a 404 error means the path was not found.

I was told this might also be useful in bug reporting: <form id="uc-discounts-condition-form" method="post" accept-charset="UTF-8" action="/admin/store/discounts/2/conditions/5"> .

Posts: 541
Joined: 08/13/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Internationalizationizer

yeah, I forgot to precise that I make some tests on order total and on user submodules.

I will try the others soon and make sure they all works.

Posts: 1
Joined: 10/01/2008

Need assistance setting up price-based shipping with ubercart and providing coupon code at checkout for customers. Looking to hire someone on consultant basis.