Enhanced Catalog Grid Display

Contrib type: 
Module
Status: 
awaiting

Downloads

Compatibility: 
Ubercart 1.x

Hello,

I've been upgrading this module a bit because I needed to add a few new fields to the grid. So

please take a look and let me know what you think...this is what I added:

allows you to display in the catalog grid, cck fields from the product type.
it adds in the catalog configuration checkboxes for each product cck fields, so you can choose what to display in the grid and what not.

Also the fields are sorted as such:

1 - link + product name
2 - product image
3 - cck fields ordered according the field weight
4 - add to cart button.

that's it...pretty simple. Oh..now it requires cck to run too.

So, if someone could take a look and let me know what the proccess of adding this to the contributions...I don't want to take to much credit for this because 90% of the module was already there.

Idan


PreviewAttachmentSize
uc_catalog_grid.zip6.84 KB
Miso's picture
Offline
Joined: 08/10/2007
Juice: 134
Re: Enhanced Catalog Grid Display

I keep getting this error on the catalog pages:

warning: Illegal offset type in isset or empty in /home/mysite/public_html/modules/taxonomy/taxonomy.module on line 1172.

and it's this whole function in taxonomy.module that's throwing that error:

function taxonomy_get_term($tid) {
  static $terms = array();

  if (!isset($terms[$tid])) {
    $terms[$tid] = db_fetch_object(db_query('SELECT * FROM {term_data} WHERE tid = %d', $tid));
  }

  return $terms[$tid];
}

arbel's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/12/2007
Juice: 331
Re: Re: Enhanced Catalog Grid Display

hmm..not sure what the problem is...i don't think its a problem with the taxonomy.

Idan

phoenix0783's picture
Offline
Joined: 08/07/2007
Juice: 185
Re: Re: Enhanced Catalog Grid Display

what version of ubercart are you using?

francishsu's picture
Offline
Joined: 09/11/2007
Juice: 8
fix for alpha 7e

In uc_catalog_grid.module function theme_uc_catalog_grid_browse(), I changed the line
$catalog = uc_catalog_get_page($args);
TO
$catalog = uc_catalog_get_page($args[0]);

Not very familiar with PHP, but with Ubercart alpha 7e $args was set to an array via func_get_args(), while uc_catalog_get_page is expecting an int

I'm not sure if my change will break older versions of Ubercart.

capitano83's picture
Offline
Joined: 09/26/2007
Juice: 52
Re: Enhanced Catalog Grid Display

i have just installed...very nice module.

i have selected many cck field to display but in catalog grid i will only see "title" - "image" and "add to cart" !!!

what can i do now?
sincerly,
Max

arbel's picture
Offline
Bug FinderGetting busy with the Ubercode.
Joined: 08/12/2007
Juice: 331
Re: Re: Enhanced Catalog Grid Display

do these fields appear in the cart settings? can you send me a link

Idan

primal's picture
Offline
Joined: 08/21/2008
Juice: 39
I get this error....

Fatal error: Call to undefined function uc_catalog_term_path() in /home/rockchic/public_html/modules/uc_catalog_grid_2 Folder/uc_catalog_grid.module on line 103.

I'm not sure what I can do to fix this, but I'd really like to get this module to work....

mattkevan's picture
Offline
Joined: 04/19/2008
Juice: 22
Re: I get this error....

I'm getting the same error as #7. An idea of how to fix would be really welcome...

thx

orvad's picture
Offline
Joined: 03/15/2008
Juice: 5
Re: Re: Enhanced Catalog Grid Display

Same problem here.

Can select CCK-fields but they don't display in the node. Only the default fields show up (image, title, price, add to cart).

pontevin's picture
Offline
Joined: 02/16/2008
Juice: 2
Illegal offset type and other nasty errors

Hey folks,

I made some investigation in the past five minutes.

The problem is in the uc_catalog_get_page($tid) function located in uc_catalog.module. In my version ($Id: uc_catalog.module,v 1.14.2.15 2008/11/03 21:26:35 rszrama Exp $) it starts at line 740.

Somewhy the argument given to this function ($tid) is an array, but inside the function there is a call to the core taxonomy module's taxonomy_get_term function:

(line #745) $term = taxonomy_get_term($tid);

The problem is taxonomy_get_term needs an integer (which is the id of the term). But if in this case $tid is array, it generates an ugly warning. So what we can do is patch the original function:

(line #745) $term = taxonomy_get_term($tid[0]);

It works because I found out the array $tid contains 
0 => the term id,
1 => the term name.

In my setup at least.

It needs further investigation whether there is a situation, where the function's $tid parameter is not an array, or if it is, it' structure is not that I've found.

That's why I put another line
if(!is_array($tid)) $tid[0]=$tid; before line #745, just before the messy function occures.

I don't think we should modify the core modules every time a simple error occures.

If someone make sny further investigation, please share that.

tekad's picture
Offline
Joined: 10/21/2008
Juice: 160
Why use this module

Isn't this functionality now apart of 1.x core? Why are there people trying to add this module to a 1.x install?

ferrangil's picture
Offline
Joined: 02/27/2009
Juice: 62
Similar functionality for Ubercart 2??

I need to display some CCK fields on my Grid Catalog. It's not easier to build a View instead of modifying (enhancing) the default Grid Catalog view?
If anybody knows how to accomplish that in Ubercart 2 (Views 2, Drupal 6) please let me know!

EDIT: I just copied the _uc_catalog_product_grid function from uc_catalog.module to my template and I just added a text field into the grid display. The code is easy to understand, so anybody will be able to do print new fields from there. I node_load'ed a node reference and printed it as a link (we have books, we display the Authors name on the grid, together with the title and the cover...).

kingyann's picture
Offline
Joined: 03/09/2009
Juice: 2
similar problem

I need to have one extra field in the catalog grid display (ubercart 2, drupal 6.9). Looks like I need to have the same thing as Ferrangil, however the field should display the things I filled in into a new field in Product. How can this be achieved?

EDIT: Found my solution.

$product_table .= ''. $product->field_test[0]['value'] .'';

\o/