I've started converting this module to 6.x. I'm posting the patch here as greggles requested.
So far:
- Revamped .install with new Schema API
- Able to make products unique or not
- Ran module against Deadwood, Coder and Schema modules.
- Modules runs with no errors

TODO:
- convert Views 1 to Views 2
- add 6.x-1.x-dev to CVS

Bear in mind this is my first module i have converted from 5 to 6. I have no clue where to start with converting Views 1 to Views 2, as there is some serious lacking of help/documentation. I've also left all the comments from Coder and Deadwood modules for now.

iStryker

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

Thanks for the work, iStryker!

- Able to make products unique or not

Is this a new feature? I'd really like to keep this issue about upgrading the module. We can add new features in other issues (the benefit of doing that is they are easier to backport to 5.x).

When you say "Modules runs with no errors" do you mean that this module works in your testing aside from the views integration? That would be great!

iStryker’s picture

Is this a new feature? I'd really like to keep this issue about upgrading the module. We can add new features in other issues (the benefit of doing that is they are easier to backport to 5.x).

No I wasn't referring to a new feature. I was referring to getting the unique checkbox to work on the node form and updating the database.

When you say "Modules runs with no errors" do you mean that this module works in your testing aside from the views integration? That would be great!

Yes, aside from the views intergration.

Here is the next patch. I've figure out how to integrate the module with views. I cannot figure out the views handlers though. I've used the uc_product module as reference when creating this next patch.

Cheers,

iStryker

greggles’s picture

This is wonderful! Thanks so much for your work and detailed responses here. I can't say exactly when I will be able to test/review the code - in the next few months for sure.

If you think it would be a good idea, I could commit it and create a release and leave a note on the project page that it is experimental. That is the best way to get testers, really.

iStryker’s picture

I've found a problem with the database with the uc_alternative_price table, which is now fix.
The views now work and this module is ready for testing

Attached is 2 patches
one from on 5.x dev
one from on 6.x dev (released June 12th by greggles)

iStryker

greggles’s picture

Status: Needs review » Needs work

Most of this applies fine, except this:

patching file uc_alternative_price.module
Hunk #1 FAILED at 1.
Hunk #2 FAILED at 85.
Hunk #3 FAILED at 99.
Hunk #4 FAILED at 108.
Hunk #5 FAILED at 119.
Hunk #6 FAILED at 144.
Hunk #7 FAILED at 199.
Hunk #8 FAILED at 213.
Hunk #9 FAILED at 275.
Hunk #10 FAILED at 363.
Hunk #11 FAILED at 450.
Hunk #12 FAILED at 473.
Hunk #13 FAILED at 498.
Hunk #14 FAILED at 567.
Hunk #15 FAILED at 653.
Hunk #16 FAILED at 676.
Hunk #17 FAILED at 687.
17 out of 17 hunks FAILED -- saving rejects to file uc_alternative_price.module.rej
patching file uc_alternative_price/views/uc_alternative_price.views.inc
patching file uc_alternative_price/views/uc_alternative_price_handler_field_alternative_price.inc
patching file uc_alternative_price/views/uc_alternative_price_handler_filter_alternative_price.inc

I tried both patches and got the same message.

jamesialford’s picture

I think I am doing something wrong. I downloaded this today. I am trying to get this to work with Drupal 6 and Ubercart 2. I keep getting this error as soon as I install the module.

Missing argument 1 for uc_alternative_price_menu() in /home/content/......./modules/uc_alternative_price/uc_alternative_price.module on line 84.

I see you have some patches. Are they included in the latest module? If not how do I install them?

James

dantahoua’s picture

I have the same error with Drupal 6 and Ubercart 2... This module seems to not working at all... Sorry I am...

himerus’s picture

What is the current status of this?

I just took a quick glance over the code, and see things like $may_cache in the hook_menu which would be throwing some errors.
I have been working on a personal project that requires this module now, and have been trying to get time to do this project for over a year, and this module is just above the status when I first looked around.

I'll be digging into this module this week, and perfecting the process. I'll check issues, and post patches for a smoother upgrade here, and start some new issues as needed for additional bug fixes after it is definitely working with 6.x.

@Greggles, do you have a summary of which of these patches has/has not been applied to the 6.x-dev branch?

greggles’s picture

@himerus - you can see from http://drupal.org/project/cvs/389682 that none of these patches has been applied. I think the patch from #5 needs to be re-rolled and tested. If you can re-roll it I'll happily apply.

himerus’s picture

Okay, the following patch combines the two from #5.

It also addresses an issue with hook_uninstall() that was throwing errors removing the 'unique' field from the uc_products table. There was nothing wrong with the query, however, for some reason, it didn't not like using the name unique, so it has been renamed to unique_price, and references to that field have been changed to reflect that.

The module now enables, disables & will uninstall properly. (seems that way)

This is still definitely what I would call "experimental". The views integration seems to work. (at least pulling out the alternative price for display)
There is an issue with one part I will address later, which relates to it throws an error (rightfully so) when you try to add the "standard" product to your cart after the "buyout" product is in the cart. This is good, but it allows you to add the "unique" or "buyout" price to the cart multiple times without error.

I feel that is a bug. thoughts? or is/was this an intended functionality. My use case is for removing products after unique price is purchased. I guess there could be a use case for this that would allow multiple purchases of the alternative price. Mine is digital, so silly to buy more than once.

If anyone can test this patch out, it was taken directly from the 6.x-dev version available, and now applies cleanly. There is still a lot of code cleanup that will need to happen, I'll have to investigate further some of the functions that have been commented out, and see if they can be fully removed, or need to be fixed, and used.

greggles’s picture

Awesome, Jake - thanks for this work!

My use case is for removing products after unique price is purchased.

Yes, I think that's the standard use case which we should default to doing, but I'm open to ideas.

I think we should leave that bug for a separate issue where it can be discussed on its own. I'd also like to leave code cleanup to separate issues so we can see about backporting it.

dallasclark’s picture

I received the following output when trying to patch the module

patching file uc_alternative_price.install
patching file uc_alternative_price.module
patching file uc_alternative_price.info
Hunk #1 FAILED at 2.
1 out of 1 hunk FAILED -- saving rejects to file uc_alternative_price.info.rej
patching file uc_alternative_price_handler_filter_alternative_price.inc
patching file uc_alternative_price.views.inc
patching file uc_alternative_price_handler_field_alternative_price.inc

gbernier’s picture

What's the status on getting this module to work? Has it been abandon? Tried to apply the patch posted above with no success. If anyone got this thing working let me know as the description describes exactly the functionality I'm need for a current project.

iStryker’s picture

For the most part this module has been abandon. I convert this module to 6 to work with my site. The original maintainer, greggles, have moved on to different module(s) to solve the problem for the new site.

greggles’s picture

I'm happy to give the module to someone else if they file an issue here to take it over (and have shown ability to make patches) I'll help guide the issue through to transferring the module.

gbernier’s picture

iStryker, do you have a working version of this module then? If so would you be willing to share it?

kurth’s picture

bump for sharing

:]

iStryker’s picture

I've copy the module from www.themes247.com. Its been awhile. I don't know if I alter it afterwards. You can download a copy at https://github.com/iStryker/uc_alternative_price