Custom Ajax file in Joomla

    define('_JEXEC', 1);
    define('JPATH_BASE', realpath(dirname(__FILE__) . '/../../'));  
    require_once JPATH_BASE . '/includes/defines.php';
    require_once JPATH_BASE . '/includes/framework.php';

    $mainframe = JFactory::getApplication('site');
$db = JFactory::getDBO();
 $query = "SELECT distinct `customfield_value` FROM `jos_virtuemart_product_customfields` WHERE `virtuemart_custom_id` = '17'";
 //echo $query;
 $result = $db->loadObjectList();
 echo '<pre>';
 echo '</pre>';
Read More
Joomla, PHP

Controller Actions Dataobjects as Pages in Silver Stripe

What we’ll cover

  • What are controller actions, and how are they used?
  • Create a controller action to render a DataObject
  • Rendering a DataObject as a page
  • Adding pseudo-page behaviour to a DataObject

How controller actions work

Up to this point in our project, for the most part, every page has been on a single URL, which that URL points to a single controller, which renders a single $Layout template. However, if you think back to our lesson on forms, you may remember that we were able to extend the URL route for our controller in order to generate and render a form. We did this using a controller action. Forms are just one of many use cases for a controller action.

Using controller actions is simple...

Read More
PHP, Silver Stripe

Upgraded to Joomla 3.7 And Component Menu Items Disapeared

Steps to reproduce the issue

Upgraded manually to Joomla 3.7
Discovered upgrades and updated database
Cleared cache and made all Joomla components active
Was replicated on three different joomla upgrade websites

Expected result

Admin menu for components should not have changed

Actual result

Components menu made certain items like contacts and joomla upgrade disappear. Inconsistent menu items disappeared across the three websites – If I manually go to the url of the missing components, they still work, but they’re just gone in the admin menu.

Was that solved in 3.7.3? I just upgraded multiple sites (25 in total) from 3.7.2 to 3.7.3 and found out that some entries in the menu where missing...
Read More
Joomla, PHP

Adding Google Adsense ads to Joomla 3.x

Advertising on your site using Google Adsense is a simple way to earn money from your site visitors. This tutorial will describe how to place a Google Adsense ad on your Joomla! 3.1 site.

You will need the following:

  • The location on your site where you will be placing your ad. This depends entirely on how you want the ad to look (tall and skinny, short and wide, a box, etc.) and where the template you are using for your content pages has room.
  • A Google Adsense account ( In this account you should have created an ad of the size you want. I have several ads I use, the one I’m using in this tutorial is 120 pixels wide by 620 high.

In this example, the template I am using (Pixeldot from has a position labeled as “right” on the template...

Read More
Joomla, PHP

MySql Query for Codeigniter

Select Query

$clearEmiSql = “SELECT * FROM `tbl_mortgage_new_emi` WHERE `ID` >= ‘”.$emi_no.”‘ AND `emi_clear` = ‘1’ AND `mortgage_id` = ‘”.$mort_id.”‘”;
$clearEmiSql = $this->db->query($clearEmiSql);
$clearEmiResData = $clearEmiSql->result_array();

echo $this->db->last_query(); die;

Insert Query

$data_newEmi = array(
$this->mortgage_model->insert(‘tbl_mortgage_new_emi’, $data_newEmi);

Delete and Update Query

$sqlDeleteRow = “Delete from `tbl_mortgage_new_emi` where `mortgage_id` = ‘”.$mort_id.”‘ order by `ID` desc limit 1″;

Read More
Codeigniter, PHP

Change or Translate Text on a WordPress Theme

You may want to replace a line or two of text on your WordPress Theme. You can easily change or translate a text by adding this code on your WordPress Functions. If what you’re after is to actually translate the entire theme and not just a couple of words then read this post instead: How to add Language Files on a WordPress Child Theme

This code makes use of the gettext function. Replace Old Text with the string you want to change. This is case-sensitive so type it exactly as you see it on your WordPress Theme. Replace New Translation with your new text replacement. You can leave it blank if you want to remove the original text.

To change or translate a single string, add this code on your functions.php.

function ra_change_translate_text( $translated_text ) {
if ( $translated_text == ...

Read More
PHP, Wordpress

How to Install Laravel

  1. Install Laravel Framework in Windows *PHP version greater than 5.3.7 is required...
  2.  Download Laravel from:
  3. Extract Laravel into the www folder for WAMP (
  4. Download Composer from:
  5. Enable openssl from all php.ini files.
  6. Install Composer into the same directory php.exe is located.
  7. Click on WAMP icon->PHP->PHP Extensions and enable: php_openssl, php_curl, php_sockets.
  8. Click on wamp icon->Apache->Apache Modules and enable ssl_module
  9. Open cmd.
  10. Change into the directory where you extracted Laravel e.g: cd C:\wamp\www\laravel.
  11. Type the command: composer install.
  12. Click on wamp icon->Apache->Apache Modules and enable rewrite_mo...
Read More

Magento: How to check if current page is homepage?

Here is a quick Magento code to check if the current page is homepage or not.

If you are in template/page/html/header.phtml template file, then you can check for homepage with the following code:

Read More

How to Disable Source code

set in <body oncontextmenu=”return false” onselectstart=”return false” ondragstart=”return false”>

and set in bottom


document.onkeydown = function(e) {
if(e.keyCode == 123) {
return false;
if(e.ctrlKey && e.shiftKey && e.keyCode == ‘I’.charCodeAt(0)){
return false;
if(e.ctrlKey && e.shiftKey && e.keyCode == ‘J’.charCodeAt(0)){
return false;
if(e.ctrlKey && e.keyCode == ‘U’.charCodeAt(0)){
return false;

if(e.ctrlKey && e.shiftKey && e.keyCode == ‘C’.charCodeAt(0)){
return false;


Read More
Javascript, Jquery

Submitting Your First Request in Product Advertising API

To submit your first request to Product Advertising API

  1. Go to the Product Advertising API Scratchpad.
  2. Choose an operation, for example ItemSearch.
  3. Under Common parameters, choose your marketplace and type your credentials.
  4. Choose your request parameters. For example, for the Keywords parameter, type “Harry Potter” and then click Run request.
  5. Under Request URL, your unsigned and request URL appear.
  6. Under Response, locate your response examples.

Congratulations! You just made your first Product Advertising API request.

Read More