setComingSoon example

$attribute->setIsNew(false);

        if ($product->getCreatedAt() instanceof DateTimeInterface) {
            $diff = $today->diff($product->getCreatedAt());
            $marker = (int) $this->config->get('markAsNew');

            $attribute->setIsNew(
                $diff->days <= $marker || $product->getCreatedAt() > $today
            );
        }

        $attribute->setComingSoon(
            $product->getReleaseDate() && $product->getReleaseDate() > $today
        );

        $attribute->setIsTopSeller(
            $product->getSales() >= $this->config->get('markAsTopSeller')
        );

        return $attribute;
    }
}
Home | Imprint | This part of the site doesn't use cookies.