Announcement

Collapse
No announcement yet.

ReadyTheme Rich Snippets Code Deprecated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Here is the boilerplate JSON-LD data which will be included in the next version of Shadows. You may need to make changes to it based on your site and how you sell your products, so this may not work 100% as cut-n-paste. These steps are designed around using JavaScript Resources. This code passes with only warnings for items like reviews and how long the price is good for which you can add if you are using.

    To add this to your site:
    1. Navigate to User Interface -> JavaScript Resources
    2. Click "Add JavaScript Resource"
    3. Enter code "product-json-ld"
    4. Select "Inline Script"
    5. Click "Edit" for the tag attributes
    6. Change the "Value" to "application/ld+json"
    7. Turn off "Global" for this resource
    8. Click "Save"
    9. Click "Pages" and select "PROD"
    10. Click "Resource Groups" and select "footer_js"
    11. Click "Edit Source" and paste in the following code:
    Code:
    <mvt:assign name="l.settings:product:stripped_descrip" value="miva_html_strip(l.settings:product:descrip, '')"/>
    {
        "@context": "http://schema.org",
        "@type": "Product",
        "name": "&mvtj:product:name;",
        "image": "&mvt:global:socialImage;",
        "description": "&mvtj:product:stripped_descrip;",
        <mvt:if expr="NOT ISNULL l.settings:product:sku">
            "sku": "&mvtj:product:sku;",
            "mpn": "&mvtj:product:sku;",
        <mvt:else>
            "sku": "&mvtj:product:code;",
            "mpn": "&mvtj:product:code;",
        </mvt:if>
        "category": "&mvtj:category:name;",
        "brand": {
            "@type": "Thing",
            <mvt:if expr="NOT ISNULL l.settings:product:customfield_values:customfields:brand">
                "name": "&mvtj:product:customfield_values:customfields:brand;"
            <mvt:else>
                "name": "&mvtj:global:store:name;"
            </mvt:if>
        },
        "offers": {
            "@type": "Offer",
            "url": "&mvtj:product:link;",
            <mvt:if expr="NOT ISNULL l.settings:product:sku">
                "sku": "&mvtj:product:sku;",
            <mvt:else>
                "sku": "&mvtj:product:code;",
            </mvt:if>
            "name": "&mvtj:product:name;",
            "description": "&mvtj:product:stripped_descrip;",
            "seller": "&mvtj:global:store:name;",
            "itemCondition": "new",
            <mvt:if expr="l.availability_inv_level EQ 'low'">
                "availability": "http://schema.org/LimitedAvailability",
            <mvt:elseif expr="l.availability_inv_level EQ 'out'">
                "availability": "http://schema.org/OutOfStock",
            <mvt:else>
                "availability": "http://schema.org/InStock",
            </mvt:if>
            <mvt:if expr="l.settings:attributemachine:product:inv_level">
                <mvt:assign name="l.availability_inv_level" value="l.settings:attributemachine:product:inv_level"/>
                <mvt:do name="l.formatted_variant_price" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:attributemachine:product:price )" />
                "price": "&mvtj:attributemachine:product:price;",
            <mvt:else>
                <mvt:assign name="l.availability_inv_level" value="l.settings:product:inv_level"/>
                "price": "&mvtj:product:price;",
            </mvt:if>
            "priceCurrency": "USD"
        }
    }
    Matt Zimmermann
    Front-End Development Director / Miva, Inc.

    Comment


      #32
      Not really knowing much about adding JSON-LD data I followed the steps up to step 10 then on Step 11 I do not see "Edit Source"...

      I see buttons for CSS Resources and JavaScript Resources so am I not looking in the right place?

      Comment


        #33
        If you have the product-json-ld script selected, you should see Edit Source as the fifth button between the trash can and Edit Attributes.
        Matt Zimmermann
        Front-End Development Director / Miva, Inc.

        Comment


          #34
          Things are fine until:
          • Click "Pages" and select "PROD"
          • Click "Resource Groups" and select "footer_js"
          I see nothing how to "have the product-json-ld script selected" and no Edit Source

          I'll see if I can post a screenshot or attach an image...



          Here is the image on my OneDrive:

          https://1drv.ms/u/s!AlzCDddLSsKoghYV...tvrFz?e=LDs0Ln




          Comment


            #35
            Go back to JavaScript Resources, click product-json-ld, and you will be able to proceed.
            Matt Zimmermann
            Front-End Development Director / Miva, Inc.

            Comment


              #36
              I see... I will wait until the wee hours since this store gets quite a bit of North America traffic until 2-3AM.

              That was not obvious to me but I dn't know much about what all this means so maybe you will adjust your Steps :-)

              Comment


                #37
                Hi Leslie,

                Yes, create the resource group and add the item, <mvt:item name="head" param="footer_js" />, to the bottom of the PROD page. Alternately, you can add that to the global footer for future expansion.
                Matt Zimmermann
                Front-End Development Director / Miva, Inc.

                Comment


                  #38
                  Why would the following snippet only render the same value in PROD source: "availability": "http://schema.org/InStock",?

                  Code:
                  <mvt:if expr="l.availability_inv_level EQ 'low'">
                      "availability": "http://schema.org/LimitedAvailability",
                  <mvt:elseif expr="l.availability_inv_level EQ 'out'">
                      "availability": "http://schema.org/SoldOut",
                  <mvt:else>
                      "availability": "http://schema.org/InStock",
                  </mvt:if>
                  Finally, both of these "tokens" render the same values, whats the difference between the two tokens?

                  Code:
                  &mvte:product:code;
                   &mvtj:product:code;
                  Last edited by William Davis; 04-30-20, 01:00 PM.
                  Thank you, Bill Davis

                  Comment


                    #39
                    the if should probably be l.settings:availability_inv_level and EQ means the must match exactly. make sure they actual terms are low and out and not Low and Out
                    Bruce Golub
                    Phosphor Media - "Your Success is our Business"

                    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                    phosphormedia.com

                    Comment


                      #40
                      Originally posted by Bruce - PhosphorMedia View Post
                      the if should probably be l.settings:availability_inv_level and EQ means the must match exactly. make sure they actual terms are low and out and not Low and Out
                      Dont understand what you meant.
                      Thank you, Bill Davis

                      Comment


                        #41
                        Matt Zimmermann how to you include attribute prices?
                        Leslie Kirk
                        Miva Certified Developer
                        Miva Merchant Specialist since 1997
                        Previously of Webs Your Way
                        (aka Leslie Nord leslienord)

                        Email me: [email protected]
                        www.lesliekirk.com

                        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                        Comment


                          #42
                          Hi Leslie,

                          This is the way I am doing it with Shadows v2:
                          • Create a JavaScript Resource
                            • Code: product-json-ld
                            • Type: Inline Script
                            • Tag Attributes: type="application/ld+json"
                            • Global: Off
                            • Active: On
                          • Assign it to the PROD page
                          • Assign it to the footer_js Resource Group
                          • Edit the source and paste in the code from here: https://gist.github.com/influxweb/ff...f96eeb8039ab5b
                          Matt Zimmermann
                          Front-End Development Director / Miva, Inc.

                          Comment


                            #43
                            Originally posted by Matt Zimmermann View Post
                            Hi Leslie,

                            This is the way I am doing it with Shadows v2:
                            • Create a JavaScript Resource
                              • Code: product-json-ld
                              • Type: Inline Script
                              • Tag Attributes: type="application/ld+json"
                              • Global: Off
                              • Active: On
                            • Assign it to the PROD page
                            • Assign it to the footer_js Resource Group
                            • Edit the source and paste in the code from here: https://gist.github.com/influxweb/ff...f96eeb8039ab5b
                            That's what I already have in place - does the code require that Inventory Variants be used? The site doesn't.
                            Leslie Kirk
                            Miva Certified Developer
                            Miva Merchant Specialist since 1997
                            Previously of Webs Your Way
                            (aka Leslie Nord leslienord)

                            Email me: [email protected]
                            www.lesliekirk.com

                            Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                            Comment


                              #44
                              Hi Leslie,

                              Yes, otherwise it just uses the product price.
                              Matt Zimmermann
                              Front-End Development Director / Miva, Inc.

                              Comment


                                #45
                                Originally posted by Matt Zimmermann View Post
                                Hi Leslie,

                                This is the way I am doing it with Shadows v2:
                                • Create a JavaScript Resource
                                  • Code: product-json-ld
                                  • Type: Inline Script
                                  • Tag Attributes: type="application/ld+json"
                                  • Global: Off
                                  • Active: On
                                • Assign it to the PROD page
                                • Assign it to the footer_js Resource Group
                                • Edit the source and paste in the code from here: https://gist.github.com/influxweb/ff...f96eeb8039ab5b
                                I've got an issue with the "description": "&mvtj:product:stripped_descrip;", being blank for every product. Every product has content in the Product Description field.

                                Leslie Kirk
                                Miva Certified Developer
                                Miva Merchant Specialist since 1997
                                Previously of Webs Your Way
                                (aka Leslie Nord leslienord)

                                Email me: [email protected]
                                www.lesliekirk.com

                                Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

                                Comment

                                Working...
                                X