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
| Attachment | Size |
|---|---|
| uc_catalog_grid.zip | 6.84 KB |



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];
}
Re: Re: Enhanced Catalog Grid Display
hmm..not sure what the problem is...i don't think its a problem with the taxonomy.
Idan
Re: Re: Enhanced Catalog Grid Display
what version of ubercart are you using?
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.
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
Re: Re: Enhanced Catalog Grid Display
do these fields appear in the cart settings? can you send me a link
Idan
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....
Re: I get this error....
I'm getting the same error as #7. An idea of how to fix would be really welcome...
thx
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).
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.