{"id":653,"date":"2020-09-14T11:07:53","date_gmt":"2020-09-14T10:07:53","guid":{"rendered":"https:\/\/www.graphicz.co.uk\/blog\/?p=653"},"modified":"2020-09-14T11:09:28","modified_gmt":"2020-09-14T10:09:28","slug":"add-pricevaliduntil-to-sellerdeck-schema","status":"publish","type":"post","link":"https:\/\/www.graphicz.co.uk\/blog\/add-pricevaliduntil-to-sellerdeck-schema\/","title":{"rendered":"Add &#8220;priceValidUntil&#8221; to Sellerdeck Schema"},"content":{"rendered":"\n<p>Google is increasingly flagging the absence of &#8220;priceValidUntil&#8221; from schema\/microdata. It is easy to solve.<\/p>\n\n\n\n<p>in Sellerdeck v18 open the schema layout and look at the bottom of the layout:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\tif ($MaxPrice > $MinPrice)\n\t{\n\t\techo \"\\\"@type\\\": \\\"AggregateOffer\\\",\", chr(13) , chr(10), \"\\t\\t\", \"\\\"highPrice\\\":\", number_format($MaxPrice,2, '.', ''), \",\", chr(13) , chr(10), \"\\t\\t\", \"\\\"lowPrice\\\":\", number_format($MinPrice,2, '.', ''), \",\";\n\t}&lt;\/actinic:block>\n\t\t\"priceCurrency\": \"&lt;actinic:variable name=\"DefaultIntCurrencySymbol\" selectable=\"false\" \/>\",\n\t\t\"availability\": &lt;actinic:block if=\"%21%3cactinic%3avariable%20name%3d%22IsStockMonitored%22%20%2f%3e%20OR%20%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e\" >\"http&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22SSLUsed%22%20%2f%3e\">s&lt;\/actinic:block>:\/\/schema.org\/InStock\"&lt;\/actinic:block>&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22IsStockMonitored%22%20%2f%3e%20AND%20%21%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e\" >\"http&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22SSLUsed%22%20%2f%3e\">s&lt;\/actinic:block>:\/\/schema.org\/PreOrder\"&lt;\/actinic:block>\n\t}\n}\n&lt;\/script><\/code><\/pre>\n\n\n\n<p>Then add the following on a new line after the &#8220;availability&#8221; line<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\t\t\"url\": \"&lt;actinic:block php=\"true\">echo '&lt;actinic:variable encoding=\"perl\" name=\"SSLCatalogURL\" selectable=\"false\" \/>' . basename('&lt;actinic:variable name=\"ProductPageName\" encoding=\"perl\" selectable=\"false\" \/>');&lt;\/actinic:block>\",\n\t\t\"priceValidUntil\": \"&lt;actinic:block php=\"true\">\n\t\t\t$date = new DateTime();\n\t\t\t$date->add(new DateInterval('P6M'));\n\t\t\techo $date->format('d M Y');\n\t\t&lt;\/actinic:block>\"<\/code><\/pre>\n\n\n\n<p>so it looks like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>if ($MaxPrice > $MinPrice)\n\t{\n\t\techo \"\\\"@type\\\": \\\"AggregateOffer\\\",\", chr(13) , chr(10), \"\\t\\t\", \"\\\"highPrice\\\":\", number_format($MaxPrice,2, '.', ''), \",\", chr(13) , chr(10), \"\\t\\t\", \"\\\"lowPrice\\\":\", number_format($MinPrice,2, '.', ''), \",\";\n\t}&lt;\/actinic:block>\n\t\t\"priceCurrency\": \"&lt;actinic:variable name=\"DefaultIntCurrencySymbol\" selectable=\"false\" \/>\",\n\t\t\"availability\": &lt;actinic:block if=\"%21%3cactinic%3avariable%20name%3d%22IsStockMonitored%22%20%2f%3e%20OR%20%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e\" >\"http&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22SSLUsed%22%20%2f%3e\">s&lt;\/actinic:block>:\/\/schema.org\/InStock\"&lt;\/actinic:block>&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22IsStockMonitored%22%20%2f%3e%20AND%20%21%3cactinic%3avariable%20name%3d%22IsInStock%22%20%2f%3e\" >\"http&lt;actinic:block if=\"%3cactinic%3avariable%20name%3d%22SSLUsed%22%20%2f%3e\">s&lt;\/actinic:block>:\/\/schema.org\/PreOrder\"&lt;\/actinic:block>\n\t\t\"url\": \"&lt;actinic:block php=\"true\">echo '&lt;actinic:variable encoding=\"perl\" name=\"SSLCatalogURL\" selectable=\"false\" \/>' . basename('&lt;actinic:variable name=\"ProductPageName\" encoding=\"perl\" selectable=\"false\" \/>');&lt;\/actinic:block>\",\n\t\t\"priceValidUntil\": \"&lt;actinic:block php=\"true\">\n\t\t\t$date = new DateTime();\n\t\t\t$date->add(new DateInterval('P6M'));\n\t\t\techo $date->format('d M Y');\n\t\t&lt;\/actinic:block>\"\n\t}\n}\n&lt;\/script><\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a class=\"fanncybox\" href=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup.jpg\" rel='magnific'><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i1.wp.com\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup.jpg?fit=550%2C156&amp;ssl=1\" alt=\"\" class=\"wp-image-654\" width=\"550\" height=\"156\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup.jpg 1508w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup-600x170.jpg 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup-1024x291.jpg 1024w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup-300x85.jpg 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup-768x218.jpg 768w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/09\/bottomofschemamarkup-250x71.jpg 250w\" sizes=\"(max-width: 550px) 100vw, 550px\" \/><\/a><\/figure>\n\n\n\n<p>What we are doing is using php to constantly write a date that is six months ahead which is probably a reasonable guess for how long a price will be available for.<\/p>\n\n\n\n<p>You can change it to three months for example by changing (&#8216;P6M&#8217;) into (&#8216;P3M&#8217;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google is increasingly flagging the absence of &#8220;priceValidUntil&#8221; from schema\/microdata. It is easy to solve. in Sellerdeck v18 open the schema layout and look at the bottom of the layout: Then add the following on a new line after the<span class=\"ellipsis\">&hellip;<\/span> <a href=\"https:\/\/www.graphicz.co.uk\/blog\/add-pricevaliduntil-to-sellerdeck-schema\/\"><\/p>\n<div class=\"read-more\"><b>Read more &#8250;<\/b><\/div>\n<p><!-- end of .read-more --><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-653","post","type-post","status-publish","format-standard","hentry","category-graphicz-articles"],"_links":{"self":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/653"}],"collection":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":3,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/653\/revisions\/657"}],"wp:attachment":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}