March Central Florida Meetup Wrapup

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
ultimike's picture

Thanks to everyone for coming out to the March (central) Florida Drupal User's Group meetup yesterday at MindComet's offices in Altamonte Springs. We had about 10 people there, including 1 new person.

We started the meetup with a DrupalCon DC discussion. 5 of us at the meetup were at DrupalCon, so we decided to run through the DrupalCon schedule and give (very) quick summaries of the sessions we found most interesting and the top one or two things we learned. It was a fairly quick and informative way to cover things.

I (Mike) then gave a fairly quick overview of the Flag module. This module has been on my radar lately (I recently blogged about it on DrupalEasy.com) so I decided to take some time to share my enthusiasm about it.

We then did an interactive demonstration of the UC Node Checkout module - an Ubercart add-on module that allows the site admin to assign a node (of any desired type) to a user when they make a purchase. This is useful when someone is purchasing a ticket to an event as a way of having them fill out a user profile that can then be used elsewhere on the site. The Do It With Drupal conference used this exact module for their registration process.

I was less prepared than I should have been for the demonstration, but we managed to figure out 90% of the process. We (I) got a bit tripped up with the fact that these checkout nodes are created by the user before the checkout process is complete, so if a user chooses to purchase one, then never completes the checkout process, the site ends up with nodes for people who didn't actually purchase anything.

The way to solve this is to add a "purchase complete" CCK field (hidden from users via a "Restricted Node Fields" setting in the UC Node Checkout configuration page for the checkout node) that gets updated using Ubercart's conditional actions upon checkout completion. This acts as a flag to separate the nodes for users who have completed the checkout process from nodes of users who haven't completed the process. Then, a simple view can be created to filter on this field. An advantage of this solution is that the site admin will still have access to the nodes of un-completed checkouts - useful for followup to try to complete the sale.

Note: to see Ryan, the Ubercart King, go through this same process, check out this video at about the 22 minute mark. He actually adds two "hidden" fields to the checkout node, a "status" field (similar to our demo's "purchase complete" field) and an "orderid" field.

Anyway, we were unable to complete the process of actually adding the bit of code necessary to throw the "purchase completed" flag - mainly because I couldn't find the "execute custom PHP code" option for conditional actions. It turns out that this is a relatively new feature of Ubercart, and only available in beta 5 or later - I was using beta 4 during the demonstration. After upgrading, there was a new available action in Ubercart's Conditional Actions: Execute Custom PHP code.

To complete what we were working on during the meetup, you'll need to create a new Ubercart Conditional Action. The trigger is "customer completes order", there are no conditions, and the action is this custom PHP code:

foreach ($order->products as $product) {
  if (isset($product->data['node_checkout_nid'])) {
    $node = node_load($product->data['node_checkout_nid']);
    $node->field_pc['0']['value'] = 1;
    node_save($node);
  }
}

Keep in mind that this PHP code is unique to the example we were working on yesterday, where we added a "purchase complete" ("field_pc") field to the "attendee profile" content type. This code updates that field with a value of 1, allowing us to create a view that filters on this field. Those nodes where this field is equal to 1 represent users who have completed the checkout form - the rest are abandoned checkouts.

Phew - I'm glad I figured that all out, I'll sleep better tonight.

After that debaucle, Andrew Riley gave a presentation about the WYSIWYG module as well as some associated modules:

Input Filter module - allows you to define the filter to use by role
http://drupal.org/project/filter_default

IMCE WYSIWYG bridge - Enables the IMCE editor in your WYSIWYG editor
http://drupal.org/project/imce_wysiwyg

IMCE - File manager that allows you to upload and manage files
http://drupal.org/project/imce

HTML Purafier - Cleans up dirty HTML and makes it standards compliant
http://drupal.org/project/htmlpurifier

Typogrify - brings the typographic refinements of Typogrify to Drupal
http://drupal.org/project/typogrify

Comments

Thanks!

DamienMcKenna's picture

Thanks for the writeup, sounds like it was another great meeting.

Andrew: what do you think are the benefits of use ICME vs just using imagefield?

Imagefield vs IMCE

Andrew M Riley's picture

For me, it's all about control. I use imagefield when I want to specifically force things like the directory the file will be uploaded to as well as any filters such as size, color. Imagefield allows me as a developer much more control on how the image will be displayed/used. I tend to only use IMCE for general content areas to let the site users put in non-critical images in a free-form environment.

Imagefield = developer control
IMCE/WYSIWYG = user control

Flag Module Follow Up

Andrew M Riley's picture

I asked the question: How do we find out who has flagged a node?

In the demo the relationship appeared not to be working (it was listing anonymous). After some searching I found out this is due to the flag type we had setup was a "global" flag. This relationship (Flag: User) won't work for global flags since global flags record the user as 0. After I changed my flag type the relationship in the view started working.

relationship

ultimike's picture

Yeah, but I think it would still be useful to see who flagged each global flag as well.

Did you get into the code much? Do you think it would be an easy enhancement of the module?

-mike

I don't do easy answers

Andrew M Riley's picture

Yes and no :) They specifically set the user id to zero. It would be easy to change it out but I haven't figured out what all of the implications would be since it looks like the author went out of their way to do it with user zero.

explanation

ultimike's picture

This explains it all:

http://drupal.org/node/339657

-mike

Florida

Group organizers

Group categories

Florida Topics

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week