- Posts: 108
- Thank you received: 6
consistent product URL
I have set up categories and have displayed them in modules (associated with their specific menus) so that I have:
/associated-category/productname (which is great)
I have a module on the front page which links to products from various categories and currently when I select those products it will give me the URL:
cat/productname (where cat is the category SEF name set in config)
or
associated-parent-category-module/productname
I have smaller url's set
canonical URL etc
I have a product listing menu associated with the module and its set to the parent category
how do I make this module reference the correct category in the URL i.e. the "cat" or associated-parent-category-module is dynamic?
kind regards
chris
Please Log in or Create an account to join the conversation.
Make sure that you have the latest version of HikaShop and that you set the "Force canonical URLs on listings" option of the configuration to "use canonical URL if specified" and since you specified the canonical URL of your products, the system will always use these canonical URLs on all the listings where the products are displayed.
Please Log in or Create an account to join the conversation.
I still have the issue whereby if I select a product from the frontpage module it takes on the menu/productname format - where menu is the product listing menu associated with the module. This sounds logical, but what I would like to happen is to have the format category/productname, where "category" is dynamic and relates to the category that the product resides within.
is it possible to do this with a menu? I think I'm close but obviously missing something!
Please Log in or Create an account to join the conversation.
As I said, the "Force canonical URLs on listings" option of the configuration will always use the products canonical URLs on ALL the listings, and that also included the modules.
So you should not get that problem if you did like I recommended, unless you edited some of the views of a previous version of HikaShop before updating and thus didn't get the modifications in the views to handle that new setting.
Please Log in or Create an account to join the conversation.
I have updated Hikashop & I have changed elements of the product view (though I dont think anything regarding canonical should have been removed - is there something that might be missing within that view that I should check for?
in reference to my questions as to how canonical functions, I actually think it is working ok but I have two different results:
1. when I am in category listing and select a product it takes on the URL category/product-name
2. when I select a product from a homepage module it takes on the URL menu-name/product-name (where menu-name is the associated menu)
I would like it to always default to category/product-name - I just wanted to confirm that was the expected behaviour from canonical URL?
also it seems to me it can be achieved if I could have a menu which was dynamic & took on the category of the selected item. I can set the menu to go to one particular category, but not to dynamically select the category associated with the item. Is this how I should expect it to work?
Please Log in or Create an account to join the conversation.
Yes, the canonical URL system will allow you to have always the same URL going to the product page. If that's not the case, and that you have set the "Force canonical URLs on listings" option of the configuration correctly and that your products have a canonical URL, then the only thing left are the views modifications.
Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop and that will deactivate all the overrides. Then, you'll see if your module is displaying the canonical URLs or not and you can rename back the folder.
That way, you'll know if it comes from the view modifications.
Please Log in or Create an account to join the conversation.
Which views could cause this problem? I don't have any mods on Product > Show ...
The site is gouri-gouri.com
Thanks!
Please Log in or Create an account to join the conversation.
The views managing the canonical urls are "product / listing" for the product listings, "product / show" for the product display page and "category / listing".
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I now have consistent canonicals either going through the menus or the module. But when I follow a related item, the phrase "/related_item_XXX" is appended at the end of the url. Can this be avoided?
Please Log in or Create an account to join the conversation.
That should not be the case if you have canonical URLs since the related products listing will also use the canonical URL to go to the related product's product page.
Are you sure that you don't have another view override preventing that from working ?
Please Log in or Create an account to join the conversation.
Merry Christmas!!! Which view would that be?
Please Log in or Create an account to join the conversation.
It could be almost any file of the "product" view. Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop/product to something else and it will deactivate all the overrides of the product view and you'll see if that helps or not.
After that, you can repeat the process for each file of that folder to see which file has the modifications creating the issue.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.