Version: current

     1 <?php
     2
     3 /**
     4  * Виртуальные товары - используется для привязки товара к более чем одной рубрике
     5  *
     6  * @package Catalog
     7  * @author inxo
     8  */
     9 class VirtualProduct extends VirtualPage {
    10
    11     static $hide_ancestor = 'VirtualProduct';
    12     public $ExistsOnLive = true;
    13     static $defaults = array(
    14         'ShowOnlyInTab' => 1
    15     );
    16     static $summary_fields = array('Title');
    17
    18     function getCMSFields() {
    19         $fields = parent::getCMSFields();
    20         $fields->removeByName('CopyContentFromID');
    21         $fields->removeByName('VirtualPageHeader');
    22         $fields->addFieldToTab('Root.Content.Main', new HeaderField('VirtualPageHeader', _t('VirtualProduct.Header', 'Это виртуальный продукт')), 'Title');
    23         return $fields;
    24     }
    25
    26     function onBeforeWrite() {
    27         parent::onBeforeWrite();
    28         $this->ShowOnlyInTab = 1;
    29     }
    30
    31 }
    32
    33 class VirtualProduct_Controller extends VirtualPage_Controller {
    34
    35 }
    36
    37

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -