VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: marvays on March 02, 2021, 06:36:00 AM

Title: The code does not match the entry
Post by: marvays on March 02, 2021, 06:36:00 AM
Why does joomla or Virtuemart display a different code on the site than the one written?

Editing description in category VM. I want to add microdata for FAQ. I have the code set correctly. But the web will change a bit for me.

I have saved:
<h3 itemprop="name">XXX?</h3>

In the web code I see:
<h3 >XXX?</h3>

Something will delete itemprop = "name" from <h3>.
I have the JCE editor turned off.


https://search.google.com/test/rich-results?id=wObzYi3K9bMjlJtY6P6Fbw (https://search.google.com/test/rich-results?id=wObzYi3K9bMjlJtY6P6Fbw)
Title: Re: The code does not match the entry
Post by: Jörgen on March 02, 2021, 07:40:56 AM
I would try without the Quix editor.

Jörgen
Title: Re: The code does not match the entry
Post by: marvays on March 02, 2021, 08:29:29 AM
I see. I don't use the Quix editor, but I'll try to turn it off hard to save. One never knows. Maybe it can really have an effect.
Title: Re: The code does not match the entry
Post by: marvays on March 02, 2021, 08:34:38 AM
Quote from: Jörgen on March 02, 2021, 07:40:56 AM
I would try without the Quix editor.

Jörgen
No. I turned off all extensions containing the word Quix completely, and the problem still exists. it will be something else. I guess I have to turn it off and keep trying.
Title: Re: The code does not match the entry
Post by: Jörgen on March 02, 2021, 09:16:53 AM
Is the saved data in your VM/jommla html correct ? If it is, some jscript based cleaning is done when the code is put on your web.

Jörgen
Title: Re: The code does not match the entry
Post by: marvays on March 02, 2021, 09:26:39 AM
I see everything in the administration as I wrote it down. Even if I save and reopen it, I always see it correctly. just an frontend it's different.
Title: Re: The code does not match the entry
Post by: Jörgen on March 02, 2021, 09:29:14 AM
Then I guess that there is some plugin that tinkers with the code at time of rendering. Do You have some extension for rich snippets ?

Jörgen

Title: Re: The code does not match the entry
Post by: marvays on March 02, 2021, 09:36:16 AM
Yes. tassos.gr. . . but I've already tried to turn everything off. It did not help.
Title: Re: The code does not match the entry
Post by: Jörgen on March 02, 2021, 10:33:22 AM
I have tried this in both product and category description. I can not see Your behaviour.
Have You cleared cache between tests ?

Fumbling in the dark here. Are You showing several categories on the same page ? All with the same code ?

Jörgen

Title: Re: The code does not match the entry
Post by: marvays on March 12, 2021, 06:16:32 AM
Hi. I am not understand you :(
All time I see my problem. You not?
Title: Re: The code does not match the entry
Post by: sirius on March 12, 2021, 10:06:02 AM
Hi

in this case use the meta, so just try like this:


...
<h3>Co je kutr?</h3>
<meta itemprop="name" content="Co je kutr?" />
...


but if possible it would be far better to implement your microdata in the template.

And if you do it in your html content, it could be more simple to put your data at the end with json, just allow it in jce settings.

Example for FAQ Page:
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "What is the return policy?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href=http://example.com/returns> Click here </a> to initiate a return.</p>"
        }
      }, {
        "@type": "Question",
        "name": "How long does it take to process a refund?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
        }
      }, {
        "@type": "Question",
        "name": "What is the policy for late/non-delivery of items ordered online?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href=https://example.com/orders/>Click here</a> to complete the form with your order-related question(s).</p>"
        }
      }, {
        "@type": "Question",
        "name": "When will my credit card be charged?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
        }
      }, {
        "@type": "Question",
        "name": "Will I be charged sales tax for online orders?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
        }]
    }
    </script>
Title: Re: The code does not match the entry
Post by: pinochico on March 12, 2021, 11:19:01 AM
To sirius:

Quoteit would be far better to implement your microdata in the template

It not possible, because this html is putted in category description as "fejk".
Then not all category description have to the same rich snippets for FAQ and all info about rich snippets for every VM category are dynamic == right info is only in category description after putted by admin - sometime yes, sometime no.

And if use json, then admin must be high level speshitpillt and undestand how put it this json to category description and duplicated his work too (is time expensive).


Problem is only this:

for "h3" - clear meta mark
for "p" - not clear meta mark

Maybe problem is inside definition about category description in mysql or in PHP file - first check model for category and second function for save infromation about category and third check mysql definition for category description (in language table too!)
Title: Re: The code does not match the entry
Post by: sirius on March 12, 2021, 12:05:02 PM
i just tell the solution for his particular case

as I said the <meta can do the job

but if you put microdata in your html content, obviously it become time expensive to maintain as it's not dynamic at all...it's a choice.

So in this case just use Google Structured Data Pro extension (https://extensions.joomla.org/extension/search-a-indexing/web-search/google-structured-data/) very convenient
And with this one (that I use on some sites) you will be able to put json/faq on virtuemart categories of your choice dynamically.
Just choose between automatic and manual mode.

With automatic it detects css selectors, so you just have to put the right selector in your html, so data are applied dynamically.
(https://nsa40.casimages.com/img/2021/03/12/mini_210312121111443670.jpg) (https://www.casimages.com/i/210312121111443670.jpg.html)

Then you just choose the VM categories that need this one
(https://nsa40.casimages.com/img/2021/03/12/mini_210312121111290302.jpg) (https://www.casimages.com/i/210312121111290302.jpg.html)

Jobe done, fire and forget

Or use manual mode then you can put the whole json code directly.
Title: Re: The code does not match the entry
Post by: pinochico on March 12, 2021, 12:16:43 PM
to sirius:

Im very sceptic, because the extensions from tassos for VM category add rich snippets for category shop and not both - for FAQ and for VM category, isn't it?

For me the best option is find bug and fixed or the last option add json at the end html for category description.
Or (and now Im thinking about this) put articles into category description by articles anywhare?
But the basic question is why putted FAQ rich sbippets into category description (will there be any benefit?).

Finally we use other solution for shop category with faq in our shop - add our modul with all type faq articles conected to right category (yes, some little custom developing).
Title: Re: The code does not match the entry
Post by: marvays on March 12, 2021, 14:23:20 PM
Quote from: pinochico on March 12, 2021, 12:16:43 PM
will there be any benefit?
Yes
Title: Re: The code does not match the entry
Post by: marvays on March 12, 2021, 14:26:37 PM
Quote from: sirius on March 12, 2021, 12:05:02 PM
So in this case just use Google Structured Data Pro extension (https://extensions.joomla.org/extension/search-a-indexing/web-search/google-structured-data/)

I have it a nd use about two years. Its the best solution for it, but this dont know add FAQ into Virtuemart Category :(
Yout solution  . . . adding code manually into description wor fine. But I'm afraid the e-shop administrator will accidentally delete these codes. That's why I thought of finding a plugin that will add a custom field to the category administration, into which I will enter these codes and the plugin will load them in the page.
Title: Re: The code does not match the entry
Post by: sirius on March 12, 2021, 15:13:31 PM
Just look at my screenshots is a good start

But documentation is here:
https://www.tassos.gr/joomla-extensions/google-structured-data-markup/docs/the-virtuemart-integration (https://www.tassos.gr/joomla-extensions/google-structured-data-markup/docs/the-virtuemart-integration)

Perhaps, as you already have this extension, it would be nice to open a support ticket on tassos.fr to get the best advice to achieve what you need.
Title: Re: The code does not match the entry
Post by: marvays on March 12, 2021, 15:53:25 PM
Quote from: sirius on March 12, 2021, 15:13:31 PM
Just look at my screenshots is a good start

But documentation is here:
https://www.tassos.gr/joomla-extensions/google-structured-data-markup/docs/the-virtuemart-integration (https://www.tassos.gr/joomla-extensions/google-structured-data-markup/docs/the-virtuemart-integration)

Yes, but Tassos says:
Hello Martin,
Google Structured Data does not produce any schema at list, category pages but only on single pages.
Read more on doc: Why I can't see the Structured Data on the Category, Blog or List view?


Title: Re: The code does not match the entry
Post by: sirius on March 12, 2021, 17:06:29 PM
Oh ok

too bad,  :-\

so did you try with the <meta ?
Title: Re: The code does not match the entry
Post by: marvays on March 13, 2021, 11:44:41 AM
Quote from: sirius on March 12, 2021, 10:06:02 AM
Example for FAQ Page:
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "FAQPage",
      "mainEntity": [{
        "@type": "Question",
        "name": "What is the return policy?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Most unopened items in new condition and returned within <strong>90 days</strong> will receive a refund or exchange. Some items have a modified return policy noted on the receipt or packing slip. Items that are opened or damaged or do not have a receipt may be denied a refund or exchange. Items purchased online or in-store may be returned to any store.<br /><p>Online purchases may be returned via a major parcel carrier. <a href=http://example.com/returns> Click here </a> to initiate a return.</p>"
        }
      }, {
        "@type": "Question",
        "name": "How long does it take to process a refund?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We will reimburse you for returned items in the same way you paid for them. For example, any amounts deducted from a gift card will be credited back to a gift card. For returns by mail, once we receive your return, we will process it within 4–5 business days. It may take up to 7 days after we process the return to reflect in your account, depending on your financial institution's processing time."
        }
      }, {
        "@type": "Question",
        "name": "What is the policy for late/non-delivery of items ordered online?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Our local teams work diligently to make sure that your order arrives on time, within our normaldelivery hours of 9AM to 8PM in the recipient's time zone. During  busy holiday periods like Christmas, Valentine's and Mother's Day, we may extend our delivery hours before 9AM and after 8PM to ensure that all gifts are delivered on time. If for any reason your gift does not arrive on time, our dedicated Customer Service agents will do everything they can to help successfully resolve your issue. <br/> <p><a href=https://example.com/orders/>Click here</a> to complete the form with your order-related question(s).</p>"
        }
      }, {
        "@type": "Question",
        "name": "When will my credit card be charged?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "We'll attempt to securely charge your credit card at the point of purchase online. If there's a problem, you'll be notified on the spot and prompted to use another card. Once we receive verification of sufficient funds, your payment will be completed and transferred securely to us. Your account will be charged in 24 to 48 hours."
        }
      }, {
        "@type": "Question",
        "name": "Will I be charged sales tax for online orders?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text":"Local and State sales tax will be collected if your recipient's mailing address is in: <ul><li>Arizona</li><li>California</li><li>Colorado</li></ul>"}
        }]
    }
    </script>


Sirius, for this code you use any tools or configurator? Or only PSpad :)
Title: Re: The code does not match the entry
Post by: sirius on March 13, 2021, 18:23:40 PM
PSpad, Notepad++ as you wish.

You also can use a generator if you want, this one below is just an example:
https://technicalseo.com/tools/schema-markup-generator/
Title: Re: The code does not match the entry
Post by: marvays on March 14, 2021, 05:10:55 AM
Quote from: sirius on March 13, 2021, 18:23:40 PM
https://technicalseo.com/tools/schema-markup-generator/
+ https://chrome.google.com/webstore/detail/structured-data-testing-t/kfdjeigpgagildmolfanniafmplnplpl

Thx