Author Topic: products belong in multiple categories=>product pathway takes wrong path  (Read 15531 times)

Marc O.

  • Jr. Member
  • **
  • Posts: 78
    • Onrust Yacht Charters
Re: products belong in multiple categories=>product pathway takes wrong path
« Reply #15 on: January 22, 2009, 20:56:54 pm »
@Marc 0:
Hi Marc, I wonder, on your site, under 'New Charter Yachts in our Fleet', what is this positions with the 4 yachts? Is this a module, or what? How did you put it there, it appears in all category browse pages. What is the common denominator, I mean the place to put such a box with 3-4 images?
regards,
darenGR

It's a module called mod_virtuemart_latestprod that I published in user1. You can set it to display the n latest products and also set it to display horizontally, vertically or in a table (x * y).

darengr

  • Beginner
  • *
  • Posts: 44
Re: products belong in multiple categories=>product pathway takes wrong path
« Reply #16 on: January 23, 2009, 10:15:23 am »
ok, and which template are you using?

Marc O.

  • Jr. Member
  • **
  • Posts: 78
    • Onrust Yacht Charters
Re: products belong in multiple categories=>product pathway takes wrong path
« Reply #17 on: January 23, 2009, 10:22:39 am »
It's rhuk_solarflare_3

gocartgo

  • Beginner
  • *
  • Posts: 28
I tried this code and I am not sure it did anything for my problem.

When using Previous and Next, it steps through all the products in the category I started browsing in. This is good.

Each products breadcrumb shows another category than the one I am browsing. This is bad.

The customer likely will not notice that they are seeing products in their desired category, but they will see the breadcrumb change to other categories with each click.

Regards

gocartgo

  • Beginner
  • *
  • Posts: 28
>> Each products breadcrumb shows another category than the one I am browsing. This is bad.

The breadcrumb shows the first category of each product instead of the category being browsed.

Regards

Blakharaz

  • Beginner
  • *
  • Posts: 9
Re: products belong in multiple categories=>product pathway takes wrong path
« Reply #20 on: September 23, 2010, 22:19:50 pm »
for next and previous the few lines of code worked well. :)
But I would like to know if it's possible to change the breadcrumb that it shows the actual path and not the path to the first category assigned to a product?


Blakharaz

  • Beginner
  • *
  • Posts: 9
Re: products belong in multiple categories=>product pathway takes wrong path
« Reply #21 on: September 23, 2010, 22:35:38 pm »
to fix this fast was very easy.

I commented this line out
Quote
$_GET['category_id'] = $category_id = $db->f("category_id");
from following part.

Quote
if (empty($category_id) || empty( $flypage ))  {
    $q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '$product_id' AND c.category_id=cx.category_id LIMIT 0,1";
    $db->query( $q );
    $db->next_record();
    if( !$db->f("category_id") ) {
        // The Product Has no category entry and must be a Child Product
        // So let's get the Parent Product
        $q = "SELECT product_id FROM #__{vm}_product WHERE product_id = '".$db_product->f("product_parent_id")."' LIMIT 0,1";
        $db->query( $q );
        $db->next_record();

        $q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '".$db->f("product_id")."' AND c.category_id=cx.category_id LIMIT 0,1";
        $db->query( $q );
        $db->next_record();
    }
    $_GET['category_id'] = $category_id = $db->f("category_id");
}

But I'm a little bit confused why the already existing category_id is overwritten by that sql query because in the beginning there is the if empty category_id
Quote
if (empty($category_id) || empty( $flypage ))