17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1192 Views |
-
Holiday agency website

6 July 2007 at 11:37pm
Hi,
I have to make a holiday agency website for ski trips.
I've cretaed several page types:
* Holiday_holder: holds the type of holiday (example: group, individual,....)
* Country_holder: holds the country
* Resort: Information of the skiresort (amount of slopes, lifts, height,...)
* Hotel: Info about the hotel (price, ....)So, a hotel will be located under: Holiday->Country->Resort->Hotel
(example: Group holidays -> France -> Les GEts -> Action Hotel)Some questions:
1)Where do I best add the available booking periods for a hotel?
I also need to attach to each period, the available rooms for that period and also the roomtypes (2persons, 2children room / 2persons, 1child romm/......
I know you can have a many to may relationship, but how does this work. I can't find the right documentation for this.2) Is there somewhere a demo available of the current e-commerce website?
Thx,
Frederick Eyland -
Re: Holiday agency website

7 July 2007 at 7:44pm
I'll leave someone else to answer #1 but with #2, yes, parentsinc.org.nz is a good demo of the shop . . .
-
Re: Holiday agency website

7 July 2007 at 11:10pm
http://demoshop.silverstripe.com is an another example of the e-commerce module
-
Re: Holiday agency website

9 July 2007 at 2:52pm Last edited: 9 July 2007 2:53pm
just a hint, maybe there are mistakes
class Period extends DataObject {
static has_one = array (
'Hotel' => 'Hotel';
);
}class Hotel ... {
static has_many = array(
'Periods' => 'Period';
);//usage
$periods = $this->Periods();
// or maybe
$periods = $this->getManyManyComponents('Periods');
// for more sophisticated queries
$periods = DataObject::get('Period',...); -
Re: Holiday agency website

9 July 2007 at 8:35pm Last edited: 9 July 2007 8:48pm
This is my hotel.php script
<?
/**
* Defines the Hotel page type
*/
class Hotel extends Page {
static $db = array(
'PriceInfo' => 'Text'
);
static $has_one = array(
'Photo' => 'Image'
);static has_many = array(
'Periods' => 'Period';
);static $icon = "mysite/images/treeicons/hotel";
static $defaults = array(
'ProvideComments' => false
);
static $allowed_children = array('Room');function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
$fields->addFieldToTab("Root.Content.Price Info", new HTMLEditorField("PriceInfo","Give price information"));
return $fields
}
}class Hotel_Controller extends Page_Controller {
}
?>
Questions:
--------------
* Where do I add the code in the script:class Period extends DataObject {
static has_one = array (
'Hotel' => 'Hotel';
);
}* Where do I add the several available periods? Do I need to make for each period a node in the sitetree?
* To select the different periods available for hotel, I use TreeMultiselectField?
$periods = $this->getManyManyComponents('Periods');
$fields->addFieldToTab("Root.Content.Price Info", new TreeMultiselectField("Periods","Give the available
periods",$periods , $keyField, $labelField));What do I put in $keyField ?
-
Re: Holiday agency website

15 July 2007 at 12:38pm
You don't necessarily need to use TreeMultiSelect, for example you could use CheckboxSetField which would allow the same behaviour where a dropdown field wouldn't work since you're only selecting one component.
Cheers,
Sean
| 1192 Views | ||
|
Page:
1
|
Go to Top |




