setMetaTitle example

$product->setShippingTime($listProduct->getShippingTime());
        $product->setShortDescription($listProduct->getShortDescription());
        $product->setStock($listProduct->getStock());
        $product->setWeight($listProduct->getWeight());
        $product->setWidth($listProduct->getWidth());
        $product->setPriceGroup($listProduct->getPriceGroup());
        $product->setCreatedAt($listProduct->getCreatedAt());
        $product->setUpdatedAt($listProduct->getUpdatedAt());
        $product->setPriceRules($listProduct->getPriceRules());
        $product->setCheapestPriceRule($listProduct->getCheapestPriceRule());
        $product->setManufacturerNumber($listProduct->getManufacturerNumber());
        $product->setMetaTitle($listProduct->getMetaTitle());
        $product->setTemplate($listProduct->getTemplate());
        $product->setHasConfigurator($listProduct->hasConfigurator());
        $product->setSales($listProduct->getSales());
        $product->setHasEsd($listProduct->hasEsd());
        $product->setEsd($listProduct->getEsd());
        $product->setIsPriceGroupActive($listProduct->isPriceGroupActive());
        $product->setBlockedCustomerGroupIds($listProduct->getBlockedCustomerGroupIds());
        $product->setVoteAverage($listProduct->getVoteAverage());
        $product->setHasAvailableVariant($listProduct->hasAvailableVariant());
        $product->setCheapestUnitPrice($listProduct->getCheapestUnitPrice());
        $product->setFallbackPriceCount($listProduct->getFallbackPriceCount());
        
/** * 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']);
        
$this->customerGroupRegistrationRoute->load($customerGroupId$salesChannelContext)->getRegistration()
        );

        if ($page->getMetaInformation()) {
            $metaDescription = $page->getGroup()->getTranslation('registrationSeoMetaDescription');
            if ($metaDescription) {
                $page->getMetaInformation()->setMetaDescription($metaDescription);
            }

            $title = $page->getGroup()->getTranslation('registrationTitle');
            if ($title) {
                $page->getMetaInformation()->setMetaTitle($title);
            }
        }

        $this->eventDispatcher->dispatch(new CustomerGroupRegistrationPageLoadedEvent($page$salesChannelContext$request));

        return $page;
    }

    public function getDecorated(): AbstractCustomerGroupRegistrationPageLoader
    {
        throw new DecorationPatternException(self::class);
    }
if (!$metaInformation) {
            return;
        }

        $metaDescription = $page->getProduct()->getTranslation('metaDescription')
            ?? $page->getProduct()->getTranslation('description');
        $metaInformation->setMetaDescription((string) $metaDescription);

        $metaInformation->setMetaKeywords((string) $page->getProduct()->getTranslation('keywords'));

        if ((string) $page->getProduct()->getTranslation('metaTitle') !== '') {
            $metaInformation->setMetaTitle((string) $page->getProduct()->getTranslation('metaTitle'));

            return;
        }

        $metaTitleParts = [$page->getProduct()->getTranslation('name')];

        foreach ($page->getSelectedOptions() as $option) {
            $metaTitleParts[] = $option->getTranslation('name');
        }

        $metaTitleParts[] = $page->getProduct()->getProductNumber();

        


        if (isset($data['__manufacturer_name'])) {
            $manufacturer->setName($data['__manufacturer_name']);
        }

        if (isset($data['__manufacturer_description'])) {
            $manufacturer->setDescription($data['__manufacturer_description']);
        }

        if (isset($data['__manufacturer_meta_title'])) {
            $manufacturer->setMetaTitle($data['__manufacturer_meta_title']);
        }

        if (isset($data['__manufacturer_meta_description'])) {
            $manufacturer->setMetaDescription($data['__manufacturer_meta_description']);
        }

        if (isset($data['__manufacturer_meta_keywords'])) {
            $manufacturer->setMetaKeywords($data['__manufacturer_meta_keywords']);
        }

        if (isset($data['__manufacturer_link'])) {
            
$metaDescription = $isHome && $salesChannel->getTranslation('homeMetaDescription')
            ? $salesChannel->getTranslation('homeMetaDescription')
            : $category->getTranslation('metaDescription')
            ?? $category->getTranslation('description');
        $metaInformation->setMetaDescription((string) $metaDescription);

        $metaTitle = $isHome && $salesChannel->getTranslation('homeMetaTitle')
            ? $salesChannel->getTranslation('homeMetaTitle')
            : $category->getTranslation('metaTitle')
            ?? $category->getTranslation('name');
        $metaInformation->setMetaTitle((string) $metaTitle);

        $keywords = $isHome && $salesChannel->getTranslation('homeKeywords')
            ? $salesChannel->getTranslation('homeKeywords')
            : $category->getTranslation('keywords');
        $metaInformation->setMetaKeywords((string) $keywords);
    }
}
$blog->setTitle($data['__blog_title']);
        $blog->setAuthorId($data['__blog_author_id'] !== null ? (int) $data['__blog_author_id'] : null);
        $blog->setActive((bool) $data['__blog_active']);
        $blog->setShortDescription($data['__blog_short_description']);
        $blog->setDescription($data['__blog_description']);
        $blog->setViews((int) $data['__blog_views']);
        $blog->setDisplayDate($data['__blog_display_date'] ? date_create($data['__blog_display_date']) : null);
        $blog->setCategoryId((int) $data['__blog_category_id']);
        $blog->setTemplate($data['__blog_template']);
        $blog->setMetaKeywords($data['__blog_meta_keywords']);
        $blog->setMetaDescription($data['__blog_meta_description']);
        $blog->setMetaTitle($data['__blog_meta_title']);

        if (isset($data['__blogAttribute_id'])) {
            $attributeData = $this->extractFields('__blogAttribute_', $data);
            $attribute = $this->attributeHydrator->hydrate($attributeData);
            $blog->addAttribute('core', $attribute);
        }

        if (isset($data['__blog_tags'])) {
            $blog->setTags(explode(',', $data['__blog_tags']));
        }

        
if ($landingPage->getCmsPage() === null) {
            throw new PageNotFoundException($landingPageId);
        }

        $page = $this->genericPageLoader->load($request$context);
        $page = LandingPage::createFrom($page);

        $page->setLandingPage($landingPage);

        $metaInformation = new MetaInformation();
        $metaTitle = $landingPage->getMetaTitle() ?? $landingPage->getName();
        $metaInformation->setMetaTitle($metaTitle ?? '');
        $metaInformation->setMetaDescription($landingPage->getMetaDescription() ?? '');
        $metaInformation->setMetaKeywords($landingPage->getKeywords() ?? '');
        $page->setMetaInformation($metaInformation);

        $this->eventDispatcher->dispatch(
            new LandingPageLoadedEvent($page$context$request)
        );

        return $page;
    }
}
if (isset($data['__category_description'])) {
            $category->setName($data['__category_description']);
        }

        $category->setParentId((int) $data['__category_parent_id']);

        $category->setPosition((int) $data['__category_position']);

        $category->setProductBoxLayout($data['__category_product_box_layout']);

        if (isset($data['__category_metatitle'])) {
            $category->setMetaTitle($data['__category_metatitle']);
        }

        if (isset($data['__category_metakeywords'])) {
            $category->setMetaKeywords($data['__category_metakeywords']);
        }

        if (isset($data['__category_metadescription'])) {
            $category->setMetaDescription($data['__category_metadescription']);
        }

        if (isset($data['__category_cmsheadline'])) {
            
Home | Imprint | This part of the site doesn't use cookies.