Multi tier product catalog

12 posts by 2 authors in: Forums > CMS Builder
Last Post: November 14, 2012   (RSS)

By jacgo - November 6, 2012

I would likt to build a Multi tier product catalog.

Product

> Product list A
> Product list B
> Product list C
>> Product list C-1
>>> Product C-1-1 detail page
>>> Product C-1-2 detail page

>> Product list C-2

I tired to refer the page
http://www.interactivetools.com/iforum/Products_C2/CMS_Builder_F35/gforum.cgi?post=89145;t=search_engine

It seems not what I want.

My question:
- Is there any simple way to do it ?? or any code for reference?
- What is Combo Page? Can I use the Combo page to build the Multi tier product catalog?

Thanks!

Re: [jacgo] Multi tier product catalog

Hi,

The simplest solution to this is to create a category type section, and add all of the fields to it that you need for a product.

To do this go to the admin section, then go to the section editor menu. Click the Add new editor button, in the pop up box select the advanced menus radio button, and select Category menu as the menu type.

When you go to the section you will be able to easily create a tiered menu system.

The combo page creates a page that displays a single record from a section on the right, and menu of all of the records from that section on the left. This is probably the best code generator example for you to use, as it sounds like this is what your trying to achieve.

Let me know if you need more details on implementing this system.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Multi tier product catalog

By jacgo - November 7, 2012

Hi Gerg
I use the Section Editors [Category Menu] to create the product section.
When I generat the code. I use the [Combo Page]

Got. [Record List] & [Record Detail]
Here is the page I created :
[url "http://174.132.79.189/~quanmax/embedded_boards_sbcs-list.php"]http://174.132.79.189/~quanmax/embedded_boards_sbcs-list.php[/#0066cc][/url]
[url "http://174.132.79.189/~quanmax/embedded_boards_sbcs-detail.php"]http://174.132.79.189/~quanmax/embedded_boards_sbcs-detail.php[/#0066cc][/url]

Above 2 pages are all the same.

There are three levels on my product page.
Parent Category
Sub Category
Detail Products

Do I need to Duplicate the combo code for 3 level page?
than only leave the correct code on the page.

sorry... a little bit confused.

Hope you can help.

Thanks!

Jac

Re: [jacgo] Multi tier product catalog

Hi,

So you want to have 3 seperate page types for parent category, sub category and a details page? And each of these will contain dynamic information from the category section you created? Or are you trying to display all of this information on a single page?

If your trying to use three seperate pages, I would create three php files using the combo page, one for each level of your product page. As you are using a different page for each level you won't be able to use the current record list/navigation system on each page, I would replace it with something like this:

<b>Record List</b><br/>
<?php foreach ($shop_categoriesRecords as $listRecord): ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<a style="margin-left:<?php echo ($listRecord['depth']+1)*10; ?>px;" href="<?php if($listRecord['depth'] == '0'){
echo 'shop.php?num='.$listRecord['num'];
}elseif($listRecord['depth'] == '1'){
echo 'embedded_boards_sbcs-list.php?num='.$listRecord['num'];
}elseif($listRecord['depth'] == '2'){
echo 'embedded_boards_sbcs-detail.php?num='.$listRecord['num'];
}
?>" ><?php echo htmlencode($listRecord['name']) ?></a><br/>
<?php if ($isSelected) { print "</b>"; } ?>
<?php endforeach ?>

<?php if (!$shop_categoriesRecords): ?>
No records were found!<br/><br/>
<?php endif ?>


So this code changes the name of the file displayed in the navigation depending on the on if it is a parent category, sub category or details page, and it does this based on the pages depth. The ?num= part on the end of each url will ensure that the appropriate detail page information is loaded. You will need to modify the code so that it uses the page names and variable names you have created.

I hope I've made this clear, let me know if you have any questions or need any more help.

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Multi tier product catalog

By jacgo - November 8, 2012

Hi, Gerg

About your questoins:
Yes. I hope the product page can be 3 seperate page types for parent category, sub category and a details page.
And each of these will contain dynamic information from the category section you created.

but what I really want is to have is a no limit depth catalogs.

I hope my category look like:
http://www.quanmax.com/product/product_index.aspx
First level :
- Left sidebar : The first level catelog list.
- Right side : Same as the first level catelog list with the photo & short content.

Secand level :
- Left sidebar : The 1st level or 1,2 level catelog list
- Right side : the secand level category list.

Thired level (options):
- Left sidebar : The 1st level or 1,2,3 level catelog list
- Right side : the thired level category list.

Detail level :
- Left sidebar : The 1st level or full level lsit
- Right side : the detail product infromation.



I tried to study the article http://www.interactivetools.com/forum/gforum.cgi?do=post_view_flat;post=64259;page=1;sb=post_latest_reply;so=ASC;mh=25;
and created a page : http://www.ctrbs.org/categoryList.php

Also I follow your code the renew my test page
http://174.132.79.189/~quanmax/embedded_boards_sbcs-list1.php

Still don't know how to show the sub-category list the right side area.
My face is blue now.

Is there any real simple way to create the category on cmsAdmin directly?

Thanks!


Jacgo.

Re: [greg] Multi tier product catalog

By jacgo - November 9, 2012

Hi Greg

Thanks!

I tried to add image code below your code.


<a style="margin-left:<?php echo ($listRecord['depth']+1)*10; ?>px;" href="<?php if($listRecord['depth'] == '0')
{echo 'shop.php?num='.$listRecord['num'];}elseif($listRecord['depth'] == '1')
{echo 'cat.php?num='.$listRecord['num'];}elseif($listRecord['depth'] == '2')
{echo 'product.php?num='.$listRecord['num'];}?>"><?php echo htmlencode($listRecord['name']) ?> </a> <br/>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

Each categories show same images
[url "http://174.132.79.189/~quanmax/embedded_boards_sbcs-combo.php"]http://174.132.79.189/~quanmax/embedded_boards_sbcs-combo.php[/#0066cc][/url]

Also when I click the left side menu items.
Got 404 errors.

My questions here is
1. How can I add
1) catelog image
2) catelog content
on right side columns?
2. Do I need to use Multi Record section or combo page to do the work ?
3. How can I difend php code without using php "foreach" ?

Hope you can help. Thanks again!

Jacgo

Re: [jacgo] Multi tier product catalog

Hi Jacgo,

The reason your images are the same for each category is that the $upload variable isn't being set inside the foreach loop. You can access it in the foreach loop like this:

<img src="<?php echo $listRecord['nameOfUploadField][0][thumbUrlPath]; ?>" >

or:

<?php foreach($listRecord['nameOfUploadField'] as $picture): ?>
<img src="<?php echo $picture[thumbUrlPath]; ?>" >
<?php endforeach; ?>


Your getting 404 errors on some pages because they're linking to cat.php, which isn't a file you've created.

It doesn't matter if you use a multi record or combo page, both will contain any images you have uploaded as long as you have loadUploads set to true in your getRecords/getCategories function:

list($categoryRecords, $categoryMetaData) = getRecords(array(
'tableName' => 'category',
'where' => "`num` = '1'",
'loadUploads' => true,
'allowSearch' => false,
'limit' => '1',
));


A combo page is a combination of both a details page and a list page. It will display all of the records from the section on the left, and carry out a page search in the right hand column.

Could you give me a bit more detail on point 3?

Thanks!
Greg Thomas







PHP Programmer - interactivetools.com

Re: [greg] Multi tier product catalog

By jacgo - November 13, 2012

Hi Greg
One of my friend help me to figure it out.
My friend add some code below your code.
Here is the code for reference.


<?php foreach ($rightMenu as $listRecord): ?>
<?php $isSelected = ($listRecord['num'] == $detailRecord['num']); ?>
<?php if ($isSelected) { print "<b>"; } ?>
<a style="margin-left:<?php echo ($listRecord['depth']+1)*10; ?>px;" href="<?php if($listRecord['depth'] == '0')
{echo 'shop.php?num='.$listRecord['num'];}elseif($listRecord['depth'] == '1')
{echo 'cat.php?num='.$listRecord['num'];}elseif($listRecord['depth'] == '2')
{echo 'product.php?num='.$listRecord['num'];}?>"><?php echo htmlencode($listRecord['name']) ?> </a> <br/>

<?php
echo "num# ". $listRecord['num']. "<br/>";
list($ahd, $bhd) = getRecords(array(
'tableName' => 'embedded_boards_sbcs',
'where'=> " num='". $listRecord['num']. "'",
'loadUploads' => true,
'allowSearch' => false,
'limit'=> 1,
));

[url "mailto:$atm=@$ahd[0"]$atm=@$ahd[0[/url]];
$xpic=$atm['image'][0];

if ($xpic) {
echo "<img src='". $xpic['thumbUrlPath']. "' width='". $xpic['thumbWidth']. "' height='". $xpic['thumbHeight']. "'/><br/>";
}
?>



--------------------------------------------------------------------------------------
I just wonding to know is there any simple way to show same level images?

Just hope the code simple to handle.

Thanks!

Jacgo.

Re: [greg] Multi tier product catalog

By jacgo - November 14, 2012

Hi Greg

I think I found the article.

http://www.interactivetools.com/forum/gforum.cgi?post=77230

It is real simple and fit my need.