Author Topic: Related products acts weird  (Read 2268 times)

ztolley

  • Beginner
  • *
  • Posts: 8
Related products acts weird
« on: October 09, 2009, 23:29:06 pm »
I have a small shop I'm setting up. In my example I have 2 products, product a and product b. I edit product a to say that its related to product b. I edit product b to say its related to product a.

The weird thing is, if I view product a it shows me product b in a related products section. If I view product b, there is no related products section. I can't understand why, neither product is currently available... doesn't make sense.

Is there anything simple I should check when relating products?

Is there any way I can find the underlying sql query sent to the DB to compare the 2 queries and the data to maybe figure out why its not working

Scar

  • Full Member
  • ***
  • Posts: 1035
    • J-lux
Re: Related products acts weird
« Reply #1 on: October 10, 2009, 15:27:57 pm »
Quote
If I view product b, there is no related products section.
Make sure your flypage has a related product variable.

ztolley

  • Beginner
  • *
  • Posts: 8
Re: Related products acts weird
« Reply #2 on: October 12, 2009, 22:39:58 pm »
Yup, as I say, for some products marked related it works, for others it doesn't.... its weird

   echo '<div class="relatedProduct">' . $related_products . '</div>';

Scar

  • Full Member
  • ***
  • Posts: 1035
    • J-lux
Re: Related products acts weird
« Reply #3 on: October 12, 2009, 22:43:25 pm »
So are they in the same category? Otherwise you can have different flypages. Can you give a URL and tell which products are related?

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10437
  • VirtueMart Version: 3+
Re: Related products acts weird
« Reply #4 on: October 12, 2009, 23:05:31 pm »
Yup, as I say, for some products marked related it works, for others it doesn't.... its weird

   echo '<div class="relatedProduct">' . $related_products . '</div>';

What theme are you using?

<div class="relatedProduct"><?php echo $related_products ?></div>

ztolley

  • Beginner
  • *
  • Posts: 8
Re: Related products acts weird
« Reply #5 on: October 13, 2009, 11:08:59 am »
One I am developing myself.

I prefare to create pages that have well structured html and leave the layout to the css :)

ztolley

  • Beginner
  • *
  • Posts: 8
Re: Related products acts weird
« Reply #6 on: October 13, 2009, 11:11:05 am »
The template i have is based on the default one though. I checked debug option for joomla and amongst the sql I found the bit that looks for related products

SELECT product_sku, related_products
  FROM pip_vm_product,pip_vm_product_relations
  WHERE pip_vm_product_relations.product_id='11'
  AND product_publish='Y'
  AND FIND_IN_SET(pip_vm_product.product_id, REPLACE(related_products, '|', ',' ))
  LIMIT 0, 4

So next step is to see if this results in anything from a mysql prompt and to the code to make sure I'm using the right variable, but I'm 'sure I've seen some pages show related and some not, and they use the same flypage

ztolley

  • Beginner
  • *
  • Posts: 8
Re: Related products acts weird
« Reply #7 on: October 13, 2009, 13:26:43 pm »
ok looks like its working now...

Mixup between products and a line that was commented out previously and didn't uncomment it... :)