Best way to Selectively No Index Some Products

  • Posts: 146
  • Thank you received: 2
8 years 5 months ago #215972

Yup, that is actually the way I have it.

Attachments:

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

  • Posts: 25994
  • Thank you received: 4004
  • MODERATOR
8 years 5 months ago #215975

Hi,

Can you please try with that code ?

if(isset($this->element))
  $noindex = strtolower(trim($this->element->meta_noindex));
else
  $noindex = strtolower(trim(@$this->row->meta_noindex));
if($noindex == 'true') {
So we will avoid any kind of problem between "show" and "listing" views :)

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: 63
  • Thank you received: 1
7 years 7 months ago #247199

Hi,

Does it work?

Regards,

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

  • Posts: 104
  • Thank you received: 5
1 year 7 months ago #343619

Hi nicolas
It seems that this solution cannot be implemented in version 4.6.1. I can't find the link to add the no-index rel to it.

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
1 year 7 months ago #343633

Hello,

Sorry for this return but can you precise your idea, where didn't you find the "$link", in which view please.
We have to check is the url link and therefore the modification should always be possible, or else we are not talking about the same thing, hence my request for clarification.

Regards

Last edit: 1 year 7 months ago by Philip.
The following user(s) said Thank You: levelup

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

  • Posts: 104
  • Thank you received: 5
1 year 7 months ago #343701

Hi Philip
In Hikashop version 4.4.4 in the listing_img_title layout,, I created a custom field of the product type called indexnoindex, which will add the rel="nofollow to the end of the product link when it is set to yes on the product management page.

<?php
/**
 *------ Add this and add 'rel="nofollow"' at the end of product link in line 40 and 80
*/
$index_noindex = '';
if($this->row->indexnoindex == '0' || $this->row->indexnoindex == '' ){
	$index_noindex = '';
}else{
	$index_noindex = 'rel="nofollow"';
}
?>

<?php if($haveLink) { ?>
			<a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>" <?php echo $index_noindex;?> >
<?php } ?>
I can't find the product link in version 4.6.1

Last edit: 1 year 7 months ago by levelup.

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

  • Posts: 4486
  • Thank you received: 609
  • MODERATOR
1 year 7 months ago #343706

Hello,

The product link is at the very beginning of the view code, and I think I get something about your current code, the $havelink variable is no longer written as is, now it's $this->havelink, see my screenshot to understand my point :



Hope this will help you to achieve your needs.
Regards

Last edit: 1 year 7 months ago by Philip.
The following user(s) said Thank You: levelup

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

Time to create page: 0.098 seconds
Powered by Kunena Forum