Tuesday, May 17, 2011

Virtuemart multilingual product search with joomfish

To search product in virtuemart multilingualy, you have to change shop_browse_quiries.php file located in administrator/component/com_virtuemart/html

1. You have to insert array element in $join_array like

$join_array = array(
'LEFT JOIN `#__{vm}_product_price` ON `#__{vm}_product`.`product_id` = `#__{vm}_product_price`.`product_id`',
'LEFT JOIN `#__jf_content` ON `jos_jf_content`.`reference_id` = `#__{vm}_product`.`product_id`'
);

I inserted 2nd element which will be joined later by VM search operation


2. I added $sq .= "\n (`#__jf_content`.`value` LIKE '%$searchstring%' AND reference_table='vm_product' AND reference_field='product_name') OR "; to get result against product name

for( $keywordArr as $searchstring ) {
$sq .= "\n (`#__{vm}_product`.`product_name` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_sku` LIKE '%$searchstring%' OR ";
$sq .= "\n (`#__jf_content`.`value` LIKE '%$searchstring%' AND reference_table='vm_product' AND reference_field='product_name') OR ";
$sq .= "\n `#__{vm}_product`.`product_s_desc` LIKE '%$searchstring%' OR ";
$sq .= "\n `#__{vm}_product`.`product_desc` LIKE '%$searchstring%') ";

if( $i++ < $numKeywords ) {
$sq .= "\n AND ";
}
}

Sunday, May 8, 2011

Word limiter plugin in joomla 1.5

String cutter or Word limiter plugin in joomla 1.5

String will be sliced in such a way that no word will be cut off, You can specify text extension(i,e ... or >>) and character limit also.

How to use and install:
  • Download the plugin (in zip formate) and install and enable it from your joomla administrator
  • Example usages in your code:

$str = 'Bangladesh is a small country';
$mainframe->triggerEvent('wordLimiter',array(&$str,19,"..."));
echo $str;


- Where $str is the string to be sliced and 19 is the character limit and ... is the extension
- Output: Bangladesh is a...

Here is download URL: http://dc365.4shared.com/download/uxFV2P2u/plg-wordlimiter-v10.zip?tsid=20110509-001532-35b2f7a9

Please read the Readme.txt file for details.