Site logo

Archived topic

Add missing link text to 2 internal links

21 replies · Started by Craig on November 14, 2022

Viewing posts 16–22 of 22

I have disabled the custom cart and still get the same result in the SEO when scanned.

So it looks like the issue is not caused by the Custom cart. Is the default Woo cart enabled?

I would like it to the right of the login|register. Can we do this with CSS

Maybe, it depends on your site header structure. But we should find out what causes the issue first.

Can you disable both the custom cart and the default Woo cart and redo the test?

Let me know!

I did that - disabled both the custom cart and the default Woo cart and redid the test.

When no cart is enabled all the issues go away.

What do I do from here?

Add this PHP Snippet to your site:

add_filter( 'generate_svg_icon', function( $output, $icon ) {
    if ( 'shopping-cart' === $icon ) {
        $svg = '<svg viewBox="0 0 576 512" aria-hidden="true" version="1.1" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em">
                <title>View Shopping Cart</title>
                <path fill="none" d="M0 0h576v512H0z"/>
                <path d="M181.54 409.6c-29.249 0-52.914 23.04-52.914 51.2 0 28.16 23.665 51.2 52.915 51.2 29.249 0 53.18-23.04 53.18-51.2 0-28.16-23.931-51.2-53.18-51.2zM22 0v51.2h53.18l95.725 194.304-35.897 62.464C115.598 342.272 141.124 384 181.54 384h319.08v-51.2h-319.08l29.249-51.2h198.096c19.943 0 37.492-10.496 46.533-26.368L550.61 89.088c9.838-16.896-2.925-37.888-23.133-37.888H133.944L108.95 0H22zm425.442 409.6c-29.25 0-52.915 23.04-52.915 51.2 0 28.16 23.665 51.2 52.915 51.2 29.249 0 53.18-23.04 53.18-51.2 0-28.16-23.931-51.2-53.18-51.2z"/>
            </svg>';

        return sprintf(
            '<span class="gp-icon %1$s">
                %2$s
            </span>',
            $icon,
            $svg
        );
    }

    return $output;
}, 15, 2 );

And then clear the transient and site caches in Woocommerce > Status > Tools.
Also clear any plugin caches, and then add and remove an item to your cart.

This will update the shopping cart SVG icon to include the <title>View Shopping Cart</title> tag.
It should be completely unnecessary to do this, but it make whatever SEO software you're using happy.

If it doesn't then either ignore that warning or speak to the provider and ask them to explain what they expect when there is shopping cart icon in the menu.

David, Ying - Thank you.
You are very bright and helpful.

David that code works.

You have a customer for life :)

Thank you

Glad to be of help!

This archived topic is closed to new replies.