isCloseouts example

$product->setMainVariantId($listProduct->getMainVariantId());
        $product->setAllowsNotification($listProduct->allowsNotification());
        $product->setHighlight($listProduct->highlight());
        $product->setUnit($listProduct->getUnit());
        $product->setTax($listProduct->getTax());
        $product->setPrices($listProduct->getPrices());
        $product->setManufacturer($listProduct->getManufacturer());
        $product->setCover($listProduct->getCover());
        $product->setCheapestPrice($listProduct->getCheapestPrice());
        $product->setName($listProduct->getName());
        $product->setAdditional($listProduct->getAdditional());
        $product->setCloseouts($listProduct->isCloseouts());
        $product->setEan($listProduct->getEan());
        $product->setHeight($listProduct->getHeight());
        $product->setKeywords($listProduct->getKeywords());
        $product->setLength($listProduct->getLength());
        $product->setLongDescription($listProduct->getLongDescription());
        $product->setMinStock($listProduct->getMinStock());
        $product->setReleaseDate($listProduct->getReleaseDate());
        $product->setShippingTime($listProduct->getShippingTime());
        $product->setShortDescription($listProduct->getShortDescription());
        $product->setStock($listProduct->getStock());
        $product->setWeight($listProduct->getWeight());
        

    }

    /** * Creates the settings array for the passed configurator set * * @return array */
    public function getConfiguratorSettings(ConfiguratorSet $set, ListProduct $product)
    {
        $settings = [
            'instock' => $product->isCloseouts(),
            'articleID' => $product->getId(),
            'type' => $set->getType(),
            'attributes' => $set->getAttributes(),
        ];

        if ($set->hasAttribute('core')) {
            $data['attribute'] = $set->getAttribute('core');
        }

        // Switch the template for the different configurator types.         if ($set->getType() == 1) {
            

    public function getStock()
    {
        return $this->stock;
    }

    /** * @return bool */
    public function isAvailable()
    {
        if (!$this->isCloseouts()) {
            return true;
        }

        return $this->getStock() >= $this->getUnit()->getMinPurchase();
    }

    /** * @param float $weight */
    public function setWeight($weight)
    {
        
Home | Imprint | This part of the site doesn't use cookies.