my problem is this.
I have created a bicycle web site.
I have a top level page 'shopholder.php' which has children 'productholder.php', and below that i have children 'productpage.php'; and these products are again broken down into the three types 'mountain', 'road', 'childrens' (eg type of bicycles)
so the structure looks like this
SHOPHOLDER (shopholder.php)
SHOP ONE (productholder.php)
- product one (productpage.php) (type=mountain)
- product two (productpage.php) (type=mountain)
- product three (productpage.php) (type=mountain)
- product four (productpage.php) (type=road)
- product five (productpage.php) (type=children)
SHOP TWO (productholder.php)
- product one (productpage.php) (type=mountain)
- product two (productpage.php) (type=mountain)
- product three (productpage.php) (type=road)
- product four (productpage.php) (type=road)
- product five (productpage.php) (type=children)
SHOP THREE (productholder.php)
- product one (productpage.php) (type=mountain)
- product two (productpage.php) (type=mountain)
- product three (productpage.php) (type=road)
- product four (productpage.php) (type=road)
- product five (productpage.php) (type=children)
In productpage.php i have the below functions to return the product item thumbnail images to display... however when i click through to any of the shop pages (productholder.php) eg SHOP ONE i get all the mountain bicycles etc returned. from all the shops.
How do i call just those products (Children) of the current shop? can anyone help? any help much appreciated
function ProductMountain() {
$mountain = DataObject::get_one("ProductHolder");
return ($mountain) ? DataObject::get("ProductPage", "Type = 'Mo'", "") : false;
}
function ProductRoad() {
$road = DataObject::get_one("ProductHolder");
return ($road) ? DataObject::get("ProductPage", "Type = 'Ro'", "") : false;
}
function ProductChild() {
$child = DataObject::get_one("ProductHolder");
return ($child) ? DataObject::get("ProductPage", "Type = 'Ch'", "") : false;
}
Does this make sense?