/** * @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()]; }
public function getAttachments() { $post = $this->wp->getGlobalPost(); /** @var \Jigoshop\Entity\Product $product */ $product = $this->productService->findForPost($post); return $this->productService->getAttachments($product); }
/** * @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'])); }