This is the code:
<?php $mydoc =& JFactory::getDocument(); $mytitle = $mydoc->getTitle(); ?>
Programming and scripting topics.
This is the code:
<?php $mydoc =& JFactory::getDocument(); $mytitle = $mydoc->getTitle(); ?>
If you want to change the look of the Joomla search module and Joomla search component:
Copy the file:
/components/com_search/views/search/tmpl/default.php
to
/templates/my_template/html/com_search/search/default.php
Now make a few changes in that file and refresh your site.
In a similar fashion, you can also override the Search Module layout file. Copy the file:
/modules/mod_search/tmpl/default.php
to
/templates/my_template/html/mod_search/default.php
To add custom article submission field:
Files needed to edit:
i. jos_content table in joomla database
ii. root/components/com_content/views/article/tmpl/default.php
iii. root/components/com_content/views/article/tmpl/form.php
iv. root/administrator/components/com_content/models/article.xml
v. root/administrator/components/admin.content.html.php
vi. root/administrator/components/config.xml
vii. root/libraries/joomla/database/table/content.php
Let’s add two additional fields in the form of comments: Town (City) and AcceptTerms (I agree with the rules). the user will need to check.
Отворете
your-site/libraries/joomla/database/table/user.php
намерете тези редове:
$xid = intval( $this->_db->loadResult() );
if ($xid && $xid != intval( $this->id )) {
$this->setError( JText::_( ‘WARNREG_EMAIL_INUSE’ ) );
return false;
}
и ги коментирайте.
If you don’t want all your search results to open on the front page of your website just use this hack. After it they will open on a separate page.
Just open your-site/components/com_search/controller.php
Find this part:
To do this open the the your 1.5. Joomla template index.php
find this line of code:
<jdoc:include type="component" />
and change it to this:
<?php if (JRequest::getVar('view') != 'frontpage'): ?>
<div>
<jdoc:include type="component" />
</div>
<?php endif ?>
First I’ll try to explain what needs to be achieved. If you have a big online store and you try to remember all your distributors (people and companies which you take your goods from and then you sell these goods to the customers) it won’t be easy. Especially if there are more people working in your online shop. So the issue is that virtuemart doesn’t have distributors support. What needs to be done is write an extension to virtuemart which will add distributors to the menu of modules (manufacturers, tax rates, vendors, ets.).
just use
$Itemid = JRequest::getInt( ‘Itemid’);
To do this first read this post:
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