9 replies [Last post]
venkat-rk@drupal.org's picture
Offline
Joined: 03/19/2008
Juice: 205
Was this information Helpful?

I would like to use Ubercart for my internet services startup. I will be selling web hosting, email hosting and spam filtering. For each service, the customer will make a custom order picking and choosing various components and/or number of users/user licences. And, each component will have its own pricing, with the total being calculated from the components chosen multiplied by the number of users or disk space etc.

The order page I have in mind is similar to this:
http://luxsci.com/extranet/order_wizard/step1.php

Are these things possible out of the box with Ubercart?

And, I am also looking for the common payment options such as monthly invoicing, quarterly invoicing with invoice reminders being sent out etc etc.

Am I asking for the moon?Smiling

I think not, but I am unsure, so any insights would be greatly appreciated.

Thanks,
Venkat

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Can ubercart handle custom product ordering?

Hey Venkat, not necessarily asking for the moon, but certainly looking for something a little different than Ubercart provides. At its core, Ubercart is good for selling actual products or individual services that can be presented as products. For something like a custom product builder like this, you'd create the form yourself and then use Ubercart as a sort of behind-the-scenes framework. For example, you can make a custom module that will gather the customer's information and then add a product to the cart and go to the checkout page without the customer ever really knowing there are product nodes on your site.

venkat-rk@drupal.org's picture
Offline
Joined: 03/19/2008
Juice: 205
Hi Ryan, Thank you for

Hi Ryan,

Thank you for clarifying this for me.

I understand that this would have to be a custom form, but I was thinking that the individual components of each service could be handled by CCK fields. The disk space stuff and number of users etc could be handled by CCK computed fields, for instance.

I believe ubercart 'products' can be built using CCK. If so, it would seem that only the custom form may be necessary to present the ordering system/workflow to a customer, correct?

Venkat

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Hi Ryan, Thank you for

Well, the main issue is that your customers won't have access to dealing w/ CCK fields. These things would be better suited as attributes, especially since you'll be able to use the attribute system to alter the price of their subscription. So the products would be built and their options specified through the attribute/option system, but customer wouldn't necessarily use the add to cart form. You can make your own multi-step form that simply uses the Ubercart API to add the right product w/ attributes to the cart.

venkat-rk@drupal.org's picture
Offline
Joined: 03/19/2008
Juice: 205
These things would be better

>> These things would be better suited as attributes, especially since you'll be able to use the attribute system to alter the price of their subscription.

Hi Ryan,

Thank you again. This is exactly what I had in mind except that, not having given UC a real test drive, I thought attributes (the components that go to make up the product) would be handled by CCK fields.

>> You can make your own multi-step form that simply uses the Ubercart API to add the right product w/ attributes to the cart.

This sounds exactly like what I want. I think it's time for me to install Ubercart.Smiling

nareshvajawat's picture
Offline
Joined: 07/30/2008
Juice: 2
Product made up of products

Hi Venkat / Ryan,

I have a similar issue , Can I have a product which is a mixture of already existing products. For eg In order to build a PC i will need to add a motherboard , processor ,etc... now I already have Processor and motherboard as separate products , how do I create a view for the user where the user can select processor and motherboard according to his choice.

Thanks
Naresh

drfuzetto@yahoo.com's picture
Offline
Joined: 01/17/2009
Juice: 91
Re: Re: Hi Ryan, Thank you for

Do you have example code of how to use the Ubercart API in a custom module to add a product to a cart?

I don't understand how to use the hook_add_to_cart. Can I change the values ($nid, $qty, $data)?

Also, can I call the mymodule_add_to_cart function from a different function to invoke the add to cart action?

What I am trying to do is interrupt the add to cart process, do my own code, then continue on with the rest of the process (display cart).

I hope that make sense.
please help.
thanks

RSTaylor's picture
Offline
Joined: 04/02/2008
Juice: 99
drfuzetto@yahoo.com
drfuzetto@yahoo.com wrote:

Do you have example code of how to use the Ubercart API in a custom module to add a product to a cart?

call the function

uc_cart_add_item($nid, $qty = 1, $data = NULL, $cid = NULL, $msg = TRUE, $check_redirect = TRUE);

$data is an arbitrary array of key => value data that will be stored in uc_order_products table. (Usually this will be a module_invoke_all('add_to_cart_data', $form_values), where form values contains the data that would be in an add to cart form.)

$cid is a cart id (leave it null for current user)

$msg is whether or not to show a message saying that the product has been added to the cart.

$check_redirect is whether or not to redirect the user afterwards (make if false if you need to add a number of items, or don't want the user redirected)

drfuzetto@yahoo.com wrote:

I don't understand how to use the hook_add_to_cart. Can I change the values ($nid, $qty, $data)?

Not directly, hook_add_to_cart() is mostly for letting Ubercart know "Yes you can add that item to the cart." or "No you can't add that and here's what to tell the customer."

You could perhaps call uc_cart_add_item() to add another item and
return array('success' => FALSE, 'silent' => TRUE); to prevent adding the one that the customer was trying to add. (That has the potential for infinite recursion bugs, so code carefully.)

drfuzetto@yahoo.com wrote:

What I am trying to do is interrupt the add to cart process, do my own code, then continue on with the rest of the process (display cart).

There's another hook in that flow that may be useful: hook_add_to_cart_data($form_values), called just before hook_add_to_cart(). You cannot modify the $form_values being passed in, and should return the array that becomes the $data argument for hook_add_to_cart(). (That one is defined in docs/hooks.php)

Hope that helps.

LEternity's picture
Offline
Joined: 07/19/2011
Juice: 8
Why not? Options = Products

Hi Ryan,

Would it be too difficult to implement already existing products as options? Ubercart could use the product's title as the option's title...

Just an idea that might simplify things a lot...

shv_rk's picture
Offline
Joined: 08/16/2010
Juice: 112
Hello, I am very new to

Hello,

I am very new to Drupal and Ubercat in general.

I need exactly same thing.
Basically want to have to types of products: custom and fixed.
fixed products have fixed attributes and normal checkout.

for custom products users are able to customize product ingredients, select form the available
ingriendents and add as much as they want.

How can I create a custom form and call ingredients (get it frm db), so on...
where the form should be added? which file?
how can I add it to basket and then checkout.

Is there any sample codes??

Thank you