| @@ 16-26 (lines=11) @@ | ||
| 13 | { |
|
| 14 | $url = htmlspecialchars(Url::toRoute(['@product', 'model' => $event->model])); |
|
| 15 | $image = htmlspecialchars($event->model->image->getOriginalUrl()); |
|
| 16 | if ($event->model->unlimited_count === 1) { |
|
| 17 | $inStock = 'in stock'; |
|
| 18 | } else { |
|
| 19 | $inStock = 'out of stock'; |
|
| 20 | foreach ($event->model->getWarehousesState() as $warehouse) { |
|
| 21 | if ($warehouse->in_warehouse > 0) { |
|
| 22 | $inStock = 'in stock'; |
|
| 23 | break; |
|
| 24 | } |
|
| 25 | } |
|
| 26 | } |
|
| 27 | ||
| 28 | $price = number_format( |
|
| 29 | CurrencyHelper::convertCurrencies($event->model->price, $event->model->currency, |
|
| @@ 56-66 (lines=11) @@ | ||
| 53 | { |
|
| 54 | $url = htmlspecialchars(Url::toRoute(['@product', 'model' => $product])); |
|
| 55 | $image = htmlspecialchars($product->image->getOriginalUrl()); |
|
| 56 | if ($product->unlimited_count === 1) { |
|
| 57 | $inStock = 'in stock'; |
|
| 58 | } else { |
|
| 59 | $inStock = 'out of stock'; |
|
| 60 | foreach ($product->getWarehousesState() as $warehouse) { |
|
| 61 | if ($warehouse->in_warehouse > 0) { |
|
| 62 | $inStock = 'in stock'; |
|
| 63 | break; |
|
| 64 | } |
|
| 65 | } |
|
| 66 | } |
|
| 67 | $price = number_format( |
|
| 68 | CurrencyHelper::convertCurrencies($product->price, $product->currency, $this->mainCurrency), |
|
| 69 | 2, |
|