plugin updates

This commit is contained in:
Tony Volpe
2024-09-17 10:43:54 -04:00
parent 44b413346f
commit b7c8882c8c
1359 changed files with 58219 additions and 11364 deletions

View File

@@ -214,6 +214,12 @@ class WC_Structured_Data {
$markup['sku'] = $product->get_id();
}
// Add GTIN only if it's a valid number.
$gtin = $product->get_global_unique_id();
if ( $gtin && is_numeric( $gtin ) ) {
$markup['gtin'] = $gtin;
}
if ( '' !== $product->get_price() ) {
// Assume prices will be valid until the end of next year, unless on sale and there is an end date.
$price_valid_until = gmdate( 'Y-12-31', time() + YEAR_IN_SECONDS );