Don't show the Canonical URL in shopping cart

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #200947

-- HikaShop version -- : 2.4.0 Business
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4.31
-- Browser(s) name and version -- : Firefox

Hello everyone,

All my products have a canonical URL.

(In the frontend):
If I click this product from other URL, always go to the Canonical URL, except in the shopping cart. The products in the shopping cart (if I click in them) don't go to the Canonical URL.

This is a problem for me.

Someone have a solution? Or what I'm doing wrong?

Thank you very much!

Last edit: 8 years 9 months ago by netandsoftware.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #200956

Hi,

In which cart, the module or the cart view page ?
The both views are using the function hikashop_contentLink() to display the url and that function check if there is a canonical url, if it is, this one is used.

Si please check if you don't have view overrides on the view "product / cart" and "cart / showcart".

The following user(s) said Thank You: netandsoftware

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201098

Hi Xavier,

The cart is the Hikashop module.

I don't have view overrides on the cart module, but I had created a view "product / cart". The files were the original files, still I have delete this files (overrides) and the problem remains.

Thanks for helping.

Other ideas?


PD: Al ver que su nombre podría ser catalán: Si puedo explicar la duda en español, por favor, dígamelo, sería más fácil para mí. Gracias

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #201099

Hi,

Please check that for the option "Force canonical URLs on listings" you have another value than "No, generates the urls" selected.
Configuration > Features > Sef url options.

Last edit: 8 years 11 months ago by Xavier.

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201105

Yes, it was in another than "No, generates the urls"

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201122

I probe too with both options in SEF Url Options, but nothing, don't work. :(

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 11 months ago #201130

Hi,

With the latest version, I don't see why the canonical URL wouldn't be taken into account on the cart. It ha to come from a modification of one of the views.
Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop and that will deactivate all the views overrides you made for HikaShop. Then, it should probably work, indicating that it comes from one of the view overrides made.

PS: Xavier is also a French name. Xavier don't speak Spanish.

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201236

nicolas wrote: Hi,

With the latest version, I don't see why the canonical URL wouldn't be taken into account on the cart. It ha to come from a modification of one of the views.
Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop and that will deactivate all the views overrides you made for HikaShop. Then, it should probably work, indicating that it comes from one of the view overrides made.

PS: Xavier is also a French name. Xavier don't speak Spanish.


Neither. Rename the directory and don't work.

It happens with only one product.

I have made many many tests.

I have seen that:
* if the SEF Url Option is "No, generates the urls", works (but the other products don't work)
* If the SEF Url Option is in another value than "No, generates the urls", this product don't work (but the other products work).

I'm going to create a new product (with the same information) and I probe if it works.

While, any more ideas?


PS: Thanks

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201237

I hope that you can help me!

I created a new exact product (except characteristic)s and this product works :) (it goes to the Canonical Url).

When I add the characteristics and I add them a price, I have the same error (don't show the Canonical Url in the cart module) :blink: .

Any idea?

Last edit: 8 years 11 months ago by netandsoftware.

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201238

If delete the characteristics, works, but if I create them (new characteristics) and I price them, don't work.

There is this error with any product with characteristics. I checked it.

Last edit: 8 years 11 months ago by netandsoftware.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 11 months ago #201273

Hi,

Ok, try to add the code:

		}elseif(!empty($object->product_parent_id)){
			$class = hikashop_get('class.product');
			$parent = $class->get($object->product_parent_id);
			if(!empty($parent->product_canonical))
				$url = hikashop_cleanURL($parent->product_canonical);
after the code:
		if(!empty($object->product_canonical)){
			$url = hikashop_cleanURL($object->product_canonical);
in the file administrator/components/com_hikashop/helpers/helper.php and that should help.

The following user(s) said Thank You: netandsoftware

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

  • Posts: 13
  • Thank you received: 0
8 years 11 months ago #201305

YEEEEEEEEEEEESSSSSSSSSSSSSSSSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ;) :)

Delete this code:

}elseif(!empty($object->category_canonical)){
		$url = hikashop_cleanURL($object->category_canonical);

and replaced by:
}elseif(!empty($object->product_parent_id)){
			$class = hikashop_get('class.product');
			$parent = $class->get($object->product_parent_id);
			if(!empty($parent->product_canonical))
				$url = hikashop_cleanURL($parent->product_canonical);

and works fine!

Nicolas, thank you very much!!!! :)

Last edit: 8 years 11 months ago by netandsoftware.

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

  • Posts: 13
  • Thank you received: 0
8 years 9 months ago #206917

Now, again doesn't work with Hikashop 2.5.0

Joomla! 3.4.2

The code is replaced, but now doesn't work.

Can you help me again?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 9 months ago #207004

Hi,

So does it work for normal products ? For variants ?
There should be no need to do that modification since the 2.5.0 edition includes it already. Did you perhaps made a mistake when doing the replacing about the update ?
It's working fine on our end.

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

  • Posts: 13
  • Thank you received: 0
8 years 9 months ago #207069

nicolas wrote: Hi,

So does it work for normal products ? For variants ?
There should be no need to do that modification since the 2.5.0 edition includes it already. Did you perhaps made a mistake when doing the replacing about the update ?
It's working fine on our end.


For normal products and variant products.

When I update to 2.5.0 version, Joomla! display me an error. I lost the link to Hikashop in administration menu. But in URL, I put /index.php?option=com_hikashop and Hikashop works fine.

I fix the error with similar SQL sentence:
INSERT INTO `PREFIX_menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) VALUES
(1, 'HIKASHOPNAME', 'Menu_Item_Root', 'root', '', '', '', '', 1, 0, 0, 0, 0, '0000-00-00 00:00:00', 0, 0, '', 0, '', 0, 137, 0, '*', 0)

So, I don't think that this is the problem.

I have the same problem that http://www.hikashop.com/forum/install-update/877870-upgrade-to-2-5-0-problems.html

* If I turn off the "force canonical URLs on listings" setting in the HikaShop configuration, I have the problem with canonical URL in cart module.

* If I turn on the "force canonical URLs on listings" setting in the HikaShop configuration, I have many 404 errors (page not found).

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
8 years 9 months ago #207100

Hi,

If you get errors when you turn on the "force canonical URLs on listings" setting, it means that you have wrong canonical URLs in your products/categories.
I would recommend to clean them with a mass action:
www.hikashop.com/support/forum/product-c...tegories.html#193288
and then activate the option so that HikaShop will regenerate valid canonical URLs.

The following user(s) said Thank You: netandsoftware

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

  • Posts: 13
  • Thank you received: 0
8 years 9 months ago #207287

nicolas wrote: Hi,

If you get errors when you turn on the "force canonical URLs on listings" setting, it means that you have wrong canonical URLs in your products/categories.
I would recommend to clean them with a mass action:
www.hikashop.com/support/forum/product-c...tegories.html#193288
and then activate the option so that HikaShop will regenerate valid canonical URLs.


Yes, this was the solution.

Thanks

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

Time to create page: 0.074 seconds
Powered by Kunena Forum