Cart return url error

  • Posts: 67
  • Thank you received: 0
7 years 5 months ago #272169

-- HikaShop version -- : 3.1.1

Hello,

We've noticed that we're probably having penality from Google. Our rating is rapidly dropping last couple of weeks, so we're trying to figure out the problem.
We've checked out Google webmaster, and it's saying that we have 241 pages without titles, and we also have pages with similar issue with 404 error.
In attachment we provided screenshot. We are checking webmaster regulary and we didn't have these errors before, so we are not sure what can cause it.

We are not aware if customers are having any problem with orders, noone complained, but this error can have impact on SEO.
Do you have any ideas what can cause it and how can we solve it?

Attachments:

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 5 months ago #272189

Hi,

Add the code:

if(in_array($tmpl, array('ajax', 'raw')) && !headers_sent())
	header('X-Robots-Tag: noindex');
after the line:
$tmpl = JRequest::getWord('tmpl', '');
in the file "cart" of the view "product", and that should prevent the indexing.
These URLs are the URLs of the cart module AJAX refreshing system.
We'll add that on our end as well as these URLs should not be indexed.

Last edit: 7 years 5 months ago by nicolas.

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

  • Posts: 67
  • Thank you received: 0
7 years 4 months ago #272830

Hello,

I've added code in /components/com_hikashop/views/product/tmpl/cart.php but we still have same amount of missing titles and still getting few 404 cart return errors.
This is for example one of the links with missing title:
bebili.rs/bade-mantili-za-bebe/product/c...heT0=/tmpl-component

And this is one of 404 errors:
www.bebili.rs/kat/product/cart/module_id...1kZXZvamNpY2U=/korpa

This 404 error is fresh one.

Also we have one more question about blocked resourses. We have 500+ affected pages connected with hikashop. You can check screenshot in attachment. Can you help with it?

Attachments:

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 4 months ago #272854

Hi,

I don't see the "X-Robots-Tag: noindex" header added to the header of the response on your website:
monosnap.com/file/orb0KZLww8rmNtQQMD9BBuPQvUOeHC

See a similar URL on my end: monosnap.com/file/0Lc8KPW9bciDc026kTvB3sR4ETsiNC

So download the install package of HikaShop 3.1.1 on our website and install it on yours. We've added a more complete patch and it will help here and for other things.

The blocked resources is because they are blocked in the robots.txt file.
So you could modify it to allow them to be reachable by search engines.
But well, it doesn't matter much. That javascript/CSS is only for the popup notification. That means that the search engines won't get the notifications when using the add to cart links, which it shouldn't index in the first place. So it's not really a problem.

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

  • Posts: 67
  • Thank you received: 0
7 years 4 months ago #273278

Hello,

We've downloaded as you said but nothing changed. We still don't have no-index in header.
We still got bunch of links with missing titles and every of them are same when you click on it. It point to cart.png icon?
Example: bebili.rs/bebe-decaci/product/cart/modul...2NA==/tmpl-component

We using Hikashop for over 1 year, and didn't have these problems before. It started somewhere with upgrade to 3.0.0.

We really need a help with this, cos rating dropping everyday :(

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 4 months ago #273284

Hi,

All the patches are not on your website. Specially the one in the file "cart" of the view "product".
So I suppose that you have a view override for it.
Rename the file templates/YOUR_TEMPLATE/html/com_hikashop/product/cart.php to something else in order to deactivate the override and you'll get the patch for the noindex on that URL.

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

  • Posts: 67
  • Thank you received: 0
7 years 4 months ago #274374

Hi again Nicolas,

When You wrote the script exclamation mark was missing in part if(in_array

This is what is now in cart.php

$tmpl = JRequest::getWord('tmpl', '');
if(!in_array($tmpl, array('ajax', 'raw')) && !headers_sent())
header('X-Robots-Tag: noindex');

Now the X-Robots-Tag works.
Please check now if this is ok.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
7 years 4 months ago #274388

Hi,

The code we have on our end is:

if(!in_array($tmpl, array('component', 'ajax', 'raw'))) {
	$events = ($this->cart_type == 'cart') ? '["cart.updated","checkout.cart.updated"]' : '"wishlist.updated"';
?>
<script type="text/javascript">
window.Oby.registerAjax(<?php echo $events; ?>, function(params) {
	var o = window.Oby, el = document.getElementById('hikashop_cart_<?php echo $module_id; ?>');
	if(!el) return;
	if(params && params.resp && (params.resp.ret === 0 || params.resp.module == <?php echo (int)$module_id; ?>)) return;
	if(params && params.type && params.type != '<?php echo $this->cart_type; ?>') return;
	if(params && params.cart_empty) return;
	o.addClass(el, "hikashop_checkout_loading");
	o.xRequest("<?php echo hikashop_completeLink('product&task=cart&module_id='.$module_id . '&module_type='.$this->cart_type.'&return_url='.urlencode(base64_encode(hikashop_currentURL('return_url'))), true, false, true); ?>", {update: el}, function(xhr){
		o.removeClass(el, "hikashop_checkout_loading");
	});
});
</script>
<?php
} elseif(!headers_sent()){
	header('X-Robots-Tag: noindex');
}

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

  • Posts: 67
  • Thank you received: 0
7 years 3 months ago #274888

Hello Nicolas,

We have one more question, we think one more part shouldn't be indexed.
Can You check screenshots?

example url that we don't want to get indexed is - bebili.rs/odeca-za-bebe-devojcice/produc...1/cid-1226?tmpl=ajax

Can You tell us the path to file in which we should put noindex?

Thanks in advance.

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 3 months ago #274919

Hello,

There is already a patch in HikaShop product controller for "updatecart" to add the noindex header.
But that patch is not in the current release.

	public function updatecart() {
		hikashop_nocache();

		if(!headers_sent())
			header('X-Robots-Tag: noindex');

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 67
  • Thank you received: 0
7 years 3 months ago #274938

Can you give us path where we should insert this code?
EDIT: Nevermind we found it and it works now, thanks :)

Last edit: 7 years 3 months ago by kivici.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum