Why use "a href" to add to cart?

  • Posts: 19
  • Thank you received: 2
  • Hikashop Business
2 years 6 months ago #336371

Why use "a href" to add to cart, and not the <imput> or <button> functions? Indeed, the SEO impact is greatly impacted.
thank you for your reply

Please Log in or Create an account to join the conversation.

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 6 months ago #336374

Hi,

When javascript is disabled / breaking (because of a javascript error on the page for example), for the input or button to work, it requires a form element to be available. With an "a" tag, it can work on its own with just the href being set. So it's easier to manage through the different views.
Also, templates often have a lot of CSS on inputs and buttons, which usually mess with the look of the add to cart button if it's an input or button. With an "a" tag, we can more easily enforce our own default CSS on the add to cart as templates usually have a lot less CSS on them.

You're saying that SEO is greatly impacted by doing that but I've never heard of such a thing. Why do you think SEO is impacted ? I personnally think it doesn't change anything. Do you have any information to back your claim ? I looked a bit online but I couldn't find any information on this. Usually, you want these buttons to not be indexed. That's why, in HikaShop, we add a no-follow no-index HTTP header on the response of these buttons. Thus having inputs or a tags shouldn't change anything regarding SEO.

We actually were using inputs instead of a tags years ago and switched to a tags for all the reasons above.

The following user(s) said Thank You: lousyfool

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
  • Hikashop Business
2 years 6 months ago #336393

Bonjour
En terme de popularité globale du site.
Par exemple selon un article de Semrush sur le maillage interne (voici le lien" fr.semrush.com/blog/bonnes-pratiques-maillage-interne/ ")
"Dès 2010, Google avait changé son approche : avoir un lien nofollow dans sa page bloquait la transmission de popularité et pouvait donc nuire au référencement naturel. Plus j'ai de liens nofollow, plus je vais faire diminuer la popularité globale de mon site."

Donc un bouton panier établit sur le fonctionnement d'une balise "a" avec un attribut rel=nofollow ne serait pas logique d'un point de vue semantique.

Please Log in or Create an account to join the conversation.

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 6 months ago #336438

Bonjour,

Merci pour le lien. C'est très intéressant. Je vois ce que vous voulez dire.
C'est changeable de mettre des input au lieu de tag a assez facilement.
Mais bon, niveau CSS, cela va causer quelques problèmes pour les personnes mettant à jour avec des personnalisations faites incorrectement ou avec des templates avec certains CSS sur les buttons. Et il reste aussi la question du fallback quand le javascript n'est pas disponible. Le bouton ne serait alors plus fonctionnel dans ces cas-là alors que maintenant, il n'y a pas de souci.
Donc bon, à voir. J'aimerais quand même faire le changement si cela peut aider pour le SEO.
Nous allons voir ce que nous pouvons faire.

The following user(s) said Thank You: agrepe

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
2 years 6 months ago #336439

Hi,

Sorry, but this is going the wrong direction.

First, Google defines the use and benefits of "nofollow" attributes (just like other attributes ) very clearly: see developers.google.com/search/docs/advanc...alify-outbound-links and elsewhere.

So, yes, "wrong" use, e.g. for site-internal links, can affect ranking negatively, and if only because you're basically attempting to "hide" potentially valuable content from search bots.

And that's it. So, the section in the French article is taken out of context, and both the <a> tag as well as the "nofollow" attribute are making perfectly good sense for the add-to-cart button -- for the reasons as mentioned by Nicolas here above, as well as it enables site owners and users to pass on simple add-to-cart links per email, messengers, etc.

Please leave the <a> tag as is. Or, at the very least, give us the option for utilising <a> tags for the purpose like in older HikaShop versions.

Merci beaucoup!

EDIT:
Sorry, forgot to mention: the only downside of the <a> tag I can think of is that not all bots respect the "nofollow", eventually leading to "bad bots" causing fewer or more carts being generated. But even that is not a problem as HikaShop gives us -- thankfully -- the option of unused carts being auto-deleted after X days. So, nothing to worry about there, either.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )
Last edit: 2 years 6 months ago by lousyfool.
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

  • Posts: 19
  • Thank you received: 2
  • Hikashop Business
2 years 4 months ago #337741

Bonjour. Concernant notre demande, avez-vous vu avec votre équipe ce que vous pouviez réaliser?
Bien sincèrement

Please Log in or Create an account to join the conversation.

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
2 years 4 months ago #337759

Bonjour,

Oui. Lousyfool a également raison que ça a du sens d'utiliser des tags "a" et je comprends l'idée d'utiliser des boutons également.
L'un ou l'autre je pense que cela ne change pas grand chose niveau SEO.
Mais bon, la modification n'est pas trop trop complexe, donc nous avons décidé de rajouter une option dans la configuration pour pouvoir choisir d'utiliser des a ou des input type="button". En plus, cela passe par un layout de vue maintenant, donc il sera facil de les personnaliser d'un coup au besoin.
Ce sera dans la prochaine version d'HikaShop, a paraître bientôt.

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum