Paid event

Contrib type: 
Module
Status: 
Bug testing
Moderation: 
Awaiting moderation

Downloads

Latest version: 
beta1
Compatibility: 
Ubercart 1.x

uc_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.

New features: views handler for number of participants to include in reports

This module has been on the following production site for almost a year: http:www.opengym.co.uk.
Other sites using it include:
http://www.pathwaysforhealing.com

The module is still in bug testing status because of problems with having the event registering as a product. This often requires making code changes to core ubercart modules. See README.txt. Some of these issues are tackled in this thread. Once this has been overcome for your site, then the module runs smoothly.

If you have any questions/issues then submit an issue rather than add to this thread.

Related threads: 

PreviewAttachmentSize
uc_event.zip4.97 KB
New Zeal's picture
Offline
Joined: 03/22/2008
Juice: 31
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.

New Zeal's picture
Offline
Joined: 03/22/2008
Juice: 31
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.

Marillion's picture
Offline
Joined: 06/10/2008
Juice: 2
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

specmav's picture
Offline
Joined: 01/06/2008
Juice: 32
Re: Error message

Can this module work with a Date+Calendar setup as opposed to the Event Module?

New Zeal's picture
Offline
Joined: 03/22/2008
Juice: 31
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.

New Zeal's picture
Offline
Joined: 03/22/2008
Juice: 31
Re: Re: Error message

UC_event only works with the event module

nickdunse's picture
Offline
Joined: 07/13/2008
Juice: 2
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

New Zeal's picture
Offline
Joined: 03/22/2008
Juice: 31
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.

kenyan's picture
Offline
Joined: 08/06/2008
Juice: 6
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.

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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.

AttachmentSize
uc_event.zip 5.17 KB
kenyan's picture
Offline
Joined: 08/06/2008
Juice: 6
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

kenyan's picture
Offline
Joined: 08/06/2008
Juice: 6
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!

PaulW (not verified)
PaulW's picture
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?

kenyan@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 8
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

PaulW (not verified)
PaulW's picture
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...

doms's picture
Offline
Joined: 08/15/2008
Juice: 9
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!

cacci's picture
Offline
Joined: 08/13/2008
Juice: 5
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

kenyan@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 8
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_integration
Hope you'll find your solution here but it says the solution is upgrading.
Please update.

kenyan@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 8
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.

kenyan@drupal.org's picture
Offline
Joined: 08/13/2008
Juice: 8
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).

PaulW (not verified)
PaulW's picture
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...

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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_hook.

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.

AttachmentSize
uc_event.zip 8.2 KB
PaulW (not verified)
PaulW's picture
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

Dubs's picture
Offline
Joined: 11/20/2007
Juice: 79
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!

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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).

AttachmentSize
uc_event.zip 8.14 KB
NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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.

PaulW (not verified)
PaulW's picture
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.

PaulW (not verified)
PaulW's picture
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?

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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.

PaulW (not verified)
PaulW's picture
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.

jugney's picture
Offline
Joined: 06/03/2008
Juice: 202
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;
}
}

Insurrectus's picture
Offline
Spreading the word - Ubercart for president.
Joined: 08/22/2007
Juice: 364
Any plans for D6/U2?

We would be willing to possibly sponsor.

liberatr@drupal.org's picture
Offline
Joined: 11/06/2008
Juice: 4
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

AttachmentSize
uc_reports.module.patch 858 bytes
uc_product.module.patch 735 bytes
zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 1075
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.

zeezhao's picture
Offline
Joined: 04/23/2008
Juice: 1075
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.

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
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.

gjmokcb's picture
Offline
Uber Donor
Joined: 11/17/2008
Juice: 61
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.

gjmokcb's picture
Offline
Uber Donor
Joined: 11/17/2008
Juice: 61
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.

gjmokcb's picture
Offline
Uber Donor
Joined: 11/17/2008
Juice: 61
Still Dumb

I just got the dreaded error msg from comment #1. I'll go back and double-check the patches.

kddailey's picture
Offline
Joined: 01/14/2009
Juice: 29
No Errors, but No Option to Turn Event into Product

I am also having same problem as gjmokcb's original post. I am not getting errors, but do not see an option in a new event to convert it to a product. Do patch issues demostrate themselves this way, or will they always produce an error message? Thanks

Drupal 5.10
Ubercart 5x1.6
uc_event
Event 5.x-2.x

radicalhack's picture
Offline
Joined: 02/19/2009
Juice: 2
D6?

Would love to see this module work for D6. Any ideas as to when this may happen?

thanks
al

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Paid event

Is there anyway get this module to work Event Manager? I have the Event Manager module installed because I want the option to participate in roles and timeslots but when I click on the registration page, I get a pop-up error message like this "invalid registration type selected:7". The number at end of the error message increments as I select different participant roles. Please see below. Thanks.

Simple registration - 7
Participants in roles - 8
Participants in timeslots - 9
Participants in roles & timeslots - 10
Participants contribute item or food - 11

Linxor's picture
Offline
Joined: 03/25/2009
Juice: 18
A step-by-step guide to set up UC Events in D5 with UC 1.7

I had a few problems during the install process of Paid Events today, so I wanted to document everything I found along the way, including tips and patches so that others would be able to get this up and running quickly. Hopefully this will also address some of the problems reported in a few of the comments above.

Here are my specs:
Drupal 5.16
Ubercart 1.7
Event 2.x-dev (2009-Mar-16 release)
Ubercart Event 5.x-1.0-rc2 (uc_event_3.zip from 2008-Aug-28, #25 above)

 
1 ) Enable all necessary modules:

Go to Admin > Site Building > Modules

- Enable Event module
- Enable all UC Core modules
- Enable UC Optional modules like Catalog and Payment
- Enable UC Event module
- Enable UC payment modules (whichever ones you need)

 
2 ) Set permissions for your role:

Make sure you can create and edit events and products, and configure the store

 
3 ) Make both patches to uc_products and uc_reports as seen in #33

Don't skip this step!

 
4 ) Configure your Event content type as a Paid Event:

Go to Admin > Site configuration > Paid Event
Check the "Event" node type and press Save

 
5 ) (optional) Enable Categories for your Events (to display in the Catalog):

To get Events displaying in your product catalog, you'll need to assign your Catalog vocabulary to the Event content type.

Go to Content management > Categories
Click on "edit vocabulary" for your "Catalog" vocabulary item
Under "Types", check "Event"
Click Submit

If you want, you can add an "Events" section to your catalog by clicking on "add terms" from the Categories page.

Now whenever you add/edit an event, you'll see "Catalog" as an option and you can select the appropriate section to place your event in.

 
6 ) (optional) Enable an image for Event content types:

I don't know how universal this is out of the box, but given my module configuration of CCK, Image and ImageCache modules, all of my products have an "image" field. I wanted to add that same field to Events.

Here are the steps:

- Go to Admin > Content management > Content types > Edit Event
- If you already see an image field on the "Manage fields" tab, there may be nothing else you need to do.
- If not:
- Click the "Add field" tab
- In the "Add existing field" section, select "Image (field_image_cache)" (yours might be a different name)
- Click "Add field" button

 
7 ) Patch uc_event.module to make it compatible with the event-5.x-2.x module

If you're running the event-5.x-1.x module, skip this step.

Event information in event-5.x-1.x is stored differently than in event-5.x-2.x.
uc_event.module was built to interface with event-5.x-1.x code.
This difference causes event pricing and "Add to Cart" not to appear on event-5.x-2.x.

Here's the small code patch to fix this:

function uc_event_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {

    case 'view':
      /* If we have a pseudo product, add some product specific theming to it. */
      // only display if this is an event product
-      if ($node->event_start) {
+      if ($node->event_start||$node->event['start']) {

Hope that helps. Good luck!

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Re: Paid event

I would like to differentiate events from my other products. Can I possibly change "add to cart" to "Buy now" or "Add event to cart"?

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: A step-by-step guide to set up UC Events in D5 with UC 1.7

Hi Linxor, I added imagecache field but my images don't show. I checked my error log and I got preset files not found. How did you get your images to show? Thanks.

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Paid event

I also have "Events with volunteer timeslot" module enabled and at the paid event settings page, I ticked it too as a paid event. However when I creat an event with volunteer timeslot, I don't any option to turn the event to a paid event.

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Paid event

I changed line 56-57 from

<?php
   
if(!in_array('event',$node_types)) array_unshift($node_types,'event');
    if ((
user_access('create events') || user_access('edit own events')) && in_array($node_type, $node_types)) {
  
?>

to

<?php
   
if(!in_array('event',$node_types)) array_unshift($node_types,'event', 'volunteer_timeslots');
    if ((
user_access('create events') || user_access('edit own events') || user_access('create volunteer events') || user_access('edit own volunteer events')) && in_array($node_type, $node_types)) {
   
?>

and now I see the option to make my events with volunteer timeslots a paid event.

I think there is a bug in the code since I selected "event with volunteer timeslots" on the paid event admin settings page so it should have worked in the first place.

I'm a novice in drupal and php so I'm not my solution is the best way to do it. If you have a better way, please share. Thanks.

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Re: Paid event

Ok I just created an event with volunteer timeslots and I'm getting the error below and even though the event looks like a product type I didn't see "Add to cart".

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_101' was given in /home/wardro5/public_html/wardrobeave/includes/form.inc on line 218.

I have applied the patches in the readme.txt and I don't get this warning message for regular events. Would someone please help? Thanks.

fehin's picture
Offline
Joined: 12/17/2008
Juice: 154
Re: Re: Re: Paid event

I changed my code from

<?php
   
if(!in_array('event',$node_types)) array_unshift($node_types,'event', 'volunteer_timeslots');
    if ((
user_access('create events') || user_access('edit own events') || user_access('create volunteer events') || user_access('edit own volunteer events')) && in_array($node_type, $node_types)) {
   
?>

to

<?php
   
if(!in_array('event',$node_types)) array_unshift($node_types,'event');
    if ((
user_access('create events') || user_access('edit own events') || user_access('create volunteer events') || user_access('edit own volunteer events')) && in_array($node_type, $node_types)) {
   
?>

and I'm still getting the warning message.

NewZeal's picture
Offline
Joined: 04/18/2008
Juice: 56
uc_event

I have put in a request to be able to edit the original post so that I can publish a more polished version of this module with more accurate details on how to implement it.

Will respond when that is available.