Ejemplo n.º 1
0
 /**
  * @param Product $product Product to find attachments for.
  * @param string $size Size for images.
  * @return array List of attachments attached to the product.
  */
 public function getAttachments(Product $product, $size = Options::IMAGE_THUMBNAIL)
 {
     if (!isset($this->attachments[$product->getId()])) {
         $this->attachments[$product->getId()] = $this->service->getAttachments($product, $size);
     }
     return $this->attachments[$product->getId()];
 }
Ejemplo n.º 2
0
 public function getAttachments()
 {
     $post = $this->wp->getGlobalPost();
     /** @var \Jigoshop\Entity\Product $product */
     $product = $this->productService->findForPost($post);
     return $this->productService->getAttachments($product);
 }
Ejemplo n.º 3
0
 /**
  * @param $currentTab string Current tab name.
  * @param $product    \Jigoshop\Entity\Product Shown product.
  */
 public function productDownloads($currentTab, $product)
 {
     Render::output('shop/product/downloads', array('product' => $product, 'currentTab' => $currentTab, 'attachments' => $this->productService->getAttachments($product)['downloads']));
 }