setHasProperties example

/** * Helper function which assigns the shopware article * data to the product. (data of s_articles) */
    private function assignProductData(ListProduct $product, array $data): void
    {
        $product->setName($data['__product_name']);
        $product->setShortDescription($data['__product_description']);
        $product->setLongDescription($data['__product_description_long']);
        $product->setCloseouts((bool) $data['__product_laststock']);
        $product->setMetaTitle($data['__product_metaTitle']);
        $product->setHasProperties($data['__product_filtergroupID'] > 0);
        $product->setHighlight((bool) $data['__product_topseller']);
        $product->setAllowsNotification((bool) $data['__product_notification']);
        $product->setKeywords($data['__product_keywords']);
        $product->setTemplate($data['__product_template']);
        $product->setHasConfigurator($data['__product_configurator_set_id'] > 0);
        $product->setHasEsd((bool) $data['__product_has_esd']);
        $product->setIsPriceGroupActive((bool) $data['__product_pricegroupActive']);
        $product->setSales((int) $data['__topSeller_sales']);
        $product->setShippingFree((bool) $data['__variant_shippingfree']);
        $product->setStock((int) $data['__variant_instock']);
        $product->setManufacturerNumber($data['__variant_suppliernumber']);
        
Home | Imprint | This part of the site doesn't use cookies.