# promotions/view\.php

## Convenio

Este template contiene los datos de un convenio asociado al tipo de cliente del usuario.

| Objetos disponibles  | Descripción                                                     |
| -------------------- | --------------------------------------------------------------- |
| $\_userTypePromotion | Convenio seleccionado.                                          |
| $\_orders            | Array de pedidos del cliente en los que se utilizó el convenio. |
| $\_availableDaily    | Límite diario disponible.                                       |
| $\_availableWeekly   | Límite semanal disponible.                                      |
| $\_availableMonthly  | Límite mensual disponible.                                      |

{% hint style="info" %}
Para visualizar este template el usuario debe estar autenticado
{% endhint %}

#### Código de ejemplo

{% code title="promotions/view\.php" %}

```php
<section id="confirmation">

	<h1>Detalle del convenio</h1>
	<p>Obtiene hasta <?=($_userTypePromotion->get('priceType') == 0 ? $_front->price($_userTypePromotion->get('priceValue')) : $_userTypePromotion->get('priceValue').'%')?> de descuento en tus compras.</p>
	
	<div class="clearfix">

		<div class="address">
		
			<h2>Productos</h2>
			
			<?php foreach($_userTypePromotion->get('products') as $product): ?>
			<p><a href="<?=$product->get('product')->getURL()?>"><?=$product->get('product')->get('name')?></a></p>
			<?php endforeach; ?></p>
			
		</div>	
	
		<div class="address">
		
			<h2>Fabricantes</h2>
			
			<?php foreach($_userTypePromotion->get('manufacturers') as $manufacturer): ?>
			<p><a href="<?=$manufacturer->get('manufacturer')->getURL()?>"><?=$manufacturer->get('manufacturer')->get('name')?></a></p>
			<?php endforeach; ?></p>
			
		</div>
	
		<div class="address">
		
			<h2>Tus pedidos</h2>
			
			<?php foreach($_orders as $order): ?>
			<p><a href="<?=$order->getURL()?>"><?=$order->getId()?></a></p>
			<?php endforeach; ?></p>
			
		</div>
		
	</div>

	
</section>
```

{% endcode %}
