- Posts: 303
- Thank you received: 18
Link Product Options to corresponding product pages
- mojooutdoors-holden
-
Topic Author
- Offline
-- Joomla version -- : 3.9.8
-- PHP version -- : 7.2
Is there any way to link to the product pages of the product options added? The description is shown in a tooltip on hover, so it has to know where the product information is stored in the database. Surely, pulling the URL isn't an impossible task? I know where to update it, but unsure how to pull the product_url in the view "product / option.php". Some customers want to view the whole product page before deciding to add it as a product option.
Example page: www.mojooutdoors.com/spinning-wing-decoy...series-pintail-decoy
Thank you for your time!
Please Log in or Create an account to join the conversation.
Normally, you should configure the canonical URL of each product in its corresponding field for better SEO.
It seems that you did that on your website.
So you already have that URL available directly in $optionInfo->product_canonical so then it's easy to generate the link.
So instead of the line:
echo $optionInfo->product_name . $options;
you could have:
echo '<a href="'.$optionInfo->product_canonical.'">'.$optionInfo->product_name .'</a>'. $options;
You might have to prepend the canonical URL with the URL of the website based on what you have in the canonical URL field and how your website is configured.
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Please Log in or Create an account to join the conversation.
Well, in that case you could use something like that instead:
Please Log in or Create an account to join the conversation.
- mojooutdoors-holden
-
Topic Author
- Offline
- Posts: 303
- Thank you received: 18
Is there any harm to use the canonical in sh404sef vs hikashop? What if you have both filled out? Will one override the other?
Please Log in or Create an account to join the conversation.
From what I understand, the canonical feature in sh404SEF allows you to insert a canonical URL tag for a specific page.
HikaShop does that on the product page if you fill in the canonical URL field of the product.
The only thing to check on is whether you get two tags on the page or not.
If the sh404SEF canonical feature is done properly, it should override the canonical URL tag of HikaShop instead of adding another one. In that case, you could have both filled out. Otherwise, I would recommend filling only one of them. Otherwise, Google will complain about it.
It's important to fill either one for the product pages. The canonical URL in HikaShop can bypass the SEF URL routing if you force it on listings. In that case, if you clear the URL alias cache of sh404SEF, you'll end up with 404 errors. So it might be safer to only fill sh404SEF canonical URLs to avoid potential issues in the future when you need to clear sh404SEF's cache.
Please Log in or Create an account to join the conversation.
- Posts: 203
- Thank you received: 16
I've got the same issue but we only have the inbuilt 'search friendly URLs' turn on in Joomla's config. So the canonicals always seem to have the wrong category path in them. The result is, searches work as far as products go but a 404 error also appears ( link ). Is there a way to easily regenerate the canonicals and do I need to turn off 'search friendly URLs'?nicolas wrote: Hi,
From what I understand, the canonical feature in sh404SEF allows you to insert a canonical URL tag for a specific page.
HikaShop does that on the product page if you fill in the canonical URL field of the product.
The only thing to check on is whether you get two tags on the page or not.
If the sh404SEF canonical feature is done properly, it should override the canonical URL tag of HikaShop instead of adding another one. In that case, you could have both filled out. Otherwise, I would recommend filling only one of them. Otherwise, Google will complain about it.
It's important to fill either one for the product pages. The canonical URL in HikaShop can bypass the SEF URL routing if you force it on listings. In that case, if you clear the URL alias cache of sh404SEF, you'll end up with 404 errors. So it might be safer to only fill sh404SEF canonical URLs to avoid potential issues in the future when you need to clear sh404SEF's cache.
Thanks,
Ian and Stu
Please Log in or Create an account to join the conversation.
The easiest to regenerate the canonical URLs is to empty them with a mass action (menu System>Mass actions, with an action "update the values" on the column "product_canonical") and then, HikaShop will fill them in automatically when needed if you have the "force canonical URLs on listings" setting of the HikaShop configuration set to "Use canonical URL and generate it if missing"
Please Log in or Create an account to join the conversation.