Author Topic: URLs  (Read 1169 times)

jakey

  • Beginner
  • *
  • Posts: 10
URLs
« on: May 22, 2011, 10:11:43 am »
Hi there

Im trying to work out how the URLs are built as they are displaying incorrectly when going forwards and backwards in the products.

You can see here that the URL indicates that we are in the correct category "light pop design"
http://www.fairartisan.com/index.php/light-pop-design?page=shop.product_details&flypage=flypage_images.tpl&product_id=21&category_id=5

However on the same page the forward and back links are similar to this
http://www.fairartisan.com/index.php/skavanker?page=shop.product_details&product_id=23&flypage=flypage_images.tpl&pop=0
As you can see here it is displaying the skavanker category, even though the product is in the light pop deisgn category. 

I just cant work out why this is so, or how to change it.  When i turn off the SEO friendly URLS in Joomla i get URLS without the category as follows
http://www.fairartisan.com/index.php?page=shop.product_details&flypage=flypage_images.tpl&product_id=21&category_id=5&option=com_virtuemart&Itemid=58

Is there anyway possible to fix this?  The client wants to keep SEO friendly URLS but have them display correctly or at least with index.php/artisan? as opposed to turning off SEF URLs.  Im just curious as to how it managed to get skavanker as the default in the first place?

Kind Regards
Jacob

jakey

  • Beginner
  • *
  • Posts: 10
Re: URLs
« Reply #1 on: May 23, 2011, 05:05:19 am »
Can anyone help with this?  Am i reading in the wrong places?  All i need to know is how to make the forward and backward links the correct category name.  Im not sure why it is using the skavanker category name. 

jakey

  • Beginner
  • *
  • Posts: 10

jakey

  • Beginner
  • *
  • Posts: 10
Re: URLs
« Reply #3 on: May 25, 2011, 16:06:12 pm »
Just in case anyone else has this problem i found the solution here
http://forum.virtuemart.net/index.php?topic=61120.0

just copy and paste this over the old function in ps__session.php
administrator\components\com_virtuemart\classes\ps_session.php


Code: [Select]
function getShopItemid() {


    
    if( empty( $_REQUEST['shopItemid'] )) {
    
      if( !empty( $_REQUEST['Itemid'] ))//<------- ???MY_FIX
      {
          $_REQUEST['shopItemid'] = $_REQUEST['Itemid'];
          return intval($_REQUEST['shopItemid']);
      }
      
$db = new ps_DB;
$db->query( "SELECT id FROM #__menu WHERE link='index.php?option=com_virtuemart' AND published=1");
if( $db->next_record() ) {
$_REQUEST['shopItemid'] = $db->f("id");
}
else {
if( !empty( $_REQUEST['Itemid'] )) {
$_REQUEST['shopItemid'] = intval( $_REQUEST['Itemid'] );
}
else {
$_REQUEST['shopItemid'] = 1;
}
}
}

return intval($_REQUEST['shopItemid']);

}