By jjacks on
I'm trying to find a way to assign products to pages (like books, dvds,posters, etc.) At the moment they all just show up on one page, the default "product" page and I need to separate the categories to populate individual pages (books.htm, photos.htm, etc.) but can't figure it out. Any help out there?
Comments
I'm not entirely clear on what you mean
For example, what are you doing to create these "product pages"?
I've developed over the last few weeks something that may be in line with what you're looking for. What I have are CSV files that are "datafeed" files from the shareasale.com affiliate program. They handle affiliate relations for hundreds of merchants, many of whom upload their product catalogs as these CSV files.
What I've done is create a "shop" module. In shop.module I implement the "menu" hook (shop_menu). For each merchant from whom I'm using their datafeed, I make code like this in the shop_menu function:
This appears to be a standard _menu function.
Then in the "shop_xxx_page" function I look at the arguments to see what to do.
For example, if the URL is "/shop/xxx/4567292" then I know it's a product ID related to the xxx shop. If the URL is just "/shop/xxx" then the module lists the top level product categories. And to list a product category, the module encodes the category names in the URL like this:
http://7gen.com/shop/batteryspace/Camera+Batteries/Lithium+Ion+Rechargea...
With it encoded this way, it's simply a matter of using the "arg(2)" and "arg(3)" functions to retrieve a main category and subcategory name. Once the module has main and subcategory, it does a database query to retrieve the related products, and formats them on the page.
If you follow the above URL you'll be able to browse the result.
- David Herron - http://7gen.com/
+ David Herron - 7gen.com/, The Long Tail Pipe, davidherron.com/drupal-blogging-hints
Categories in Drupal
Thanks so much David, but it's really not the solution I was looking for, I guess I didn't make myself entirely clear. I'm really just trying to find a way to list products by categories, and then have each product assigned to the page they're categorized for. So, right now in Drupal, they all show up on one page ("product"). I want to find a way to separate them into about five other pages by assigning categories (which I have) but also having them show up on pages other than "product."
I hope this makes more sense, but thanks so much for taking the time to write.
-Jeff Jacks
maybe standard modules?
What about to create a new type of node called "product" using the flexinode module. Then create a vocabulary (tree of product categories) with taxonomy module. This vocabulary should accept only product-nodes and finally use a taxonomy_menu. Also a taxonomy_browser could be helpful to search in your product catalog.
hi David, would it be
hi David,
would it be possible to make a complete module out of your hack?
thank you.
Winter
http://blogsph.com