Exemplo n.º 1
0
 /**
  * Resolve view given the purchasable instance
  *
  * @param PurchasableInterface $purchasable Purchasable
  *
  * @return string template name
  */
 private function resolveTemplateName(PurchasableInterface $purchasable)
 {
     if ($purchasable instanceof ProductInterface) {
         return $purchasable->hasVariants() ? 'Pages:product-view-variant.html.twig' : 'Pages:product-view-item.html.twig';
     }
     if ($purchasable instanceof PackInterface) {
         return 'Pages:purchasable-pack-view.html.twig';
     }
     return '';
 }