<?php
namespace front\Views;

class ShopProduct
{
  public static function productUrl( $product )
  {
    if ( $product['language']['seo_link'] )
    {
      return '/' . $product['language']['seo_link'];
    }

    if ( $product['parent_id'] )
      return '/p-' . $product['parent_id'] . '-' . \Shared\Helpers\Helpers::seo( $product['language']['name'] );

    return '/p-' . $product['id'] . '-' . \Shared\Helpers\Helpers::seo( $product['language']['name'] );
  }
}
