Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

JoomSEF and VirtueMart Products Categories module
(1 viewing) (1) Guest
Support forum for users using free edition of JoomSEF 3 (Joomla 1.5 compatible). These forums are mainly for mutual help between users.

Please note that due to our capacity limitations, we do not monitor these forums regularly.
  • Page:
  • 1

TOPIC: JoomSEF and VirtueMart Products Categories module

JoomSEF and VirtueMart Products Categories module 15 years, 6 months ago #5091

Hello,

I use mod_product_categories with JSCook menu. I have some problem with this menu after turning on JoomSEF with VirtueMart plugin (problem does not appear when JoomSEF is off).

I've do some research and found that script which generates the menu behaves like it does not get value of one variable when its value is equall to 0. The Real Url is:
index.php?option=com_virtuemart&TreeId=0&category_id=6&page=shop.browse
but script behaves like it get
index.php?option=com_virtuemart&category_id=6&page=shop.browse

Is it possible that JoomSEF or VirtueMart plugin ignores the variable?

Best regards,
Łukasz Indeka
Last Edit: 15 years, 6 months ago by lindeka.

Re:JoomSEF and VirtueMart Products Categories module 15 years, 6 months ago #5098

I have a similar problem but I am using mod_product_list rather than the categories module.

This is available from i-onepage.com/freesoft/

It is a very,very useful module but if you have SEF enabled all URLs still have the standard VM junk.

Basically, Artio SEF is not generated for any URL that this module generates. I think this is because the developer has bypassed the standard VM method of generating the URL instead going for a hard-coded version of the same.

If anyone has any ideas as how to make it SEF friendly then please let me know. A donation will be forthcoming for the correct answer. I'be been in touch with Ken Wong, the developer but no response so far.

I have pasted the whole code here. The module is a small one.

<?php
/**
* Module Name : Products List Module
* Create By : Ken Wong (designer@i-onepage.com)
* Create Date : Dec 2007
* @version $Id: mod_login.php 7211 2007-04-29 02:26:51Z robs $
* @package Joomla
* @copyright Copyright (C) 2005 Open Source Matters. All rights reserved.
* @license www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

//Get configurable parameters

echo "<form name='product_list_form' id='product_list_form' method='post' action='index.php'>\n";

$categoryOrder = $params->get('category_order',0);
$categoryOrderDirection=$params->get('category_order_direction',0);
$productOrder=$params->get('product_order',0);
$productOrderDirection=$params->get('product_order_direction',0);

$showProduct=$params->get('show_product',0);
$fromDate=$params->get('from_date',null);
$toDate=$params->get('to_date',null);


$arrFromDate=explode('-',$fromDate);
$arrToDate=explode('-',$toDate);




if($showProduct==2)
{
$fromDateTimeStamp=mktime(0,0,0,$arrFromDate[0],$arrFromDate[1],$arrFromDate[2]);
$toDateTimeStamp=mktime(0,0,0,$arrToDate[0],$arrToDate[1],$arrToDate[2]);
}


//Get category list

$sql="Select
a.category_id as id,
a.category_name As name,
b.category_parent_id As parent
From #__vm_category As a
Inner Join #__vm_category_xref As b
On a.category_id=b.category_child_id
Where a.category_publish='Y'
";


if($categoryOrder==0)
{
$sql.=" Order by a.category_name ";
}
else
{
$sql.=" Order by a.list_order ";
}

if($categoryOrderDirection==0)
{
$sql.=" ASC ";
}
else
{
$sql.=" DESC ";
}


$where=array();

if($showProduct!=0)
{
$where[]="a.product_publish='Y'";
}

if($showProduct==2)
{
$where[]=" (a.cdate >=$fromDateTimeStamp And a.cdate <= $toDateTimeStamp )";
}















$database->setQuery($sql);
$rowProductCategories=$database->loadObjectList();

$sql="Select a.product_id+10000 as id,a.product_name As name,b.category_id as parent
From #__vm_product As a
Inner Join #__vm_product_category_xref As b
On a.product_id=b.product_id
";



if(count($where))

$sql.=" Where ".implode(" AND ",$where);


if($productOrder==0)
{
$sql.=" Order By product_name ";

}
elseif ($productOrder==1)
{
$sql.=" Order By product_sku ";
}
else
{
$sql.=" Order By cdate ";
}


if($productOrderDirection==0)
{
$sql.=" ASC ";
}
else
{
$sql.=" DESC ";
}

$database->setQuery($sql);

$rowproducts=$database->loadObjectList();

$rowproducts=array_merge($rowProductCategories,$rowproducts);


$cid=mosGetParam($_REQUEST,'cid',0);
$preload=array();
$preload[]=mosHTML::makeOption(0,"Select item");
echo mosHTML::treeSelectList(&$rowproducts,0,$preload,'cid','onchange="gotoVMPage();"','value','text',$cid);
echo "</form>";

/**
* DAEB - 10th October 2008 changed the URL code below. The item ID now points to the item 35 which is what the shop actually uses when Artio SEF tool is off.
* when the item id was set to 1 it caused the pathway to be missing the 'home' link. Set the URL to be exactly what is normally generated by VM
* and it now shows the pathway correctly
*/


?>

<script language="javascript">
function gotoVMPage()
{
var id=document.product_list_form.cid.value;
cid=id;
if(id>10000)
{
//productpage
id=id-10000;
url='index.php?page=shop.product_details&flypage=shop.flypage&product_id='+id+'&manufacturer_id=0&option=com_virtuemart&Itemid=53&cid='+cid;
}
else
{
url='index.php?page=shop.browse&category_id='+id+'&option=com_virtuemart&Itemid=1&cid='+cid;
}
location.href=url;
}
</script>

Re:JoomSEF and VirtueMart Products Categories module 15 years, 6 months ago #5115

I have had a new version of Ken Wong's "products in list form" module modified to be SEF (Search engine friendly). I have used this mod_product_list on more than one site and it is very useful indeed providing functionality that is missing from core Virtuemart. However, on the original there were two problems, firstly, the URL's the mod generates are not SEF friendly and are ignored by tools such as Artio SEF. This is the module's fault as the original generates the URL's in a hard-coded fashion rather than using the vm_parser to generate the URLs as a VM component would normally do. Secondly, the hard-coded URL has the item id set to 1 which causes the pathway to be missing the 'home' link. This caused formatting problems on my templates that have a pathway showing. I had the code changed so that this version is now fully SEF compliant and will work with SEF packages that generate human-friendly URLs such Artio JoomSEF. This updated version is now a good module and indispensable on a VM shop.

You can get the modified version here: lightquick.co.uk/downloads/view.download-11.html
  • Page:
  • 1
User Login Empty