@loop
I'm busy looking into this as well, but not getting any further with this and will need some help
I have seen Burt's comment about shipping, currently free shipping or fixed shipping can do
I'm getting 2 errors for
merchant listings(snippets part 100% correct)
1: missing field "delivery time"
2: Either "returnFees" or "returnShippingFeesAmount" should be specified (optional)
Not to sure what is missing required to get 100% going
Obviously this settings needs customization to your own store and country.
Code: Select all
// Added NewCondition - all items is new
$schema_product['offers']['itemCondition'] = 'https://schema.org/NewCondition';
$schema_product['offers']['shippingDetails'] = [
'@type' => 'OfferShippingDetails',
'shippingRate' => [
'@type' => 'MonetaryAmount',
'value' => '0',
'currency' => 'ZAR',
],
'shippingDestination' => [
'@type' => 'DefinedRegion',
'addressCountry' => 'ZA',
],
];
$schema_product['offers']['deliveryTime'] = [
'@type' => 'ShippingDeliveryTime',
'handlingTime' => [
'@type' => 'QuantitativeValue',
'minValue' => '0',
'maxValue' => '1',
'unitCode' => 'DAY',
],
'transitTime' => [
'@type' => 'QuantitativeValue',
'minValue' => '1',
'maxValue' => '5',
'unitCode' => 'DAY',
],
];
$schema_product['offers']['seller'] = [
'@type' => 'Organization',
'name' => STORE_NAME,
];
$schema_product['offers']['hasMerchantReturnPolicy'] = [
'@type' => 'MerchantReturnPolicy',
'applicableCountry' => 'ZA',
'returnPolicyCategory' => 'MerchantReturnFiniteReturnWindow',
'merchantReturnDays' => '14',
'returnMethod' => 'ReturnInStore',
// 'returnFees' => 'ReturnFeesCustomerResponsibility',
];
And reviews was also complaining about author so i did this to solved it
Code: Select all
$schema_product['review'] = [];
foreach ($product->get('reviews') as $review) {
$schema_product['review'][] = [
'@type' => 'Review',
// 'author' => htmlspecialchars($review['customers_name']),
'datePublished' => htmlspecialchars($review['date_added']),
'description' => htmlspecialchars($review['text']),
// 'name' => htmlspecialchars($product->get('name')),
'author' => [
'@type' => 'Person',
'name' => htmlspecialchars($review['customers_name']),
],
'reviewRating' => [
'@type' => 'Rating',
'bestRating' => '5',
'ratingValue' => (int)$review['rating'],
'worstRating' => '1',
],
];
Also normal products now requires priceValidUntil
Code: Select all
$schema_product['offers']['price'] = $product->format_raw();
$date = date('Y-m-d');
$nextweek = date('Y-m-d',strtotime('+7 day',strtotime($date)));
$schema_product['offers']['priceValidUntil'] = $nextweek;