Back link problem after sending a contact request

  • Posts: 3
  • Thank you received: 1
11 years 10 months ago #156364

-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.1
-- PHP version -- : 5..5

I encountered a problem in following situation:

-product title has special characters (e.g.: Ø)
-product alias is set without special characters
-sef urls are activated

After sending a request via the "Contact us for more information" button, I get following confirmation dialog:


Message

Your request has been sent successfully

Click here to go back to the product page
The problem is that the "Click here" link has the product title with Ø replaced by o, so if I click I get the message "Product not found".

Anyone can reproduce this error or has solution for it?

Thanks
Daniel

Last edit: 11 years 10 months ago by danielo.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 10 months ago #156393

Hi,

Generally with SEF urls what is important are the ids. the url should looks like: http:/mywebsite.com/product/15-product-name.
Are you still using IDs in the urls ?
The problem seem to come from the controller product "components/com_hikashop/controllers/product.php" function "send_email()". Thanks to try to use for testing purpose:

$app->enqueueMessage(JText::sprintf('CLICK_HERE_TO_GO_BACK_TO_PRODUCT',hikashop_completeLink('product&task=show&cid='.$product->product_id.'&name='.$product->product_alias.$url_itemid)));
Instead of:
$app->enqueueMessage(JText::sprintf('CLICK_HERE_TO_GO_BACK_TO_PRODUCT',hikashop_completeLink('product&task=show&cid='.$product->product_id.'&name='.$product->alias.$url_itemid)));

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

  • Posts: 3
  • Thank you received: 1
11 years 10 months ago #156484

Hi Xavier,

this works but I lost SEF urls so I would be http:/mywebsite.com/product/15-

I did some more investigations and found out that this problem only occurs if i use products with characteristics.

In this case the product_id (cid in the url) is the one of the variant but the alias becomes the product name(!) of the main form.

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

  • Posts: 3
  • Thank you received: 1
11 years 10 months ago #156519

Okay, everything works fine after replacing

$app->enqueueMessage(JText::sprintf('CLICK_HERE_TO_GO_BACK_TO_PRODUCT',hikashop_completeLink('product&task=show&cid='.$product->product_id.'&name='.$product->alias.$url_itemid)));

with
if($product->product_type=='variant'){
	$alias = $parentProduct->alias;
}else{
	$alias = $product->alias;
}
$app->enqueueMessage(JText::sprintf('CLICK_HERE_TO_GO_BACK_TO_PRODUCT',hikashop_completeLink('product&task=show&cid='.$product->product_id.'&name='.$alias.$url_itemid)));

Last edit: 11 years 10 months ago by danielo.
The following user(s) said Thank You: Mohamed Thelji

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

Time to create page: 0.049 seconds
Powered by Kunena Forum