We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi i have like this json
{ "@context": "https://schema.org/", "@type": "Product", "name": "Extra", "image": "https://www..jpg", "category": [ "category", ], "description": "This Stun", "SKU": "11111", "Offers": { "@type": "Offer", "priceCurrency": "GBP", "price": "509.99", "itemcondition": "http://schema.org/NewCondition", "availability": "https://schema.org/PreOrder", "url": "https://www." }, }
I try to get offers but immutableName wrong and i get error OutOfBoundsException|
if i change manually Offers to offers all works
change json i cant it external and use like this i think bad idea str_replace("Offers", "offers", "json") because json on HTML page
str_replace("Offers", "offers", "json")
What else can I do?
The text was updated successfully, but these errors were encountered:
Can you provide us with a code snippet that demonstrates the problem?
Sorry, something went wrong.
@rvanlaak
use Jkphl\Micrometa\Ports\Parser; $html = " { "@context": "https://schema.org/", "@type": "Product", "name": "Extra", "image": "https://www..jpg", "category": [ "category", ], "description": "This Stun", "SKU": "11111", "Offers": { "@type": "Offer", "priceCurrency": "GBP", "price": "509.99", "itemcondition": "http://schema.org/NewCondition", "availability": "https://schema.org/PreOrder", "url": "https://www." }, } " $url = 'https://example.com'; $parser = new Parser(); $parsed = $parser($url, $html); foreach ($parsed->getItems() as $item) { /** @var \Jkphl\Micrometa\Domain\Item\Iri[] $types */ $types = $item->getType(); foreach ($types as $type) { if ($type->name === 'Product') { $offers = $this->getPropertyValue($item, 'offers'); } } }
Cant find offers because https://schema.org/offers lover case and parser not correct set immutableName and got error OutOfBoundsException
No branches or pull requests
Hi i have like this json
I try to get offers but immutableName wrong and i get error OutOfBoundsException|
if i change manually Offers to offers all works
change json i cant it external and use like this i think bad idea
str_replace("Offers", "offers", "json")
because json on HTML pageWhat else can I do?
The text was updated successfully, but these errors were encountered: