How to View SKU Number in Cart Page from Magento?

You just put Below code in your template file.

<td><?php echo $_item->getSku() ?> </td>

1. Go APP Directory –> template –> checkout –> cart –> item –> default.phtml

Here you place above code.

2. Go APP Directory –> template –> checkout –> cart.phtml

Inside your Heading Title.

that’s all.

How to find Magento skin image URL in .phtml page inside

Just put this code where you want:
$this->getSkinUrl(“images/sample.jpg”)

– This skin url code: $this->getSkinUrl

Example:

echo ‘.main { background:url(‘.$this->getSkinUrl(“images/sample.jpg”).’) 0 0 repeat-y !important}’;

<img src=”$this->getSkinUrl(“images/sample.jpg”)”>

How to find Magento Database name after installation?

Hi guys,

1. you go to ftp
2. Login your Domain
3. Go to app–>etc–>local.xml

There you can see below code there your database details stored.

<connection>
<host><![CDATA[yourhost]]></host>
<username><![CDATA[username]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[dbname]]></dbname>

</connection>

that’s all.

How to Read Javascript Via Query String?

Below I mention that Reading Query String Script:

<!– Query String Read Code Start
function querySt(queryValue) {
queryString = window.location.search.substring(1);
urlSplitQuery = queryString.split(“&”);
for (i=0;i<urlSplitQuery.length;i++) {
finalQueryTxt = urlSplitQuery[i].split(“=”);
if (finalQueryTxt[0] == queryValue) {
return finalQueryTxt[1];
}
}
}
var queryFunction = querySt(“queryFunction”);
//document.write(queryString);

// Query String Read Code End  –>

If you feel check conditon below i mention the query string condition:

if(queryString==”query”){
document.write(‘Yes query here’);
}
else{
document.write(‘no query’);
}

Simple coment hide script for WordPress Site?

<script type=”text/javascript” language=”javascript”>

//alert(document.getElementById(‘comments’));

var comLength = document.getElementById(“comments”).innerHTML;

/*alert(comLength);

alert(comLength.length);*/

if(comLength.length == “0”){

//alert(‘test’);

document.write(‘<style type=”text/css”>#comments{display:none;}</style>’);

}

else{

document.write(‘<style type=”text/css”>#comments{display:block;}</style>’);

//alert(“Test Else”+comLength.length);

}

</script>

IF IE CSS Menu not Working?

You Can use below doctype in your html page inside.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

this is working good one.

How to create 3 column or Row Latest Post Via WP?

Hi,

Below code useful for all this is very nice one in WordPress.
<div>
<h2>Latest News</h2>
<?php
//$args = array(‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘category’ => 6, ‘order’=> ‘DESC’); //This Categories wise latest post display
$args = array(‘orderby’ => ‘date’, ‘numberposts’ => 3, ‘order’=> ‘DESC’); // This all post display
$postslist = get_posts( $args );
$i; //This is counting the iteam purpose using
foreach ($postslist as $post) :  setup_postdata($post);
$i++; // This is increasing howmany foreach going that is purpose using.
?>
<div>
<h2><a href=”<?php echo get_permalink($page->ID); ?>”><?php the_title(); ?></a></h2>
<?php //the_date(); ?>
<?php //echo get_the_post_thumbnail($page->ID, ‘thumbnail’);?>
<?php echo get_the_post_thumbnail($page->ID, ‘full’); ?>
<?php the_excerpt(); ?>
</div>
<?php endforeach; ?>
</div><!– Latest News Container End –>

How to solve this : You don’t have permission to access /phpmyadmin/ on this server

Just go to your Wamp Directory insder “c:/wamp/alias/phpmyadmin.conf” — This path.

Here you can check this <Directory “c:/wamp/apps/phpmyadmin3.4.5/”> the phpmyadmin version is same in your c:/wamp/apps/

Then you see this file
1. AllowOverride All
2. “Deny from all” to “Allow from all”
3. “Order Deny,Allow” to “Order Allow,Deny”

that is all. Now its working. If this is not working then you go to check your ISS part.

How to get Current Page URL in via PHP?

<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;}
$pageURL .= “://”;
if ($_SERVER[“SERVER_PORT”] != “80”) {
$pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];
} else {
$pageURL .= $_SERVER[“SERVER_NAME”].$_SERVER[“REQUEST_URI”];
}
return $pageURL;
}

$url =  curPageURL();

//print_r(parse_url($url));

$URLpath = parse_url($url, PHP_URL_PATH);

$langPathAraay = explode(“/”, $URLpath);
$langPath = $langPathAraay[1];
//echo $langPath;

if($langPath == ‘agd_nl’){
//echo “here”;
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(108)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else if($langPath==”agd_be”){
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(98)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else if($langPath==”agd_befr”){
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(98)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else if($langPath==”agb_de”){
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(105)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else if($langPath==”agb_fr”){
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(106)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else if($langPath==”agb_gb”){
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(107)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
else{
echo $this->getLayout()->createBlock(‘catalog/product_list’)->setRowCount(1)->setCategoryId(108)->setTemplate(‘catalog/product/list.phtml’)->toHtml();
}
?>

How to read Current Browser URL via javascript?

<script language=”javascript” type=”text/javascript”>

function DinkyToy()
{
var pageURL = document.location.href;
var MyArray = pageURL.split(“?”)  ;
var BaseURL = MyArray[0];
var MyLangArray = pageURL.split(“/”);
var LangURL = MyLangArray[3];
/* Any variables would be appended */
/* using the ? and would appear in */
/* MyArray[1] */

//alert(‘pageURL = ‘ + pageURL)
//alert(‘BaseURL = ‘ + BaseURL)
alert(‘LangURL = ‘ + LangURL)

}
window.onload = DinkyToy();
</script>

© 2020 Spirituality