| @@ -15,8 +15,12 @@ | ||
| 15 | 15 | protected $cursor = null; |
| 16 | 16 | |
| 17 | 17 | protected $columns = 4; |
| 18 | 18 | |
| 19 | + protected $hideExcerpt = false; | |
| 20 | + | |
| 21 | + protected $ratingContext = ''; | |
| 22 | + | |
| 19 | 23 | public function __construct($products, $listTitle = null, $wrapperClass = null, $config = []) |
| 20 | 24 | { |
| 21 | 25 | $this->products = $products; |
| 22 | 26 | $this->listTitle = $listTitle; |
| @@ -22,8 +26,10 @@ | ||
| 22 | 26 | $this->listTitle = $listTitle; |
| 23 | 27 | $this->wrapperClass = $wrapperClass; |
| 24 | 28 | $columns = Arr::get($config, 'columns', 4); |
| 25 | 29 | $this->columns = max(1, min(6, intval($columns))); |
| 30 | + $this->hideExcerpt = Arr::get($config, 'hide_excerpt', false); | |
| 31 | + $this->ratingContext = Arr::get($config, 'rating_context', ''); | |
| 26 | 32 | |
| 27 | 33 | if($products instanceof \FluentCart\Framework\Pagination\CursorPaginator){ |
| 28 | 34 | $this->cursor = wp_parse_args(wp_parse_url($products->nextPageUrl(), PHP_URL_QUERY)); |
| 29 | 35 | $this->cursor = Arr::get($this->cursor, 'cursor', ''); |
| @@ -63,9 +69,12 @@ | ||
| 63 | 69 | public function renderProductList() |
| 64 | 70 | { |
| 65 | 71 | |
| 66 | 72 | foreach ($this->products as $index => $product) { |
| 67 | - $config = []; | |
| 73 | + $config = ['hide_excerpt' => $this->hideExcerpt]; | |
| 74 | + if ($this->ratingContext) { | |
| 75 | + $config['rating_context'] = $this->ratingContext; | |
| 76 | + } | |
| 68 | 77 | if($index == 0 && $this->cursor){ |
| 69 | 78 | $config['cursor'] = $this->cursor; |
| 70 | 79 | } |
| 71 | 80 | ?> |