Contrib type:
ModuleStatus:
Uploaded for testingSponsored by:
Amber Eyes SolutionsCompatibility:
Ubercart 1.0 RCuc_event turns an event content type (from the event module) into an Ubercart product. Only one node is created but has attributes of both content types, that is it appears in the event calendar and can be added to the shopping cart. Product attributes were trimmed to include only those necessary for an event. The admin area includes an option for creating content types other than the default 'event' content type as paid events.
| Attachment | Size |
|---|---|
| uc_event.zip | 5.19 KB |



Re: Paid event
Note that this module does not work on all versions of Ubercart. Check the README file. If your uc_cart.module script does not have the relevant code on line 1851 then chances are you will get this error: warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'uc_product_add_to_cart_form.
Update
Modifications made to uc_event as follows:
1. Fully integrated as a product type so modification to uc_cart no longer required and now visible to other ubercart modules.
2. Fixed filter in node_form so Paid events only appears where required.
There are many improvements yet to be made such as separating paid events from unpaid events.
Error message
Hi,
trying to use this function I installed the module. When I try to edit an event I get the following error message:
warning: in_array() [function.in-array]: Wrong datatype for second argument in /www/htdocs/skiclude/drupal-5.7/sites/all/modules/uc_event/uc_event.module on line 52.
Can you help me?
Regards
Markus
Re: Error message
Can this module work with a Date+Calendar setup as opposed to the Event Module?
reuploaded
Hi Markus,
I've tested the code I have in your situation and I am not getting the error. This part of the script I do not thin k is needed but was requested by the sponsor. If you continue to have problems then I'll remove it.
I've re-uploaded the script so download again from the top of the page.
Re: Re: Error message
UC_event only works with the event module
newbie help
Hi, i really don't understand how to apply this patch specifically for this paid event module. I'm a newbie to drupal and my php skills aren't great, could you please give a more detail explaination of the process.
What code to change where?
thanks
Hi Nick, This module is
Hi Nick,
This module is still in development and testing. If you are not able to apply a patch then it is recommended that you not use it at this stage, especially since the patch applies to an Ubercart bug not a uc_event bug. Maybe the more recent versions of Ubercart have it fixed. Give it a try.
What to do for ubercart-5.x-1.3
New Zeal,
I know you said that the uc_event does not work for all versions of ubercart. It turns out that upgrading to ubercart-5.x-1.3 did not fix the:
warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'uc_product_add_to_cart_form_6' was given in /var/www/htdocs/includes/form.inc on line 218
The code that should be patched is now at line 1918. If I apply the patch, the error message remains.
Previous paid event content using ubercart-5.x-1.0-rc2 (which works perfectly) loses the Add to cart' button though all other information remains and the warning is shown.
Now, creation of a new event gives all fields as in the ubercart-5.x-1.0-rc2 before save.
On hitting Add to store, everything is fine so far (no message).
On submit, the message shows up again and no 'Add to cart'.
The above is with patch applied at 1918.
If I remove the patch, same as above. (ie no difference with or without patch at 1918 - that should be weird right?)
By the way, in this case I'm using uc_event_0.zip and not uc_event.zip
Anyway. So I stick with the downgrade ubercart. Anything am missing or risking? If so, can you maybe guide us again on the way foward for the ubercart upgrade? Please?
Further (bear with me), I originally tied to use the openresort module with e-commerce because what I am trying to achieve is make reservations but not for rooms. I need to make reservations for tours. That particular module, though it kinda worked was a whole can of worms and is not as flexible as uc_event.
Thing is guy, I can now make bookings (kinda) for a tour/safari using your module. But, now away from ubercart since you have that fixed, what can be done in regards to event in order to allow me to work the following scenario:
I have say 5 events with variable length (number of days) (5, 7, 10 etc)
Allow payment for more people in a group to a particular event.
Allow combination of events.
Here's the catch (reason why I tried to go with the openresort module for booking):
Event start dates are not fixed and depend on the user. The number of days is whats fixed.
Meaning (I guess) that:
-I create a generic event that is always open (with the condition that start date must be 30 days away from current date.
-The user then edits the date part of the event (in uc_event?) in that he clicks on my event but instead of being taken to it, all the data from my event is loaded. He can only see the date fields which he is actually editing while to the user it looks like a date booking (get?).
This new event then gets pushed to ubercart. Once ubercart finishes with it, it is deleted from the site (or maybe stored for the user only?) The original remains intact (since its just a loader link for my fixed info that will allow the user to change the date).
In essence, the user creates an event that he pays for with my pre-loaded info on cost and his date (but my number of days).....hmmmm
Am I making any sense?
Is it possible?
I know zilch about php coding but I swear I can see the logic flow.
TThanks New Zeal, thanks ambereyes, for the module.
Re: What to do for ubercart-5.x-1.3
Since originally posting this module I have made a lot of improvements and it is working without any problems on a production site. Since I am no longer able to edit the original post I attach the latest version here. There are some edits required to cart.module and other ubercart modules which are outlined in the readme. Give this a go and leave your comments.
The main problem is not uc_event per se, but other modules which are not configured completely to take non UI product types.
Am I missing something?
for ubercart-5.x-1.3:
The error message stated earlier does not go away (everything else seems fine) without applying the patches.
Yet, the line from the README in uc_event.1.zip (newest I think).:
if (in_array($product->type, array_keys(uc_product_node_info())))
does not exist in uc_cart.module of ubercart-5.x-1.3 (latest)
The closest I can see that is related to what should be patched is:
if (!in_array($node->type, module_invoke_all('product_types'))) {
drupal_set_message(t('!title is not a product. Unable to add to cart.', array('!title' => $node->title)), 'error');
return;
}
patching this as suggested on your earlier README, from your posts at http://www.ubercart.org/comment/20346/uc_event and not the README on uc_event.1.zip (shows only above 1 line patch) which works for earlier versions of ubercart makes no difference here. As in (why by the way??, i.e. apart from positioning of the patch code?):
Replace:
if (!in_array($node->type, module_invoke_all('product_types'))) {
drupal_set_message(t('!title is not a product. Unable to add to cart.', array('!title' => $node->title)), 'error');
return;
}
With
if (!in_array($node->type, module_invoke_all('product_types')) && !isset($node->sell_price)) {
drupal_set_message(t('!title is not a product. Unable to add to cart.', array('!title' => $node->title)), 'error');
return;
}
Basically. uc_event should, with this ubercart, work with no patches right?
But it does not. And the patches are not applicable as per the README on your latest uc_event. Is there a reason that you did not include the above patch in the README and only included the one line patch?
Man, its just one line right? That does not exist?
Am lost. Totally.
What am I missing?? Maybe a line by line guide for the clueless like me?
Andrew
Fixed!!!
Damn. How stupid i feel!!!
All along, cause I've been messing around with uc_cart.module, I did not notice from http://www.ubercart.org/issue/5332/add_cart_form_with_new_productnodetyp... by Riki_tiki_tavi that the issue was:
So my solution was making custom hook_forms() for my module with this code not changing main uc sources (only one line of uc_product_forms() code was changed).
The change is in uc_product.module and not uc_cart.module
That patch and everything is fine and dandy!
Like he says, one line and New Zeal's module is riding smooth!!
God! Two days!! And all cause of being blind!!!!
With all due respect New Zeal, please add in the README that the patch is in uc_product.module for idiots like me!
Duplicate 'Add to Cart'
Drupal 5.9
uc_event 5.x-1.0-rc2
I double checked the two patches I made as instructed in the README.txt file for accuracy. They're OK.
I am getting duplication of the "Quantity" text box and the "Add to cart" button on my paid_event. Firebug tells me that
<div class="add_to_cart">is duplicated: Once before and once after<div class="sell_price">.Where do I go from here?
Try this...
This may fix your problem:
From what you say: "I double checked the TWO patches", you may be using an older uc_event.
Download the uc_event that New Zeal posted above:
http://www.ubercart.org/files/uc_event_1.zip
This works with the latest Ubercart seemingly with no other issues.
It only needs the ONE patch line in uc_product.module as shown at the bottom of the README and should then work fine.
Hope that helps
Thank you for responding. I
Thank you for responding.
I am using the files from the 'uc_event_1.zip' file. The TWO patches I applied were from the README.txt file. The first was at lines 25-40 as follows:
function uc_reports_products() {$statistics = db_result(db_query("SELECT status FROM {system} WHERE name = 'statistics'"));
$count_views = variable_get('statistics_count_content_views', FALSE);
$page = (!is_null($_GET['page'])) ? intval($_GET['page']) : 0;
$page_size = (!is_null($_GET['nopage'])) ? UC_REPORTS_MAX_RECORDS : variable_get('uc_reports_table_size', 30);
$order_statuses = _uc_reports_order_statuses();
- $product_types = array("'product'");
- $types = db_query("SELECT DISTINCT(pcid) FROM {uc_product_classes}");
- while ($type = db_fetch_object($types)) {
- $product_types[] = "'". $type->pcid ."'";
- }
+ $p_types = module_invoke_all('product_types');
+ foreach ($p_types as $id) {
+ $product_types[] = "'". $id ."'";
+ }
$csv_rows = array();
Since that one was in the uc_reports.module I figured it had no effect on the duplication of the two div instances. The second patch was in lines 52-54 of the README.txt:
- if (in_array($product->type, array_keys(uc_product_node_info()))) {---
+ if (in_array($product->type, module_invoke_all('product_types'))) {
I reversed each patch individually and found no change to the duplication of the divs. Seems like I remember someone commenting about duplications, but I've searched to no avail.
I'm still looking for suggestions...
Paid Events & CCK
hey,
first of all, nice work, thank you!
But, how can i enable custom cck events as paid events?
my settings:
Content type -> Show in Event Calendar: All Views
Paid Event -> Content type is ticked
But there is no effect to my custom cck event.
Drupal: 5.8
Ubercart: 5.x-1.3
Event: 5.x-1.0
Ubercartevent: 5.x-1.0-rc2
thanks for help!
Catalog Support?
I can't find where to select the Catalog category for an event. I have successfully made events with this module, set the price, etc. but I don't see category support anywhere - is that not supported?
Also, how can I make an Paid Event purchaseable with UC? The event's link in the calendar doesn't have any 'cart' attributes, e.g.: /cart/add/...
thanks, and thanks for the module!
-c
RE: Thank you for responding. I
And you are using ubercart-5.x-1.3 I assume.
I didn't even bother with uc_reports patch and everything still works fine ith above ubercart.
Double Cart links. Go to item #44 (New Zeal):
http://www.ubercart.org/forum/bounties/1655/event_registration_integrati...
Hope you'll find your solution here but it says the solution is upgrading.
Please update.
RE: Catalog Support?
Do as #15 above.
You have applied all the patches in the README as regards uc_reports_products?
Have you enabled the Menu Item Catalog? (Disabled by default)
Also, I created new terms under the event content type to group my events. I use those as menu links (My Catalog).
You are probably fine if creating events and pricing already.
But, from the Calendar, you will only see a list of the events for the particular date with no cart Link.
Click on the event (Must be a paid event) to be led from the calendar page to the node with a cart link.
Hope that helps.
RE: Paid Events & CCK
If I am not wrong, the module uc_event was made for the event module and not cutom cck events which are different.
That would mean you have to add your new cck fields into the original event content type (Correct me if I am wrong).
Re: RE: Thank you for responding. I
Yup. Been there; done that.
ubercart 5.x-1.3
uc_event 5.x-1.0-rc2
#19 kenyan@drupal.org
Can't seem to shake the duplicate divs. Thought I could hide one via .css; however, they're both defined the same. Inserting
div.add_to_cart { display: none; }into my .css file hid both divs.Still puzzled...
Hi Andrew,
Hi Andrew,
My apologies,
In the README I failed to include the fact that the last patch is for uc_products and not uc_cart. I see Kenya has already figured this out.
I raised this as an issue with the developers here: http://www.ubercart.org/issue/5521/product_classes_using_product_types_h....
So we'll see what happens.Now I am faced with the problem that I cannot edit any of these posts, let alone the original one, so this thread will potentially become messy. All future updates I will post on my own site at: http://webdev.passingphase.co.nz/content/ucevent to avoid the mess.
Anyway here is the uc_event package with the complete README instructions and some further improvements to the node form, ensuring that the paid event fieldset only appears when it is requested.
Non-Product Event becomes a Product Event!
Drupal 5.10
uc_event 5.x-1.0-rc2 (uc_event_2.zip)
I opened a previously created event in my test system and, after making some edits to the 'Body' text, I submitted the change. Later when I re-opened the same event to make another edit, I noticed that it had become a product event. I could not submit it without adding an SKU.
After some additional testing I found that if a non-product event is opened for editing and then submitted (even without any changes) the non-product event becomes a product event. When I dug into the database, I found that a record for the edited node had been added to the uc_products table. Deleting that record reverted the product event back to a non-product event.
What's happening here? Why does the record get added to uc_products? Could it be a 'bug' in UC_Event or is there a setting that I might have changed to cause this? Obviously, this is a real problem to me!
Thanks for the great module. I will be using it extensively on my site - so getting this issue cleared up is important.
-Paul
Unable to see any product information
Hi there,
I am using Drupal version 5.10, Ubercart version 5.x-1.3 with Event version 5.x-2.x.
As per the ReadMe file, I have successfully applied to patches and do not see any errors.
However, I cannot see any product information on the actual node view for an Event. In the edit view, everything is OK, and the price information is there, but on the node view, I only see the date and body - no price or add to cart.
One possible additional thing to mention is that since updating one of the modules (probably Event), Drupal asked me to specify the date and time formats - I didn't do this before. Being UK based, the date is dd mm yy as opposed to the default mm dd yy.
Everything was working very well before I updated and I did see the add to cart as expected.
Hopefully you have already seen this problem before, but if not let me know if you need any more info....
Thanks,
David
P.S. Thanks for the module!
New version
I've detected this problem and cleaned it up.
Event Content types only are selectable.
There was a bug with all events becoming products (I developed it on a one event-product site). That has been resolved. To turn an event into a product still requires to tick the box, submit and then re-edit.
The problem is that there is no clear manner in which to define a node as a product (for content types created outside the Ubercart UI and not stored in product_classes table). The best solution I found in the end was to detect the presence of $node->price. If that doesn't exist then the product form doesn't appear (with the SKU etc).
New version
"However, I cannot see any product information on the actual node view for an Event. In the edit view, everything is OK, and the price information is there, but on the node view, I only see the date and body - no price or add to cart."
This is not something I have had to deal with and may be particular to your site. More details would be required. Like you say it may be connected to the update process.
NewZeal, Thank you for your
NewZeal,
Thank you for your update in uc_event_3.zip. It took care of #23 (Non-Product Event becomes a Product Event). However issue #13, #15, #21 (Duplicate 'Add to cart') persists. The only way I could overcome this latter issue was to comment out lines 160-163 of uc_event.module. I don't like messin' with your code, so it would be great to have a more elegant fix.
// $node->content['add_to_cart_link'] = array(// '#value' => theme('uc_product_add_to_cart', $node),
// '#weight' => 2,
// );
Thanks again for your very useful module.
Taxonomy and Links
uc_event ver 5.x-1.0-rc2 (uc_event_3.zip)
Drupal 5.10
I've created a couple of paid events on my test site and notice that neither taxonomy (
<span class="taxonomy">) nor links (<div class="links">) appear. Are they included in the template?Re: Taxonomy and Links
Uc_event has no intentional effect on any theme templates. If it displays differently from other products then that is because the event content type is not a product. uc_event helps event to function as a product for payment and some display purposes. I cannot say if it takes on all display characteristics of other products.
Thanks, NewZeal. I
Thanks, NewZeal.
I discovered the taxonomy and links display just fine in "bluemarine" theme (and probably others). However, my primary theme is "newsflash" (http://www.roopletheme.com), so I'll search around in there.
Integration with Signup
I've been using this module happily for a couple months now, thanks to New Zeal. Just wanted people to know you can add signup functionality through a workflow-ng configuration listed here: http://drupal.org/node/277721
What it actually does is automatically sign people up for all nodes that have the signup option enabled, and also suppresses the signup form, so users don't see or do anything extra, yet you still have a nice singup registration list for all your events =)
PS. In order to suppress the signup form from the user's end, the above link has you create a module called my_tweaks. Using Drupal 6.4, I had to make a modification to it to get it to work (and also to get it to supress the signup form on both event nodes AND product nodes, since I wanted to track signups for both). Here is what I have:
<?php
function my_tweaks_signup_suppress($node) {
if($node->type == 'product') {
return TRUE;
}
if($node->type == 'event') {
return TRUE;
}
}
Any plans for D6/U2?
We would be willing to possibly sponsor.
Re: Paid event
Have you submitted a patch to the uc_reports module? It seems silly to keep distributing code that requires a patch.
Here are some patch files for the modules in question:
Ryan Price
@liberatr
Re: Paid event
Hi. Please does anyone know:
1. what version of ubercart works with uc_event_3.zip (5.x-1.0-rc2)
2. Is uc_event_3.zip (5.x-1.0-rc2) the latest version of uc_event?
3. what are the outstanding bugs, if any?
Thanks for your help.
Re: Paid event
Answering my own question...
I got uc_event_3.zip (5.x-1.0-rc2) to work with ubercart 1.5, using drupal 5.7, with the 2 patches in its README.txt, plus signup-5.x-2.5, and the ubercart/signup integration (http://drupal.org/node/277721). Looks good!
Also needed uc_stockstub to ensure fully subscribed courses are no longer available. Thanks.
Drupal 6
I see both ubercart and event are still at dev stage for Drupal 6. Depending on the status of these then I would be willing to create a D6 version for a sponsor.
What kind of dumb am I?
Great concept. I can really use this module.
I have installed the event module and the uc paid event module. (And uninstalled and re-installed.) I have made the patches to the uc report module and the uc product module. I have created two event node types (one paid, one free). I have configured the event module. I have configured the uc paid event module to treat the paid event content type as a paid event. I can create events. I can create products. My event nodes do not show the product fields, nor do I see a box to tick as mentioned in one post below. If I submit the event, then return to edit it, there still are no product fields. From the other end, if I create a product I see no way to transform the product node into an event node. (Or, more accurately, make it both kinds of nodes.) I am in the latest version of Drupal 5.x.
What am I missing? Is there a taxonomy trick needed?
Thanks in advance.
Dumb?
I just got the dreaded errror msg referred to in comment #1 and elsewhere. I'll go back and double-check the patches. BTW, I am on latest UC for D5.
Still Dumb
I just got the dreaded error msg from comment #1. I'll go back and double-check the patches.