Z:\p\app\design\frontend\base\default --- copy all
Z:\angelsincrib\app\design\frontend\default\angelsincrib --- paste to here
Z:\angelsincrib\skin\frontend\default\ create folder ---- angelsincrib
Z:\angelsincrib\skin\frontend\base\default --- copy all
Z:\angelsincrib\skin\frontend\default\angelsincrib ----- paste to all
Z:\angelsincrib\skin\frontend\default\default ---- copy all
Z:\angelsincrib\skin\frontend\default\angelsincrib --- paste to here and overwrite all
Goto admin System->configuration->leftside Design -> themes (translations->angelsincrib, Templates->angelsincrib, Skin (Images / CSS) ->angelsincrib,Layout->angelsincrib)
Now System -> Cache management -> Select All -> Actions=disable->Submit
Now System -> Index Management -> Select All -> Actions=Reindex Data->Submit
Research and Development work on PHP, MYSQ,JQuery,Angular Js,React Native,Laravel,Wordpress,Magento,Joomla
Sunday, July 8, 2012
How to get price symbol of current store in magento?
Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol();
Mage::helper('checkout')->formatPrice($this->getSubtotal())
Mage::helper('checkout')->formatPrice($this->getSubtotal())
How to get all subcategory details of current category in magento?
function fnGetSubCategories($intParentCategoryId) { $objData = Mage::getSingleton('core/resource')->getConnection('core_write'); $sqlQuery = " SELECT distinct(cce.entity_id) FROM catalog_category_entity cce INNER JOIN catalog_category_entity_int ccei ON cce.entity_id = ccei.entity_id WHERE cce.parent_id = '".$intParentCategoryId."' AND ccei.attribute_id = 119 AND ccei.value = 1 ORDER BY cce.position ASC"; $arrSubCategories = array(); $resSubcategories = $objData->query($sqlQuery); $arrAllSubcategories = $resSubcategories->fetchAll(PDO::FETCH_ASSOC); if(count($arrAllSubcategories)) { foreach($arrAllSubcategories as $aSubCat) { $arrSubCategories[] = $aSubCat['entity_id']; } } return $arrSubCategories;
}
}
Magento Pagination Without Toolbar?
Add the below code to your end of "template/catalog/product/list.phtml" file
$toolbar = $this->getToolbarBlock();
$toolbar->setCollection($_productCollection);
if($toolbar->getCollection()->getSize() > 0):
echo $toolbar->getPagerHtml(); //Pager
echo $toolbar-> __('Items %s to %s of %s total', $toolbar->getFirstNum(), $toolbar->getLastNum(),
$toolbar ->getTotalNum());
endif;
$toolbar = $this->getToolbarBlock();
$toolbar->setCollection($_productCollection);
if($toolbar->getCollection()->getSize() > 0):
echo $toolbar->getPagerHtml(); //Pager
echo $toolbar-> __('Items %s to %s of %s total', $toolbar->getFirstNum(), $toolbar->getLastNum(),
$toolbar ->getTotalNum());
endif;
How to show total shopping cart price in Header Magento?
$count = $this->helper('checkout/cart')->getSummaryCount(); //get total items in cart
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
Magento Pagination Without Toolbar?
Add the below code to your end of "template/catalog/product/list.phtml" file
$toolbar = $this->getToolbarBlock();
$toolbar->setCollection($_productCollection);
if($toolbar->getCollection()->getSize() > 0):
echo $toolbar->getPagerHtml(); //Pager
echo $toolbar-> __('Items %s to %s of %s total', $toolbar->getFirstNum(), $toolbar->getLastNum(),
$toolbar ->getTotalNum());
endif;
$toolbar = $this->getToolbarBlock();
$toolbar->setCollection($_productCollection);
if($toolbar->getCollection()->getSize() > 0):
echo $toolbar->getPagerHtml(); //Pager
echo $toolbar-> __('Items %s to %s of %s total', $toolbar->getFirstNum(), $toolbar->getLastNum(),
$toolbar ->getTotalNum());
endif;
How to show total shopping cart price in Header Magento?
$count = $this->helper('checkout/cart')->getSummaryCount(); //get total items in cart
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
$total = $this->helper('checkout/cart')->getQuote()->getGrandTotal(); //get total price
if($count==0)
{
echo $this->__('Items: %s',$count);
}
if($count==1)
{
echo $this->__(' Item: %s',$count);
}
if($count>1)
{
echo $this->__(' Items: %s',$count);
}
echo $this->__(' Total: %s', $this->helper('core')->formatPrice($total, false));
How to remove index.php from URL magento?
If you are using Magento and in your shop URL, if you see “index.php” and wanted to remove it then here is the solution.
- Login to Magento admin panel
- Go to System -> Configuration -> Web -> Search Engines Optimization -> Use Web Server Rewrites
- Select ‘Yes’ from the selection list and Save.
- Goto your site root folder and you can find the .htaccess file. Just edit that. Open it on a text editor and find this line, #Rewrite Base /magento/ . Just replace it with Rewrite Base / .
- Then goto your Cache Management page ( System > Cache Management) and refresh your Cache and also refresh the Web Redirects.
And, you are done. Now, index.php is gone from your Magento shop URL.
- Login to Magento admin panel
- Go to System -> Configuration -> Web -> Search Engines Optimization -> Use Web Server Rewrites
- Select ‘Yes’ from the selection list and Save.
- Goto your site root folder and you can find the .htaccess file. Just edit that. Open it on a text editor and find this line, #Rewrite Base /magento/ . Just replace it with Rewrite Base / .
- Then goto your Cache Management page ( System > Cache Management) and refresh your Cache and also refresh the Web Redirects.
And, you are done. Now, index.php is gone from your Magento shop URL.
How to send email easily in magento?
public function sendEmail()
{
$fromEmail = "from@example.com"; // sender email address
$fromName = "John Doe"; // sender name
$toEmail = "to@example.com"; // recipient email address
$toName = "Mark Doe"; // recipient name
$body = "This is Test Email!"; // body text
$subject = "Test Subject"; // subject text
$mail = new Zend_Mail();
$mail->setBodyText($body);
$mail->setFrom($fromEmail, $fromName);
$mail->addTo($toEmail, $toName);
$mail->setSubject($subject);
try
{
$mail->send();
}
catch(Exception $ex)
{
// If you are using this code in your custom module use 'yourmodule' name.
// If not, you may keep 'customer' instead of 'yourmodule'.
Mage::getSingleton('core/session')
->addError(Mage::helper('yourmodule')
->__('Unable to send email.'));
}
}
{
$fromEmail = "from@example.com"; // sender email address
$fromName = "John Doe"; // sender name
$toEmail = "to@example.com"; // recipient email address
$toName = "Mark Doe"; // recipient name
$body = "This is Test Email!"; // body text
$subject = "Test Subject"; // subject text
$mail = new Zend_Mail();
$mail->setBodyText($body);
$mail->setFrom($fromEmail, $fromName);
$mail->addTo($toEmail, $toName);
$mail->setSubject($subject);
try
{
$mail->send();
}
catch(Exception $ex)
{
// If you are using this code in your custom module use 'yourmodule' name.
// If not, you may keep 'customer' instead of 'yourmodule'.
Mage::getSingleton('core/session')
->addError(Mage::helper('yourmodule')
->__('Unable to send email.'));
}
}
Get Customer Shipping/Billing Address
$customerAddressId = Mage::getSingleton('customer/session') ->getCustomer() ->getDefaultShipping();
if ($customerAddressId)
{
$address = Mage::getModel('customer/address')->load($customerAddressId);
}
else
{
$address = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
}
if ($customerAddressId)
{
$address = Mage::getModel('customer/address')->load($customerAddressId);
}
else
{
$address = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
}
How to speed up Magento?
Many Magento users faces the site loading problem. If we have larger amount of data the magento site becomes down. The recommended way to speed up Magento's performance is to enable its Compilation function. The performance increase is between 25%-50% on page loads.
You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.
You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.
How to show only first name in magento welcome message?
$customer = Mage::getSingleton('customer/session')->getCustomer()->getData();
if(Mage::getSingleton('customer/session')->isLoggedIn())
{
echo $this->__('Welcome, %s!', $customer['firstname']);
}
else
{
echo $this->__('Welcome Guest');
}
if(Mage::getSingleton('customer/session')->isLoggedIn())
{
echo $this->__('Welcome, %s!', $customer['firstname']);
}
else
{
echo $this->__('Welcome Guest');
}
How to get Most Viewed products in Magento?
$productCount = 5;
$storeId = Mage::app()->getStore()->getId();
$products = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->addStoreFilter($storeId) ->addViewsCount() ->setPageSize($productCount);
Mage::getSingleton('catalog/product_status') ->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility') ->addVisibleInCatalogFilterToCollection($products);
print_r($products);
$storeId = Mage::app()->getStore()->getId();
$products = Mage::getResourceModel('reports/product_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->addStoreFilter($storeId) ->addViewsCount() ->setPageSize($productCount);
Mage::getSingleton('catalog/product_status') ->addVisibleFilterToCollection($products);
Mage::getSingleton('catalog/product_visibility') ->addVisibleInCatalogFilterToCollection($products);
print_r($products);
How to interchange the left and right column sidebar in magento?
how to get all attribute details
$objEavAttribute = Mage::getModel('catalog/product') -> getResource() -> getAttribute('manufacturer');
if($objEavAttribute->getFrontendInput() == 'select' || $objEavAttribute->getFrontendInput() == 'multiselect' || $objEavAttribute->getFrontendInput() == 'boolean')
{
echo $_product->getAttributeText($value);
}
else
{
echo $_product->getData($value);
}
if($objEavAttribute->getFrontendInput() == 'select' || $objEavAttribute->getFrontendInput() == 'multiselect' || $objEavAttribute->getFrontendInput() == 'boolean')
{
echo $_product->getAttributeText($value);
}
else
{
echo $_product->getData($value);
}
Custom javascript client side validation in magento on individual page
<script type="text/javascript" language="javascript">
var dataForm = new VarienForm('contactForm');
Validation.addAllThese(
[
['validate-number-tel', '<?php echo $this->__('Please Enter Valid telephone number and pincode') ?>', function(v) {
if(document.getElementById("telephone1").value == "" || document.getElementById("telephone2").value == "")
{
return false;
}
else
{
return true;
}
}],
['validate-captcha', 'Your Captcha Entry Mismatch', function(v) {
if(document.getElementById("hdnRandomString1").value != document.getElementById("recaptcha_response_field1").value)
{
return false;
}
else
{
return true;
}
}]
]
);
</script>
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
<script type="text/javascript" language="javascript">
function validateNumberKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key < 48 || key > 57 ) {
return false;
}
else return true;
}
</script>
var dataForm = new VarienForm('contactForm');
Validation.addAllThese(
[
['validate-number-tel', '<?php echo $this->__('Please Enter Valid telephone number and pincode') ?>', function(v) {
if(document.getElementById("telephone1").value == "" || document.getElementById("telephone2").value == "")
{
return false;
}
else
{
return true;
}
}],
['validate-captcha', 'Your Captcha Entry Mismatch', function(v) {
if(document.getElementById("hdnRandomString1").value != document.getElementById("recaptcha_response_field1").value)
{
return false;
}
else
{
return true;
}
}]
]
);
</script>
<script type="text/javascript">
//<![CDATA[
var contactForm = new VarienForm('contactForm', true);
//]]>
</script>
<script type="text/javascript" language="javascript">
function validateNumberKey(event) {
var key = window.event ? event.keyCode : event.which;
if (event.keyCode == 8 || event.keyCode == 46
|| event.keyCode == 37 || event.keyCode == 39 || event.keyCode == 9) {
return true;
}
else if ( key < 48 || key > 57 ) {
return false;
}
else return true;
}
</script>
Default toggle text in input text box magento
<script language="javascript">
var comment = document.getElementById('comment');
comment.onfocus = hideText;
comment.onblur = showText;
function hideText()
{
if(this.value == this.defaultValue){
this.value = '';
this.style.color = '#666666';
}
}
function showText()
{
if(this.value == ''){
this.value = this.defaultValue;
this.style.color = '#cccccc';
}
}
</script>
var comment = document.getElementById('comment');
comment.onfocus = hideText;
comment.onblur = showText;
function hideText()
{
if(this.value == this.defaultValue){
this.value = '';
this.style.color = '#666666';
}
}
function showText()
{
if(this.value == ''){
this.value = this.defaultValue;
this.style.color = '#cccccc';
}
}
</script>
Subscribe to:
Posts (Atom)