Source of file ProductFeedController.php
Size: 1,660 Bytes - Last Modified: 2020-09-08T11:24:27+00:00
/var/www/docs.ssmods.com/process/src/code/controllers/ProductFeedController.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 | <?php class ProductFeedController extends Controller { private static $allowed_actions = [ 'google', 'pricerunner' ]; public function google() { Config::inst()->update('SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader( 'Content-Type', 'application/xml; charset="utf-8"' ); $this->getResponse()->addHeader( 'X-Robots-Tag', 'noindex' ); $items = Product::get()->filter('RemoveFromProductFeed', false)->exclude('ClassName','GiftVoucherProduct'); $this->extend('updateGoogleShoppingFeedItems', $items); return $this->customise(new ArrayData(array( "SiteConfig" => SiteConfig::current_site_config(), 'Items' => $items )))->renderWith("google"); } public function pricerunner() { Config::inst()->update('SSViewer', 'set_source_file_comments', false); $this->getResponse()->addHeader( 'Content-Type', 'application/xml; charset="utf-8"' ); $this->getResponse()->addHeader( 'X-Robots-Tag', 'noindex' ); $items = Product::get()->exclude('ClassName','GiftVoucherProduct'); $this->extend('updatePricerunnerFeedItems', $items); return $this->customise(new ArrayData(array( 'SiteConfig' => SiteConfig::current_site_config(), 'Items' => $items, 'DefaultDelivery' => Config::inst()->get('ProductFeedController', 'DefaultDelivery') )))->renderWith("pricerunner"); } } |