: How to mark up acceptable payment methods for a Schema.org Offer with Microdata? I am not sure how to markup accepted payment methods for an offer. Here are the Schema.org types: Offer PaymentMethod
I am not sure how to markup accepted payment methods for an offer.
Here are the Schema.org types:
Offer
PaymentMethod
Here is my basic example, is this correct?
<div itemscope="" itemtype="http://schema.org/Product">
<span itemprop="name">Product Name</span>
<span itemprop="description">Product Description</span>
<div itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
<span itemprop="price">.95</span>
<meta itemprop="priceCurrency" content="USD" />
<meta itemprop="availability" content="in_stock" />
<a href="/buy-now" itemprop="url">Buy Now</a>
<meta itemprop="acceptedPaymentMethod" content="http://purl.org/goodrelations/v1#PayPal" />
<meta itemprop="acceptedPaymentMethod" content=" purl.org/goodrelations/v1#PaymentMethodCreditCard />
</div>
</div>
More posts by @Pierce454
2 Comments
Sorted by latest first Latest Oldest Best
About your HTML:
You can (and should) use semantic markup, of course. So, for example, the product container should probably be an article instead of a div, and the "Product Name" should probably be an h1 instead of span.
Like Martin Hepp writes also, you have to use link instead of meta if the value is a URI.
About your Schema.org:
The price property should not contain the currency symbol.
The availability property expects an ItemAvailability enumeration value, which would be schema.org/InStock in your case (used in a link element).
Unless "/buy-now" is really a page for/about the Offer, you should probably not use url for it. If it’s a buy button, you could use BuyAction instead.
So the example could look like:
<article itemscope="" itemtype="http://schema.org/Product">
<h1 itemprop="name">Product Name</h1>
<p itemprop="description">Product Description</p>
<div itemprop="offers" itemscope="" itemtype="http://schema.org/Offer">
$<span itemprop="price">19.95</span>
<meta itemprop="priceCurrency" content="USD" />
<link itemprop="availability" href="http://schema.org/InStock" />
<div itemprop="potentialAction" itemscope="" itemtype="http://schema.org/BuyAction">
<a itemprop="target" href="/buy-now">Buy Now</a>
</div>
<link itemprop="acceptedPaymentMethod" href="http://purl.org/goodrelations/v1#PayPal" />
<link itemprop="acceptedPaymentMethod" href="http://purl.org/goodrelations/v1#PaymentMethodCreditCard" />
</div>
</article>
The basic direction is correct, but you must use <link> and href=... instead of meta, since the value is a URL/URI, not a string:
<link itemprop="acceptedPaymentMethod" href="http://purl.org/goodrelations/v1#PayPal" />
<link itemprop="acceptedPaymentMethod" href=" purl.org/goodrelations/v1#PaymentMethodCreditCard />
The rest looks fine at first sight.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.