Skip to content

[5.x] - Fix product structured data on PDP - #1302

Merged
royduin merged 9 commits into
masterfrom
feature/pdp-rich-snippets
Nov 18, 2026
Merged

royduin merged 9 commits into
masterfrom
feature/pdp-rich-snippets

Conversation

@JimmyHoenderdaal

@JimmyHoenderdaal JimmyHoenderdaal commented Jun 2, 2026 •

Copy link
Copy Markdown
Member

This adds some extra microdata inside the schema Offer:
<meta itemprop="itemCondition" content="https://schema.org/NewCondition" />
priceValidUntil

Both are recommended to add inside the schema.

Internal ref: RAP-1899

Jade-GG
Jade-GG previously approved these changes Jun 10, 2026
@Roene-JustBetter Roene-JustBetter changed the title fix product structured data on pdp [5.x] - Fix product structured data on PDP Jul 22, 2026
@Roene-JustBetter
Roene-JustBetter marked this pull request as draft September 29, 2026 12:43
@indykoning indykoning mentioned this pull request Nov 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have double checked this f2f with @indykoning to check if change is correct. Short explain from Claude:
When you read $product->special_to_date, the value() accessor runs:

  1. rawValue casts the database string to a Carbon object, because AttributeDatetime casts value to datetime.
  2. value() then calls collect($value) so it can handle single and multiple values the same way.
  3. This is where it went wrong. collect() turns anything JsonSerializable into its JSON form, and Carbon is JsonSerializable. So the Carbon became the string "2030-01-01T00:00:00.000000Z".
  4. The ! is_string() check from Only escape strings #1446 runs after that, so it only ever saw a string. The fix never applied to dates.

The change: Arr::wrap() turns a single value like Carbon into [$carbon] without changing it. Arrays and Collections are still passed to collect() as before. The Carbon now reaches the #1446 check unchanged, so you get a real date object back and ->isFuture() and ->format() work in the template.

@Roene-JustBetter
Roene-JustBetter marked this pull request as ready for review November 17, 2026 15:09
@royduin
royduin merged commit 583c6f6 into master Nov 18, 2026
27 checks passed
@royduin
royduin deleted the feature/pdp-rich-snippets branch November 18, 2026 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants