Skip to main content

related products breadcrumbs pathway

More
15 years 7 months ago #8607 by jasonm
We have a related products module on the product page. If we click through to a related product from the product page the breadcrumbs pathway on the related product page displays as though the product is directly in the shop root.

Ideally we would like this to display the pathway including the original product.

I'm sure thats hard to understand so I'll have another go at spelling it out

Current product pathway
-> category -> sub-category -> product

When you click on a related product on the product page the pathway changes to
-> related product

Ideally we would like to have
-> category -> sub-category -> product -> related product

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

More
15 years 7 months ago #8621 by nicolas
You could try to edit the file components/com_hikashop/views/product/view.html.php and add before the line:
if( !$this->params->get('random')){

the lines:
if(!empty($product_id)){
$category_pathway = '&category_pathway='.JRequest::getInt('category_pathway',0).'&related_product='.$product_id;
}

and before the line:
$pathway->addItem($product_name,hikashop::completeLink('product&task=show&cid='.(int)$element->product_id.'&name='.$element->alias.'&category_pathway='.$category_pathway.$url_itemid));

the lines:
$related = JRequest::getInt('related_product',0);
if(!empty($related)){
$class = hikashop::get('class.product');
$prod = $class->get($class);
if(!empty($prod)){
$prod->alias = JFilterOutput::stringURLSafe($prod->product_name);
$pathway->addItem($prod->product_name,hikashop::completeLink('product&task=show&cid='.(int)$prod->product_id.'&name='.$prod->alias.'&category_pathway='.$category_pathway.$url_itemid));
}
}

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

More
15 years 7 months ago #8627 by jasonm
Doesn't appear to have worked
Code:
$related = JRequest::getInt('related_product',0); if(!empty($related)){ $class = hikashop::get('class.product'); $prod = $class->get($class); if(!empty($prod)){ $prod->alias = JFilterOutput::stringURLSafe($prod->product_name); $pathway->addItem($prod->product_name,hikashop::completeLink('product&task=show&cid='.(int)$prod->product_id.'&name='.$prod->alias.'&category_pathway='.$category_pathway.$url_itemid)); } } $pathway->addItem($product_name,hikashop::completeLink('product&task=show&cid='.(int)$element->product_id.'&name='.$element->alias.'&category_pathway='.$category_pathway.$url_itemid)); }


I also tried removing the last line as it appears to be replaced by the last line of the new code, but that didn't work either.

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

More
15 years 7 months ago #8638 by nicolas
Could you give a link to your shop so that we can see the modification ?

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

More
15 years 7 months ago #9518 by jasonm
I've sent you an email with the shop address

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

More
15 years 7 months ago #9519 by nicolas
Could you update to the latest version first and see if that works ?
We released a new version of HikaShop with these changes included.

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

More
15 years 7 months ago #9523 by jasonm
Just updated, no change.

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

More
15 years 7 months ago #9524 by nicolas
Ok. We'll look at your website tomorrow as it's already late here.

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

More
15 years 7 months ago #9527 by jasonm
No worries, we've still got a few days before we go live and there is certainly no reason to complain about the level of support you guys give.

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

More
15 years 7 months ago #9592 by nicolas
Hi,

We changed a bit the file components/com_hikashop/views/product/view.html.php
Could you replace that file by the one in the archive enclosed and try again ?

This attachment is hidden for guests.
Please log in or register to see it.

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

More
15 years 6 months ago #9681 by jasonm
Ok file uploaded, also now running starter 1.4.7

Pathway before selecting related product: home > category > sub-category > product
Pathway after selecting related product: home > category > sub-category > related product

with the following warning displayed underneath

Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in /home/apcrbcco/public_html/libraries/joomla/database/database/mysql.php on line 193

Ideally we are looking for home > category > sub-category > product > related product

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

More
15 years 6 months ago #9683 by jasonm
I've just purchased Essential for this site, do you want me to install it before we continue?

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

More
15 years 6 months ago #9700 by nicolas
You need to change the line :
$prod = $class->get($class);
to:
$prod = $class->get($related);

in that same file to fix the problem.

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

More
15 years 6 months ago #9703 by jasonm
I checked view.html.php and mysql.php and "$prod = $class->get($class);" didn't come up?

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

More
15 years 6 months ago #9704 by nicolas
In the file I attached earlier, I can clearly see this line of code on line 637.

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

More
15 years 6 months ago #9778 by jasonm
Done and working, for some reason my cpanel code editor didn't find it last night, but I should probably put that down to operator error.

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

More
15 years 6 months ago #9779 by jasonm
OK, I've just installed the essential package and as expected the view.html.php file was overwritten and the same mysql fault appeared. I have overwritten with the previous working file and its all good again.

Are there likely to be any other problems replacing an essential view.html.php with a starter view.html.php?

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

More
15 years 6 months ago #9780 by nicolas
No, it's the same file for all versions. That will also be included in next release so you won't have to bother with it anymore.

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

More
15 years 6 months ago #10485 by Robbeh
Hi, I have a similer issue,
I have a module that displays random products on the right column of a number of pages on the website, using your code from the file above adds the previous page location to the breadcrumb trail but is it possible to change this to being the items location in the product catagory tree?

For example:

Instead of: home > page_item_clicked > item

This: home > product_catagory > subcatagory>product

Thanks in advance

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

More
15 years 6 months ago #10491 by nicolas
For that, you need to set a menu of the type listing of categories in your module's hikashop options.

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

Time to create page: 0.249 seconds
Powered by Kunena Forum