<?php

namespace Drupal\basket;

class ViewsCartAlters{
	/*
		viewsViewAlter
	*/
	public function viewsViewAlter(&$vars){
		$vars['attributes']['data-cartid'] = 'view_wrap-'.$vars['view']->id().'-'.$vars['view']->current_display;
		if(empty($vars['view']->result)){
			$vars['empty'][] = [
				'#theme'		=> 'basket_views_cart_empty'
			];
		}
	}
}