Skip to content

Author: admin

How to add a link to the manufacturer, for each product in the virtuemart caregory browse page?

To do this first read this post:

http://www.pcinvent.net/technology/programming/how-to-hack-manufacture-name-in-virtuemart-browse-page-template

where it is explained: How to hack Manufacture Name in Virtuemart Browse Page Template?

Then step by step explanation:

1. open your: ps_product.php

and add this function:

/**
* Functon to get the id of the manufacturer this product is assigned to
*
* @param int $product_id
* @return string the manufacturer id
*/
function get_mf_id($product_id) {
$db = new ps_DB;

$q = “SELECT mf_name,#__{vm}_manufacturer.manufacturer_id FROM #__{vm}_product_mf_xref,#__{vm}_manufacturer “;
$q .= “WHERE product_id=’$product_id’ “;
$q .= “AND #__{vm}_manufacturer.manufacturer_id=#__{vm}_product_mf_xref.manufacturer_id”;

$db->query($q);
$db->next_record();
if ($db->f(“manufacturer_id”)) {
return $db->f(“manufacturer_id”);
}
else {
return “”;
}
}

2.  Then open shop.browse.php and add this lines:

$mf_id = $ps_product->get_mf_id( $db_browse->f(‘product_id’) );
$tpl->set( ‘mf_id’, $mf_id );

after:

//The Code below is written by Andy Ng <  Andy@PCinvent.infoThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it >
//Please keep the above author credit line
$mf_name = $ps_product->get_mf_name( $db_browse->f(‘product_id’) );
$tpl->set(‘mf_name’,$mf_name);

3.  Add this line in shop.browse.php:

$products[$i][‘manufacturer_id’] = $mf_id;

somewhere after:

$products[$i][‘cdate’] = $VM_LANG->convert( vmFormatDate($db_browse->f(“cdate”), $VM_LANG->_(‘DATE_FORMAT_LC’) ));
$products[$i][‘mdate’] = $VM_LANG->convert( vmFormatDate($db_browse->f(“mdate”), $VM_LANG->_(‘DATE_FORMAT_LC’) ));
$products[$i][‘product_url’] = $db_browse->f(“product_url”);

4.  Add thil core into your browse page:

<a href=”<?php echo $sess->url( URL.”index.php?option=com_virtuemart&page=shop.browse&manufacturer_id=”. $manufacturer_id ) ?>”>
<?php echo $mf_name; ?>
</a>

that should be it.

It works for VM 1.1.2

Как да прочета и променя файлове с разширение “.mo”

За да четете и променяте .mo файлове под Windows трябва да инсталирате dxgettext-1.2.2.exe. Програмата добавя контекстно меню в Windows. След това с десен бутон върху .mo файла и го конвертирате в .po файл, който вече може спокойно да редактирате с Notepad++. След което отново го конвертирате в .mo файл и готово.

How to add an if statement for IE custom CSS in Joomla template index.php

Sometimes the your website looks different in IE and in Firefox. To avoid the problem put this piece of code in your Joomla template index.php file to overwrite the CSS for the div (in this example search-button):

<!–[if lte IE 6]>

<style type=”text/css”>

#search-button{

padding-top:6px;

}

</style>

<![endif]–>

<!–[if gte IE 7.0]>

<style type=”text/css”>

#search-button{

padding-top:6px;

}

</style>

<![endif]–>

Как да споделим интернета между два компютъра

Как да си споделим интернета
Темата е от http://hardwarebg.com/forum/showthread.php?t=69264
Стори ми се доста полезна затова реших да я постна и аз…

Здравейте!
Пиша тази тема, за всички които мразят да четат по 100 пъти едно и също. Нов съм във форума, но го следя от доста време, просто не се решавах да се регистрирам.
Предлагам да минем на въпроса:
Как да си споделим интернета?

How to add a new module positions in Joomla 1.5

On the joomla 1.0.x series we could add new module positions on the joomla installation via Template manager- module positions (total 50 places).

How can we do this in joomla 1.5 ?

In joomla 1.5 you have to add the module positions within the templatedetails.xml

On the joomla 1.0.x series we could add new module positions on the joomla installation via Template manager- module positions (total 50 places).

How can we do this in joomla 1.5 ?

In joomla 1.5 you have to add the module positions within the templatedetails.xml

Pickaxe – The Cascadia Free State Story

Една история за безумната сеч на дървета в защитени територии, провеждана от правителството на САЩ през 90-те. Същото се случва в момента и в България със всички гори, а глобалното затопляне е вече факт…