public ProductDraftDsl withMetaDescription(@Nullable final LocalizedString metaDescription) { return newBuilder().metaDescription(metaDescription).build(); }
.description(description) .metaTitle(metaTitle) .metaDescription(metaDescription) .metaKeywords(metaKeywords) .categories(categories)
@Override public ProductDraft get() { final ProductVariantDraft masterVariant = ProductVariantDraftBuilder.of() .attributes(Sizes.ATTRIBUTE.draftOf(Sizes.S), Colors.ATTRIBUTE.draftOf(Colors.GREEN)) .sku(UUID.randomUUID().toString()) .build(); final LocalizedString slug = en(name).slugifiedUnique(); return ProductDraftBuilder.of(productType, en(name), slug, masterVariant) .description(en(name)) .metaTitle(en("cotton t-shirt")) .metaDescription(en("cotton t-shirt description")) .metaKeywords(en("cotton, t-shirt, clothes")) .build(); }
@Override public ProductDraft get() { final ProductVariantDraft masterVariant = ProductVariantDraftBuilder.of() .attributes(Sizes.ATTRIBUTE.draftOf(Sizes.S), Colors.ATTRIBUTE.draftOf(Colors.GREEN)) .sku(UUID.randomUUID().toString()) .prices(PriceDraft.of(MoneyImpl.ofCents(1234, EUR))) .build(); final ProductVariantDraft secondVariant = ProductVariantDraftBuilder.of() .attributes(Sizes.ATTRIBUTE.draftOf(Sizes.M), Colors.ATTRIBUTE.draftOf(Colors.GREEN)) .sku(UUID.randomUUID().toString()) .prices(PriceDraft.of(MoneyImpl.ofCents(1234, EUR)), PriceDraft.of(MoneyImpl.ofCents(600, EUR)).withCustomerGroup(customerGroup)) .build(); final LocalizedString slug = en(name).slugifiedUnique(); return ProductDraftBuilder.of(productType, en(name), slug, masterVariant) .variants(asList(secondVariant)) .description(en(name)) .metaTitle(en("cotton t-shirt")) .metaDescription(en("cotton t-shirt description")) .metaKeywords(en("cotton, t-shirt, clothes")) .build(); }