pulling records in one section based upon fields from another section (that are dynamic linked to first section)

8 posts by 2 authors in: Forums > CMS Builder
Last Post: October 24, 2013   (RSS)

By Codee - October 21, 2013

So, I have a site with a products section, a product_type section, and a product_color section.  The product_type and product_color sections have a "title" field and uploaded "graphic" field. This way the client can add/delete/modify types of products and offered colors on-the-fly, via CMSB, and the products section records will be automatically updated because inside each products record are the fields "product_color" and "product_type" which dynamically populate from their respective tables.

What I'm wanting to do for the client is have a list page of product types (producttypes.php) in which each product type hyperlinks to the products list page (products.php) that only displays the list records with that specific product type. Then when one of those links is chosen it brings up the selected product detail page (productsDetail.php). 

So, the producttypes.php might have listings for types: bowls, vases, lamps, stemware. When the visitor chooses a category from this page, say "stemware" they get the products list page (products.php) but only shows the listings for products in the database that have stemware chosen in their product_type field.  Then they select a single product, say 'champagne glass' from the products list page for just stemware and get the Details for that product (productDetails.php?champagne-13). Make sense?

I've performed similar operations in the past, but for the life of me I am unable to figure out how to set up the 2 list pages properly.  What goes in the header, and what goes in the body to make this work?

Thanks!

Hi,

See if this is something like what you're looking for. It may have some limitations for your specific application, but it might help get you started.

http://www.rcartierperry.com/store2.php

If it does, I'll post the viewers involved.

In my case, the client sets up the available colors for all products,in an editor called "available_colors"

Then they choose the available colors from the check box list on the product's "inventory" record and upload a sample image on that record for each available color. The color name is entered into an "info" field for that image.

If an available color check box is checked, then a color sample image appears on the detail page and the color appears in the pulldown.

Best,

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

By Codee - October 23, 2013

Hi Jerry, Actually that IS part of what I'm looking for! At least the next step of what I was thinking, but I think it may solve the problem I enquired about. It would be excellent to have a gander at the code for that.Thank you for your consideration!  Oh, and I don't know if you saw this on the first page of the link you sent (http://www.rcartierperry.com/store2.php ) but near the top it shows

"Notice: Undefined index: main_portfolio_group in /hsphere/local/home/c382004/rcartierperry.com/store2.php on line 189"  

Again, your assistance is tremendously appreciated!

By gkornbluth - October 23, 2013 - edited: October 23, 2013

Sorry, the link ishttp://www.rcartierperry.com/store2.php?main_portfolio_group=1  not just store2.php

Store.php had this code in  it to complete the missing data :

if($main_store_pageMetaData['totalRecords'] == 1)
 {
header("Location: http://www.rcartierperry.com/store2.php?main_portfolio_group=1");
exit;
}

Pages and ini files are attached

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php
Attachments:

store.zip 23K

By Codee - October 23, 2013

Wow! Excellent. Thank you so much!

By Codee - October 24, 2013

Jerry, thank you so much for sharing, and actually upon inspection your code is a bit beyond me.  It will take me quite a while to decipher how the code for your pages functions, let alone to adapt it.  I'm hoping for a simpler solution to the challenge. Can anyone else assist?

By Codee - October 24, 2013

Yes, Jerry! However, it looks like I finally figured out the problem.  Searching was not set for "true" and there was a single character missing in the referral core URL but no error generated. I've got it working though. I want to thank you.  Your solution IS very elegant and I am interested. After I meet with the client tomorrow I'll let you know if I could use some help, or hire you for that patch. Thanks!