json-ld icon indicating copy to clipboard operation
json-ld copied to clipboard

Support for AggregateOffer is missing

Open madman-81 opened this issue 4 years ago • 0 comments

AggregateOffer (https://schema.org/AggregateOffer) isn't supported and result in a normal Offer. Could this be added?

        return Context::create('product', [
            'name' => 'some name',
            'image' => [
                'https://site.com/image1.png',
                'https://site.com/image2.png'
            ],
            'description' => 'some description',
            'brand' => [
                '@type' => 'Brand',
                'name' => 'Awesome brand'
            ],
            'offers' => [
                '@type' => 'AggregateOffer',
                'offerCount' => 3,
                'lowPrice' => 100,
                'highPrice' => 200,
                'priceCurrency' => 'EUR'
            ]
        ]);

Expected:

{"@context":"http:\/\/schema.org","@type":"Product","name":"some name","description":"some description","brand":{"@type":"Brand","name":"Awesome brand"},"image":["https:\/\/site.com\/image1.png","https:\/\/site.com\/image2.png"],
"offers":{
    "@type":"AggregateOffer",
    "offerCount": "3",
    "lowPrice": "100",
    "highPrice": "200",
    "priceCurrency":"EUR"
}
}

Actual:

{"@context":"http:\/\/schema.org","@type":"Product","name":"some name","description":"some description","brand":{"@type":"Brand","name":"Awesome brand"},"image":["https:\/\/site.com\/image1.png","https:\/\/site.com\/image2.png"],
"offers":{
    "@type":"Offer",
    "priceCurrency":"EUR"
}
}

madman-81 avatar Dec 03 '21 16:12 madman-81