News:

Looking for documentation? Take a look on our wiki

Main Menu

Error in the building of product url in Virtuemart Products Module

Started by radu4us, January 04, 2013, 20:39:06 PM

Previous topic - Next topic

radu4us

Hi,

I'm using joomla 2.5.8 and Virtuemart 2.0.16 and I encountered this error in Products Module:

The url of the products displayed in the module differs according to the category being browsed.

To be more specific:

a product that has the url:
  /index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=21&virtuemart_category_id=13

changes the category id in the url like this:

when browsing category  14 the url changes to:
   /index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=21&virtuemart_category_id=14&Itemid=564

when browsing category 6 the url changes to:
  /index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=21&virtuemart_category_id=6&Itemid=536

Can anyone help please?

jjk

Looks like you have assigned your product to more than one category, so the category id of course changes when you look at it in a different category.
Concerning itemid, see here: http://www.ostraining.com/blog/joomla/what-is-the-joomla-itemid/
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

radu4us

No, it's not that. The majority of the products belong to one category.

I believe that the error lies in the virtuemart module and the way it builds the url. I think that what happens is that a new product url is being generated every time the module is being displayed on a page, and the error lies in taking the current category id instead of the original category id of the product.

I would say that it might be easier to use the $this->product->product_url instead of building it every time, but I'm not a programmer.

PRO

the product module build the url dynamicly.

Looking at the code it should be using ONLY 1 category ID. (the lowest category id assigned to)

I tested yesterday after seeing this thread, and I think building the url with

$product->link    might fix it

I can do it, but not until monday or something so you can try it



radu4us

OK, thanks.

I tried it myself but it resulted only in php errors, so I'll wait for your solution.