[Skip to main content](#vessel-content)

#   Product variant doesn't keep canonical url

##

- **[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")**
- [![earmaster's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35023-earmaster "View earmaster's Profile") Topic Author
- [ Offline](/forum/user/35023-earmaster)

Less More

- Posts: 137
- Thank you received: 2
-
-

11 years 8 months ago -  11 years 8 months ago [\#193494](#193494) by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")  *[Product variant doesn't keep canonical url](/forum/27-checkout/875465-product-variant-doesnt-keep-canonical-url#193494 "-- HikaShop version -- : 2.4.0 &amp; 2.3.5 -- Joomla version -- : 3.4.0 &amp; 3.3.6 -- PHP version -- : 5.3.10  Hi!  We've noticed that when we have add products to our basket / Cart and hover over the product name (which is a link) the link is  instead of the set product canonical url.  This only affects products with variants as products with no variants displays the correct url.  The wrong URL is only used/displayed in the Basket / checkout page.  It should be noted that we are using 3 seperate pages / Menu points for our shop,  Page/Menu 1: Joomla Article which loads hikashop content module (Used as product listing).  Page/Menu 2. Hikashop product listing (Only used to display the product pages)  Page/Menu 3: Hikashop checkout (In configuration hikashop checkout is also forced to this menu).  It should properly also be noted that in the &quot;Feautes -&gt; SEF url options&quot; we have deleted the Product SEF name and Checkout SEF name and are using the menu's name instead.  This error occurs both on hikashop 2.3.5 on Joomla 3.3.6 and on Hikashop 2.4.0 on Joomla 3.4.0")* was created by *[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")*

-- HikaShop version -- : 2.4.0 &amp; 2.3.5
-- Joomla version -- : 3.4.0 &amp; 3.3.6
-- PHP version -- : 5.3.10

Hi!

We've noticed that when we have add products to our basket / Cart and hover over the product name (which is a link) the link is Code:

/component/hikashop/&lt;product alias&gt;.html

instead of the set product canonical url.

This only affects products with variants as products with no variants displays the correct url.

The wrong URL is only used/displayed in the Basket / checkout page.

It should be noted that we are using 3 seperate pages / Menu points for our shop,

Page/Menu 1: Joomla Article which loads hikashop content module (Used as product listing).

Page/Menu 2. Hikashop product listing (Only used to display the product pages)

Page/Menu 3: Hikashop checkout (In configuration hikashop checkout is also forced to this menu).

It should properly also be noted that in the "Feautes -&gt; SEF url options" we have deleted the Product SEF name and Checkout SEF name and are using the menu's name instead.

This error occurs both on hikashop 2.3.5 on Joomla 3.3.6 and on Hikashop 2.4.0 on Joomla 3.4.0

Last edit: 11 years 8 months ago by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NTQ2NS1wcm9kdWN0LXZhcmlhbnQtZG9lc250LWtlZXAtY2Fub25pY2FsLXVybD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")**
- [![earmaster's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35023-earmaster "View earmaster's Profile") Topic Author
- [ Offline](/forum/user/35023-earmaster)

Less More

- Posts: 137
- Thank you received: 2
-
-

11 years 8 months ago [\#193858](#193858) by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")  Replied by *[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")* on topic *[Product variant doesn't keep canonical url](/forum/27-checkout/875465-product-variant-doesnt-keep-canonical-url#193858 "-- HikaShop version -- : 2.4.0 &amp; 2.3.5 -- Joomla version -- : 3.4.0 &amp; 3.3.6 -- PHP version -- : 5.3.10  Hi!  We've noticed that when we have add products to our basket / Cart and hover over the product name (which is a link) the link is  instead of the set product canonical url.  This only affects products with variants as products with no variants displays the correct url.  The wrong URL is only used/displayed in the Basket / checkout page.  It should be noted that we are using 3 seperate pages / Menu points for our shop,  Page/Menu 1: Joomla Article which loads hikashop content module (Used as product listing).  Page/Menu 2. Hikashop product listing (Only used to display the product pages)  Page/Menu 3: Hikashop checkout (In configuration hikashop checkout is also forced to this menu).  It should properly also be noted that in the &quot;Feautes -&gt; SEF url options&quot; we have deleted the Product SEF name and Checkout SEF name and are using the menu's name instead.  This error occurs both on hikashop 2.3.5 on Joomla 3.3.6 and on Hikashop 2.4.0 on Joomla 3.4.0")*

I did some testing and it seems like the issue lies with the automatic assignment of the main products URL to the product variant URL. Because from what I could see is that if I assign a product a canonical URL through the backend, the URL won't be applied to the variants and will then receive/generate a url for the variants when we visit /list the product (on the frontend) instead of the canonical url we defined in the backend.

So I don't know whether it's just simply to make sure that the canonical url is attached to the variants when you hit the "save" button in the backend

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NTQ2NS1wcm9kdWN0LXZhcmlhbnQtZG9lc250LWtlZXAtY2Fub25pY2FsLXVybD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 8 months ago [\#193977](#193977) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Product variant doesn't keep canonical url](/forum/27-checkout/875465-product-variant-doesnt-keep-canonical-url#193977 "-- HikaShop version -- : 2.4.0 &amp; 2.3.5 -- Joomla version -- : 3.4.0 &amp; 3.3.6 -- PHP version -- : 5.3.10  Hi!  We've noticed that when we have add products to our basket / Cart and hover over the product name (which is a link) the link is  instead of the set product canonical url.  This only affects products with variants as products with no variants displays the correct url.  The wrong URL is only used/displayed in the Basket / checkout page.  It should be noted that we are using 3 seperate pages / Menu points for our shop,  Page/Menu 1: Joomla Article which loads hikashop content module (Used as product listing).  Page/Menu 2. Hikashop product listing (Only used to display the product pages)  Page/Menu 3: Hikashop checkout (In configuration hikashop checkout is also forced to this menu).  It should properly also be noted that in the &quot;Feautes -&gt; SEF url options&quot; we have deleted the Product SEF name and Checkout SEF name and are using the menu's name instead.  This error occurs both on hikashop 2.3.5 on Joomla 3.3.6 and on Hikashop 2.4.0 on Joomla 3.4.0")*

Hi,

Add the line:
$variant-&gt;product_canonical = @$element-&gt;product_canonical;
after the line:
$variant-&gt;main_product_quantity_layout = @$element-&gt;product_quantity_layout;
in the file administrator/components/com_hikashop/classes/product.php and that should allow the system to use the canonical URL for products with variants on the cart display.

The following user(s) said Thank You: [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NTQ2NS1wcm9kdWN0LXZhcmlhbnQtZG9lc250LWtlZXAtY2Fub25pY2FsLXVybD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")**
- [![earmaster's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35023-earmaster "View earmaster's Profile") Topic Author
- [ Offline](/forum/user/35023-earmaster)

Less More

- Posts: 137
- Thank you received: 2
-
-

11 years 8 months ago [\#194012](#194012) by [earmaster](/forum/user/35023-earmaster "View earmaster's Profile")  Replied by *[earmaster](/forum/user/35023-earmaster "View earmaster's Profile")* on topic *[Product variant doesn't keep canonical url](/forum/27-checkout/875465-product-variant-doesnt-keep-canonical-url#194012 "-- HikaShop version -- : 2.4.0 &amp; 2.3.5 -- Joomla version -- : 3.4.0 &amp; 3.3.6 -- PHP version -- : 5.3.10  Hi!  We've noticed that when we have add products to our basket / Cart and hover over the product name (which is a link) the link is  instead of the set product canonical url.  This only affects products with variants as products with no variants displays the correct url.  The wrong URL is only used/displayed in the Basket / checkout page.  It should be noted that we are using 3 seperate pages / Menu points for our shop,  Page/Menu 1: Joomla Article which loads hikashop content module (Used as product listing).  Page/Menu 2. Hikashop product listing (Only used to display the product pages)  Page/Menu 3: Hikashop checkout (In configuration hikashop checkout is also forced to this menu).  It should properly also be noted that in the &quot;Feautes -&gt; SEF url options&quot; we have deleted the Product SEF name and Checkout SEF name and are using the menu's name instead.  This error occurs both on hikashop 2.3.5 on Joomla 3.3.6 and on Hikashop 2.4.0 on Joomla 3.4.0")*

Thanks! That solved it!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3NTQ2NS1wcm9kdWN0LXZhcmlhbnQtZG9lc250LWtlZXAtY2Fub25pY2FsLXVybD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
