Source of file FeaturedProducts.php
Size: 1,092 Bytes - Last Modified: 2021-12-24T06:35:03+00:00
/var/www/docs.ssmods.com/process/src/src/Reports/SideReport/FeaturedProducts.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 | <?php namespace SilverShop\Reports\SideReport; use SilverShop\Page\Product; use SilverStripe\Reports\Report; /** * Shop Side Report classes are to allow quick reports that can be accessed * on the Reports tab to the left inside the SilverStripe CMS. * Currently there are reports to show products flagged as 'FeatuedProduct', * as well as a report on all products within the system. * * @package shop * @subpackage reports */ class FeaturedProducts extends Report { public function title() { return _t('SilverShop\Reports\SideReport.FeaturedProducts', 'Featured Products'); } public function group() { return _t('SilverShop\Reports\SideReport.ShopGroup', 'Shop'); } public function sort() { return 0; } public function sourceRecords($params = null) { return Product::get()->filter('Featured', 1)->sort('Title'); } public function columns() { return [ 'Title' => [ 'title' => 'Title', 'link' => true, ], ]; } } |