I use several product classes (content types) for our store however this only works with the main Ubercart product content type.

Is it possible to make it work with other product content types?

David

CommentFileSizeAuthor
#7 uc_gbase-product_classes-610414-7.patch1.2 KBVolx

Comments

barry769’s picture

I am interested in this functionality as well. Is there any work being done on this?

OzSchmoz’s picture

Yes, me too! Most of my products are listed within alternative product classes.

Thanks for a great module.

bloke_zero’s picture

if you're looking for a quick fix you can always change line 225 of uc_gbase.module to include the product types you need. For example if you want to include a product class called 'nyloop' (you can use the devel module to get the node type, or easier firefox/firebug/drupal for firebug module) you can change the line to look something like:

    if ($form['type']['#value'] == 'product' || $form['type']['#value'] == 'nyloop') {

It's not a good solution long term of course, and I'm still in the process of setting this up so that might not be the complete solution.

Of course every time the node type is checked you'll need to change the line ...

ahimsauzi’s picture

Great Module! Subscribing!

excellira’s picture

kabojnk’s picture

There is a quick fix to this in version 1.0. Open uc_gbase.module and change line 225 from this:

if ($form['type']['#value'] == 'product') {

to this:

if (uc_product_is_product_form($form)) {

Thankfully ubercart has a built-in method to detect whether a node edit form belongs to a product or product class. Don't have time to submit a patch right now, but if somebody wants to do it feel free.

Volx’s picture

Category: feature » bug
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new1.2 KB

Changing this to a critical bug, because it renders this module useless. It is not up to this module to decide what a product is, that is Ubercart's job and Ubercart provides API function to determine which node is a product. I attached a patch that changes the hard-coded content-type checks into Ubercart API calls.

kabojnk’s picture

I can verify that the patch works on my end.

compujohnny’s picture

Status: Needs review » Fixed

fixed in the latest dev version

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.