If you are searching for the professional web development, app development company in Vadodara then Cloudswift Solutions is the name on which you can trust. Visit our website for more information.
Sunday, 25 November 2012
Friday, 23 November 2012
Using php to display visitor / user information such as their IP address
$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER']; // a quirky spelling mistake that stuck in php
print "Display IP address:
\n";
print "$ip
\n";
print "More detailed host address:
\n";
print "$hostaddress
\n";
print "Display browser info:
\n";
print "$browser
\n";
print "Where you came from (if you clicked on a link to get here:
\n";
if ($referred == "") {
print "Page was directly requested";
}
else {
print "$referred";
}
Most Important Tables in magento are: eav_attribute and eav_entity_type
Thursday, 22 November 2012
Wednesday, 21 November 2012
my paypal details
Login : mayank.patel@live.in
Seller Account : mayank_1354093144_biz@live.in / mayank_seller
Buyer Account : mayank_1354092969_per@live.in / mayank_buyer
Clean Magento database
TRUNCATE TABLE `dataflow_batch_export`;
TRUNCATE TABLE `dataflow_batch_import`;
TRUNCATE TABLE `log_customer`;
TRUNCATE TABLE `log_quote`;
TRUNCATE TABLE `log_summary`;
TRUNCATE TABLE `log_summary_type`;
TRUNCATE TABLE `log_url`;
TRUNCATE TABLE `log_url_info`;
TRUNCATE TABLE `log_visitor`;
TRUNCATE TABLE `log_visitor_info`;
TRUNCATE TABLE `log_visitor_online`;
TRUNCATE TABLE `report_viewed_product_index`;
TRUNCATE TABLE `report_compared_product_index`;
TRUNCATE TABLE `report_event`;
magento: insert query for a custom table
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');
$connection->beginTransaction();
$sql = 'INSERT INTO tableName (`field1`, `field2`) VALUES (?, ?)';
$bind = array('value1', 'value2');
$connection->query($sql, $bind);
$connection->commit();
Show subcategory in a category page
<?php
$_category = $this->getCurrentCategory();
$collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id);
$helper = Mage::helper('catalog/category');
?>
<ul>
<?foreach ($collection as $cat):?>
<?php if($_category->getIsActive()):?>
<?php
$cur_category = Mage::getModel('catalog/category')->load($cat->getId());
$_img = $cur_category->getImageUrl();
?>
<li>
<a href="<?php echo $helper->getCategoryUrl($cat);?>">
<img src="<?php echo $_img?>" title="$cat->getName()"/>
<cite><?php echo $cat->getName();?></cite>
</a>
</li>
<?php endif?>
<?php endforeach;?>
</ul>
how do i change the price filter attributes price range with text
Magento – Show Quantity Box in Products List
<?php if($_product->isSaleable()): ?>
<button onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?<')">>span>
<?php echo $this->__('Add to Cart') ?></span></button>Replace with:
<form action="
<?php echo $this->getAddToCartUrl($_product) ?>" method="post" id="product_addtocart_form_<?php echo $_product->getId(); ?>">
<input name="qty" type="text" id="qty" maxlength="12" value="
<?php echo $this->getMinimalQty($_product) ?>" />
<button" onclick="productAddToCartForm_
<?php echo $_product->getId(); ?>.submit()"><span>
<?php echo $this->__('Add to Cart') ?></span></button>
</form>
<script type="text/javascript">
var productAddToCartForm_
<?php echo $_product->getId(); ?> = new VarienForm('product_addtocart_form_
<?php echo $_product->getId(); ?>');
productAddToCartForm_
<?php echo $_product->getId(); ?>.submit = function(){
if (this.validator.validate()) {
this.form.submit();
}
}.bind(productAddToCartForm_<?php echo $_product->getId(); ?>);
</script>Javascript – get Url
window.location.href - get entire url
window.location.protocol - get protocol: "http" / "https"
window.location.host - get hostname, e.g: "www.g31zone.com"
window.location.pathname - get script name, e.g: "example/index.html"
Tuesday, 20 November 2012
Moving Magento From One Host To Another
2. take backup of your files.
3. create new database on your new host
4. save your database and password of your database
5. open local.xml in magento folder on path app\etc change infomation of previous database with new.
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[username]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[databasename]]></dbname>
<active>1</active>
</connection>
6. upload all your files to you new host.
7. go to you new host database open table `core_config_data` change the value of your old host name with new host name
example:
Before Changing Host
config_id scope scope_id path value
Edit Delete 2 default 0 web/unsecure/base_url http://localhost/oldhost/
Edit Delete 3 default 0 web/secure/base_url http://localhost/oldhost/
After Changing Host
config_id scope scope_id path value
Edit Delete 2 default 0 web/unsecure/base_url http://localhost/newhost/
Edit Delete 3 default 0 web/secure/base_url http://localhost/newhost/
Running script out side Magento Folder and Updating Project Database
It will make first image as thumb and small image.
An example to run script out side magento folder.
<?php
require 'app/Mage.php';
Mage::app();
$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');
foreach ($products as $product) {
if (!$product->hasImage()) continue;
if (!$product->hasSmallImage()) $product->setSmallImage($product->getImage());
if (!$product->hasThumbnail()) $product->setThumbnail($product->getImage());
$product->save();
}
Get productID from specific order in Magento
$order = Mage::getModel('sales/order')->load($order_id);$items = $order->getAllItems();$itemcount=count($items);$name=array();$unitPrice=array();$sku=array();$ids=array();$qty=array();foreach ($items as $itemId => $item){ $name[] = $item->getName(); $unitPrice[]=$item->getPrice(); $sku[]=$item->getSku(); $ids[]=$item->getProductId(); $qty[]=$item->getQtyToInvoice();}Magento addAttributeToFilter
Get all product collection with the below code:
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*');Add different types of filters on collection. example shown below
// Equal To (eq)
$collection->addAttributeToFilter('status', array('eq' => 1));
// Not Equal To (neq)
$collection->addAttributeToFilter('visibility', array('neq' => 1));
// Greater Than (gt)
$collection->addAttributeToFilter('price', array('gt' => 3.99));
// Less Than (lt)
$collection->addAttributeToFilter('price', array('lt' => 3.99));
// Greater Than or Equal To (gteq)
$collection->addAttributeToFilter('price', array('gteq' => 4.99));
// Less Than or Equal To (lteq)
$collection->addAttributeToFilter('price', array('lteq' => 4.99));
// Contains (like) - also uses % wildcards
$collection->addAttributeToFilter('sku', array('like' => 'DVD%'));
// Does Not Contain (nlike) - also uses % wildcards
$collection->addAttributeToFilter('sku', array('nlike' => 'ABC%'));
// In Array (in)
$collection->addAttributeToFilter('id', array('in' => array(1,3,12)));
// Not In Array (nin)
$collection->addAttributeToFilter('id', array('nin' => array(1,2,12)));
// Is NULL (null)
$collection->addAttributeToFilter('description', 'null');
// Is Not NULL (notnull)
$collection->addAttributeToFilter('description', 'notnull');
display product in magento with sql in list.phtml file
$sql = “SELECT product_id FROM catalog_category_product WHERE category_id=57″;
$data = Mage::getSingleton(‘core/resource’) ->getConnection(‘core_read’)->fetchAll($sql);
Display All Product Attribute in Mageto Shopping Cart
note: path can differ according to templete
app\design\frontend\base\default\template\checkout\cart\item\default.phtml
use the Code below in default.phtml.
<?php
$product = Mage::getModel(‘catalog/product’)->load($this->getProduct()->getId());
$attributes = $product->getAttributes();
foreach ($attributes as $attribute) {
if ($attribute->getIsVisibleOnFront() && $attribute->getIsUserDefined()) {
$value = $attribute->getFrontend()->getValue($product);
if (strlen($value) && $product->hasData($attribute->getAttributeCode())) {
$data[$attribute->getAttributeCode()] = array(
‘label’ => $attribute->getFrontend()->getLabel(),
‘value’ => $value //$product->getData($attribute->getAttributeCode())
);
?>
<span style=”font-weight:bold;”><?php echo $data[$attribute->getAttributeCode()]['label']; ?></span>: <span><?php echo $data[$attribute->getAttributeCode()]['value']; ?></span>
<?php
}
}
}
?>
Magento Image Switcher On MouseOver
app/design/frontend/default/default/template/catalog/product/view/media.phtml
Step2. Search the code in media.phtml file
<a onclick="popWin('<?php echo $this->getGalleryUrl($_image) ?>', 'gallery', 'width=300,height=300,left=50,top=50,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" href="#"> <!--nested img tag stays the same--></a>
Step 3. Replace searched code with code below.
<a title="<?php echo $_product->getName();?>" onmouseover="$('image').src = this.href; return false;" href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'image', $_image->getFile()); ?>"> <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(56); ?>" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" width="56" height="56" /></a>
Monday, 19 November 2012
Sunday, 11 November 2012
Friday, 9 November 2012
Thursday, 8 November 2012
magento cash on devliary extension
Tuesday, 6 November 2012
Sending email from local system in magneto OR Sending email from magento in local system
i'e
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = mail.yourdomine.com
; http://php.net/smtp-port
smtp_port = 25
and in magento go to admin
System->Configuration->System->Mail Sending Setting->host
replace host from localhost to mail.yourdomine.com
Magento - How to get all Product details in magento Programmatically?
require_once 'app/Mage.php';
umask(0);
Mage::app('default');
function empty_pk($data){
if($data!=''){return $data;}
else {return " ";}
}
$collection = Mage::getModel('catalog/product')->getCollection();
echo '<table border="1"> ';
echo '<tr>';
echo "<th>sku<th />";
echo "<th>name<th />";
echo "<th>qty<th />";
echo "<th>is_in_stock<th />";
echo "<th>price<th />";
echo '</tr>';
foreach ($collection as $product_all) {
//echo '<pre>';print_r($product);echo '</pre>';
$sku = $product_all['sku'];
// retrieve product id using sku
$product_id = Mage::getModel('catalog/product')->getIdBySku($sku);
// call product model and create product object
$product = Mage::getModel('catalog/product');
// Load product using product id
$product ->load($product_id);
$pk_sku = empty_pk($product['sku']);
$pk_name = empty_pk($product['name']);
$stockData = $product->getStockData();
$pk_qty = empty_pk($stockData['qty']);
$pk_in_stock = empty_pk($stockData['is_in_stock']);
$pk_price = empty_pk($product['price']);
echo '<tr>';
echo "<td>".$pk_sku."<td />";
echo "<td>".$pk_name."<td />";
echo "<td>".$pk_qty."<td />";
echo "<td>".$pk_in_stock."<td />";
echo "<td>".$pk_price."<td />";
echo '</tr>';
}
echo '</table>';
?>
Magento - How to get all Magento Database hosting details?
require_once 'app/Mage.php';
umask(0);
Mage::app('default');
$resource = Mage::getConfig()->getNode('global/resources')->asArray();
echo '<pre>';
print_r($resource);
echo '</pre>';
$db_host = $resource['default_setup']['connection']['host'];
$db_user = $resource['default_setup']['connection']['username'];
$db_pass = $resource['default_setup']['connection']['password'];
$db_name = $resource['default_setup']['connection']['dbname'];
echo '<br />host : '.$db_host;
echo '<br />username : '.$db_user;
echo '<br />password : '.$db_pass;
echo '<br />dbname : '.$db_name;
?>
Magento - How to get all order details into table format?
require_once('app/Mage.php');
Mage::app('admin');
Mage::getSingleton("core/session", array("name" => "adminhtml"));
Mage::register('isSecureArea',true);
$collection = Mage::getResourceModel('sales/order_collection')
->addAttributeToSelect('*');
//->addFieldToFilter('hpc_order_id', array('neq' => '',))
//->addFieldToFilter('hpc_order_from', array('eq' => 'ebay',)));
//->addFieldToFilter('status', 'complete')->load(); //pending,complete
//$collection->addAttributeToSort('created_at', 'desc');
$min_diff = '60';
$from_date = date("Y-m-d H:i:s", strtotime("-".$min_diff." minute"));
$to_date = date("Y-m-d H:i:s");
$collection->addAttributeToFilter('updated_at', array(
'from' => $from_date,
'to' => $to_date
));
/*
echo '<pre>';
print_r($collection);
echo '</pre>';
*/
echo "<br />supplement order start";
echo '<table border="1" style="1px solid #cccccc">';
echo '<tr>';
echo '<th>Order Id</th>';
echo '<th>Order Created at</th>';
echo '<th>Order Updated at</th>';
echo '<th>Order State</th>';
echo '<th>Order Status</th>';
echo '<th>HPC Order ID</th>';
echo '<th>HPC Order from</th>';
echo '</tr>';
foreach ($collection as $col) {
echo '<tr>';
echo "<td>".$col->getIncrementId()."</td>";
echo "<td>".$col->getCreatedAt()."</td>";
echo "<td>".$col->getUpdatedAt()."</td>";
echo "<td>".$col->getState()."</td>";
echo "<td>".$col->getStatus()."</td>";
echo "<td>".$col->getHpcOrderId()."</td>";
echo "<td>".$col->getHpcOrderFrom()."</td>";
echo '</tr>';
}
echo '</table>';
echo "<br />supplement order ends";
Magento - Steps to moving magento from one server to other
clear the /var/cache and /var/session directory which is allow more space to you
then add your magento folder into zip/rar file and extract them on the target server.
Step 2:
once you finished with the copying then you should set the correct permissions for
magento files and folders
as
/var and contents should have permissions “777″
/media and contents should have permissions “777″
/app/etc and contents should have permissions “777″
Step 3:
Now important part is that set the new database connection settings in the
file /app/etc/local.xml
as
<resources>
<db>
<table_prefix><![CDATA[db_prefix]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[db_host]]></host>
<username><![CDATA[db_user]]></username>
<password><![CDATA[db_password]]></password>
<dbname><![CDATA[db_name]]></dbname>
<initstatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdotype><![CDATA[]]></pdoType>
<active>1</active>
</connection>
</default_setup>
</resources>
You need to replace db_prefix db_host db_user db_password etc.. with your values.
Step 4:
Now goto your Database admin panel like phpmyadmin and run the query below
UPDATE core_config_data SET VALUE="http://newhostsite.com/"
WHERE path="web/unsecure/base_url";
UPDATE core_config_data SET VALUE="http://newhostsite.com/"
WHERE path="web/unsecure/base_url";
Where “newhostsite.com” is a new server domain name.
Magento - Store Information
Mage::app()->getStore();
Store Id
Mage::app()->getStore()->getStoreId();
Store code
Mage::app()->getStore()->getCode();
Website Id
Mage::app()->getStore()->getWebsiteId();
Store Name
Mage::app()->getStore()->getName();
Is Active
Mage::app()->getStore()->getIsActive();
Store Home Url
Mage::app()->getStore()->getHomeUrl();
Magento - Import Manufacturers
2> Write the following code there:
<?php
require_once 'app/Mage.php';
umask(0);
Mage::app('default');
$_manufacturers = file('manufacturers.txt');
$_attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', 'manufacturer');
$manufacturers = array('value' => array(), 'order' => array(), 'delete' => array());
$i = 0;
foreach($_manufacturers as $_manufacturer){
$i++;
$manufacturers['value']['option_' . $i] = array($_manufacturer);
}
$_attribute->setOption($manufacturers);
try{
$_attribute->save();
echo 'Manufacturer successfully imported';
}catch(Exception $e){
echo 'Import Error::'.$e->getMessage();
}
?>
Dell
Toshiba
Sony
Fujitsu
Magento Set, Retrieve and Unset Session Variables
$myValue = 'Hello World';
Mage::getSingleton('core/session')->setMyValue($myValue);
To Retrieve:
$myValue = '';
$myValue=Mage::getSingleton('core/session')->getMyValue();
To Unset:
Mage::getSingleton('core/session')->unsMyValue();
Note that ‘MyValue’ can be any text you want but ‘set’, ‘get’ and ‘uns’ prefixes are required.
Monday, 5 November 2012
Magento important tables
sales_flat_order -> magento order master table.
eav_attribute -> magento attribute master table.
catalog_product_entity -> product master table.
catalog_product_entity_varchar -> product master table values.
catalog_category_entity -> category master table.
catalog_category_entity_varchar -> category master table values.
core_resource -> plugin table.
newsletter_subscriber -> newsletter subscriber master table.
review -> review master table.
review_detail -> review detail table.
customer_entity -> customer main table
wishlist -> wishlist main table.
admin_user -> admin user master table.
cms_block -> cms block master table.
cms_page -> cms page master table.
Saturday, 3 November 2012
Magento: How to delete test orders in magento
- Login to Admin Panel and go to Sales-->Orders.
- Note down your test order ids, for example: 100000001,100000002,100000003,100000111,100000112,100000199
- Now create a php file in magento root directory and name it: deleteOrders.php
- Now copy below code and paste it in your file:<?php
require 'app/Mage.php';
Mage::app('admin')->setUseSessionInUrl(false); //replace your own orders numbers here:
$test_order_ids=array(
'100000001',
'100000002',
'100000003',
'100000109',
'100000112',
'100000134'
);
foreach($test_order_ids as $id){
try{
Mage::getModel('sales/order')->loadByIncrementId($id)->delete();
echo "order #".$id." is removed".PHP_EOL;
}catch(Exception $e){
echo "order #".$id." could not be remvoved: ".$e->getMessage().PHP_EOL;
}
}
echo "complete."?> - Now go to your browsers address bar and run file from here like:[Your_Magento_Base_URL] /deleteOrders.php
- At the end, delete deleteOrders.php.
That's All.. Cheers :)
How to change the Magento Admin Panel Title?
Hide Attributes which have no value in Magento
<?php foreach ($_additional as $_data): ?>
<tr>
<th><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<td><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php endforeach; ?>
Now replace this by:
<?php foreach ($_additional as $_data): ?>
<?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != ")) { ?>
<tr>
<th><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
<td><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
</tr>
<?php } ?>
<?php endforeach; ?>
Magento: How to view Magento version
Now copy and paste following code in versionTest.php:
<?php
include_once(‘App/Mage.php’);
Mage::app();
echo Mage::getVersion();
?>
Magento - Reset the admin password
Script for to remove the cache - Magento
<?php require_once ("app/Mage.php"); umask(0); Mage::run(); Mage::app()->getCache()->clean(); exit("done"); ?>
can call that file with :http://yourdomainname/cache-clear.php
Magento Add Free Shipping promotions to the sidebar my cart block
replace the following code :
<!--The section we want is around line 48-->
<p>
<?php if ($this->canApplyMsrp()): ?>
<span><?php echo $this->__('ORDER TOTAL WILL BE DISPLAYED BEFORE YOU SUBMIT THE ORDER'); ?></span>
<?php else: ?>
<span><?php echo $this->__('Cart Subtotal:') ?></span> <?php echo Mage::helper('checkout')->formatPrice($this->getSubtotal()) ?>
<?php if ($_subtotalInclTax = $this->getSubtotalInclTax()): ?>
<br />(<?php echo Mage::helper('checkout')->formatPrice($_subtotalInclTax) ?> <?php echo Mage::helper('tax')->getIncExcText(true) ?>)
<?php endif; ?>
<?php endif; ?>
</p>
</div>
<?php endif ?>
<!--Here is our conditional statement, if more that $60 in cart, then $free_delivery is less than zero, and first message gets displayed -->
<?php $free_delivery=60-$this->getSubtotal();?>
<?php if ($free_delivery<0): ?>
<br /><p><b>Free UPS Ground delivery with this order!</b></p>
<!--Here is the second part, if less that $60 in cart, then $free_delivery message displays a teaser to add more stuff to cart-->
<?php else: ?>
<br /><p>Free UPS Ground delivery when spending $60 or more!
<!--Here is where the amount they need to spend is displayed-->
<br><b>Spend another <?php echo Mage::helper('checkout')->formatPrice($free_delivery) ?> to get free delivery with this order!</b></p>
<?php endif ?>
<?php if($_cartQty && $this->isPossibleOnepageCheckout()): ?>
Thursday, 1 November 2012
Show subcategory in a category page
<?php
$_category = $this->getCurrentCategory();
$collection = Mage::getModel('catalog/category')->getCategories($_category->entity_id);
$helper = Mage::helper('catalog/category');
?>
<ul>
<?foreach ($collection as $cat):?>
<?php if($_category->getIsActive()):?>
<?php
$cur_category = Mage::getModel('catalog/category')->load($cat->getId());
$_img = $cur_category->getImageUrl();
?>
<li>
<a href="<?php echo $helper->getCategoryUrl($cat);?>">
<img src="<?php echo $_img?>" title="$cat->getName()"/>
<cite><?php echo $cat->getName();?></cite>
</a>
</li>
<?php endif?>
<?php endforeach;?>
</ul>
Delete all product from cart
public function deleteallAction()
{
$cartHelper = Mage::helper('checkout/cart');
$items = $cartHelper->getCart()->getItems();
foreach ($items as $item)
{
$itemId = $item->getItemId();
$cartHelper->getCart()->removeItem($itemId)->save();
}
$this->_redirectReferer(Mage::getUrl('*/*'));
}if you call this it will delete all item in the cart.
the url should be http://www.yoursite.com/index.php/checkout/cart/deleteall/
Wednesday, 31 October 2012
Redirecting www to non-www Using .htaccess
Some people prefer to use www.somesite.com, but some people prefer the shorter somesite.com. There isn't really a right or wrong way to do it, but whatever you choose you can make sure all of your visitors get sent to the same place. With a few simple rules on the server you can choose from non-www to www, or redirecting from www to non-www.
If you already have a file named .htaccess on your Website you can add to it. If not, create one (yes, include the period at the beginning). Add either of the following rules and save. Replace yourdomain.com with your actual domain name.
Redirect www to non-www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.yourdomain.com [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]
Redirect non-www to www:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Both of these rules send a full search engine friendly 301 HTTP redirect. They also preserve the entire URL (so yoursite.com/about redirects to www.yoursite.com/about).
Search engines can usually figure out which format is preferred, but since you're showing the same page for www and non-www URLs it can't hurt to be consistent about it.
Create your .htaccess rewrite code:
Use our www Redirect Generator tool to automatically generate the required redirect code.
Magento product details store tablename
product id store in : catalog_product_entity_int
product price store in : catalog_product_entity_decimal
How to Call Newsletter in footer in Magento
app/design/frontend/default/YourTheme/layout/newsletter.xml and add the following lines in default<reference name="footer">
<block type="newsletter/subscribe" name="footer.newsletter"
template="newsletter/subscribe.phtml"/>
</reference>
and add the following line in
app/design/frontend/default/YourTheme/template/page/html/footer.phtml <?php echo $this->getChildHtml('footer.newsletter'); ?>
Remove Category option from Layered Navigation options list in magnto
go to app/design/frontend/default/default/template/catalog/layer and open up view.phtml for edit.
<dl id="narrow-by-list"><?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
<?php if($_filter->getItemsCount()): ?>
<?php if($_filter->getName() != "Category"){ ?><dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd><?php } endif; ?>
<?php endforeach; ?></dl> Removing dropdowns from Product List Pager in magnto
<?php foreach($this->getAvailableOrders() as $_key=>$_order): ?>
<a href=”<?php echo $this->getOrderUrl($_key, ‘asc’) ?>” ><?php echo $this->__($_order) ?></a>
<?php endforeach; ?>
2. In the same file, look for the “Limiter” div and replace with:
<div class=”limiter”>
<label><?php echo $this->__(‘Show’) ?></label>
<?php foreach ($this->getAvailableLimit() as $_key=>$_limit): ?>
<a href=”<?php echo $this->getLimitUrl($_key) ?>”><?php echo $_limit ?></a>
<?php endforeach; ?>
<?php echo $this->__(‘per page’) ?>
</div>
Magento: Get store information
Mage::app()->getStore();
Store Id
Mage::app()->getStore()->getStoreId();
Store code
Mage::app()->getStore()->getCode();
Website Id
Mage::app()->getStore()->getWebsiteId();
Store Name
Mage::app()->getStore()->getName();
Is Active
Mage::app()->getStore()->getIsActive();
Store Home Url
Mage::app()->getStore()->getHomeUrl();
Delete all Products and ResetProduct id’s in Magento
TRUNCATE TABLE `catalog_product_bundle_option`; TRUNCATE TABLE `catalog_product_bundle_option_value`; TRUNCATE TABLE `catalog_product_bundle_selection`; TRUNCATE TABLE `catalog_product_entity_datetime`;TRUNCATE TABLE `catalog_product_entity_decimal`;TRUNCATE TABLE `catalog_product_entity_gallery`; TRUNCATE TABLE `catalog_product_entity_int`;TRUNCATE TABLE `catalog_product_entity_media_gallery`;TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;TRUNCATE TABLE `catalog_product_entity_text`;TRUNCATE TABLE `catalog_product_entity_tier_price`; TRUNCATE TABLE `catalog_product_entity_varchar`;TRUNCATE TABLE `catalog_product_link`; TRUNCATE TABLE `catalog_product_link_attribute`;TRUNCATE TABLE `catalog_product_link_attribute_decimal`; TRUNCATE TABLE `catalog_product_link_attribute_int`; TRUNCATE TABLE `catalog_product_link_attribute_varchar`; TRUNCATE TABLE `catalog_product_link_type`; TRUNCATE TABLE `catalog_product_option`; TRUNCATE TABLE `catalog_product_option_price`; TRUNCATE TABLE `catalog_product_option_title`; TRUNCATE TABLE `catalog_product_option_type_price`;TRUNCATE TABLE `catalog_product_option_type_title`; TRUNCATE TABLE `catalog_product_option_type_value`;TRUNCATE TABLE `catalog_product_super_attribute`;TRUNCATE TABLE `catalog_product_super_attribute_label`;TRUNCATE TABLE `catalog_product_super_attribute_pricing`;TRUNCATE TABLE `catalog_product_super_link`; TRUNCATE TABLE `catalog_product_enabled_index`; TRUNCATE TABLE `catalog_product_website`;TRUNCATE TABLE `catalog_product_entity`; TRUNCATE TABLE `cataloginventory_stock`;TRUNCATE TABLE `cataloginventory_stock_item`;TRUNCATE TABLE `cataloginventory_stock_status`;
Truncate all categories and and Reset Categoryt id’s in Magento
TRUNCATE TABLE `catalog_category_entity`;TRUNCATE TABLE `catalog_category_entity_datetime`;TRUNCATE TABLE `catalog_category_entity_decimal`;TRUNCATE TABLE `catalog_category_entity_int`; TRUNCATE TABLE `catalog_category_entity_text`;TRUNCATE TABLE `catalog_category_entity_varchar`; TRUNCATE TABLE `catalog_category_product`;TRUNCATE TABLE `catalog_category_product_index`;
Magento: How to solve indexing problem?
open your phpmyadmin.and run below given Query in sql tab.
DROP TABLE IF EXISTS `index_event`;
DROP TABLE IF EXISTS `index_process`;
`event_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(64) NOT NULL,
`entity` VARCHAR(64) NOT NULL,
`entity_pk` BIGINT(20) DEFAULT NULL,
`created_at` DATETIME NOT NULL,
`old_data` MEDIUMTEXT,
`new_data` MEDIUMTEXT,
PRIMARY KEY (`event_id`),
UNIQUE KEY `IDX_UNIQUE_EVENT` (`type`,`entity`,`entity_pk`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
CREATE TABLE `index_process` (
`process_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`indexer_code` VARCHAR(32) NOT NULL,
`status` ENUM('pending','working','require_reindex') NOT NULL DEFAULT 'pending',
`started_at` DATETIME DEFAULT NULL,
`ended_at` DATETIME DEFAULT NULL,
`mode` ENUM('real_time','manual') NOT NULL DEFAULT 'real_time',
PRIMARY KEY (`process_id`),
UNIQUE KEY `IDX_CODE` (`indexer_code`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;
INSERT INTO `index_process`(`process_id`,`indexer_code`,`status`,`started_at`,`ended_at`,`mode`) VALUES (1,'catalog_product_attribute','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(2,'catalog_product_price','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(3,'catalog_url','pending','2010-02-13 19:12:15','2010-02-13 19:12:15','real_time'),(4,'catalog_product_flat','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(5,'catalog_category_flat','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(6,'catalog_category_product','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(7,'catalogsearch_fulltext','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time'),(8,'cataloginventory_stock','pending','2010-02-13 00:00:00','2010-02-13 00:00:00','real_time');
CREATE TABLE `index_process_event` (
`process_id` INT(10) UNSIGNED NOT NULL,
`event_id` BIGINT(20) UNSIGNED NOT NULL,
`status` ENUM('new','working','done','error') NOT NULL DEFAULT 'new',
PRIMARY KEY (`process_id`,`event_id`),
KEY `FK_INDEX_EVNT_PROCESS` (`event_id`),
CONSTRAINT `FK_INDEX_EVNT_PROCESS` FOREIGN KEY (`event_id`) REFERENCES `index_event` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_INDEX_PROCESS_EVENT` FOREIGN KEY (`process_id`) REFERENCES `index_process` (`process_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=INNODB DEFAULT CHARSET=utf8;
Magento Database Connection
$result = $sql->query("SELECT class_name from tax_class");
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
echo $row['class_name']."<br />";
}
Thursday, 25 October 2012
Tuesday, 23 October 2012
Redirect site from non-www to www
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Monday, 22 October 2012
Magento add custom fields in admin side
Sunday, 21 October 2012
Wednesday, 17 October 2012
Tuesday, 16 October 2012
Monday, 15 October 2012
How to add datapicker on magento contact us form?
Thursday, 11 October 2012
Date function in PHP
echo(“Result with date():”);
echo(date(“l”) . “”);
echo(date(“l dS \of F Y h:i:s A”) . “”);
echo(“Oct 3,1975 was on a “.date(“l”, mktime(0,0,0,10,3,1975)).””);
echo(date(DATE_RFC822) . “”);
echo(date(DATE_ATOM,mktime(0,0,0,10,3,1975)) . “”);
echo(“Result with gmdate():”);
echo(gmdate(“l”) . “”);
echo(gmdate(“l dS \of F Y h:i:s A”) . “”);
echo(“Oct 3,1975 was on a “.gmdate(“l”, mktime(0,0,0,10,3,1975)).””);
echo(gmdate(DATE_RFC822) . “”);
echo(gmdate(DATE_ATOM,mktime(0,0,0,10,3,1975)) . “”);
Output:
Result with date():
Tuesday
Tuesday 24th of January 2006 02:41:22 PM
Oct 3,1975 was on a Friday
Tue, 24 Jan 2006 14:41:22 CET
1975-10-03T00:00:00+0100
Result with gmdate():
Tuesday
Tuesday 24th of January 2006 01:41:22 PM
Oct 3,1975 was on a Thursday
Tue, 24 Jan 2006 13:41:22 GMT
1975-10-02T23:00:00+0000
Wednesday, 10 October 2012
Add twitter button on product detail page in magento
<a href="http://twitter.com/share" data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><a href="http://twitter.com/share" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><a href="http://twitter.com/share" data-count="none">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>Add facebook like button on product detail page in magento
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo $currentUrl ?>" show_faces="false" width="450" font=""></fb:like>
<?php $currentUrl = $this->helper('core/url')->getCurrentUrl(); ?>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $currentUrl ?>&layout=standard&show_faces=true&width=450&action=like&font&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
<?php $currentUrl = $this->helper('core/url')->getCurrentUrl(); ?>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<?php echo $currentUrl ?>" layout="button_count" show_faces="true" width="450" font=""></fb:like></p>
<p><?php $currentUrl = $this->helper('core/url')->getCurrentUrl(); ?><br />
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $currentUrl ?>&layout=button_count&show_faces=true&width=450&action=like&font&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe></p>
Magento Hint Websites
http://ivvy.ru/en/bloggy
http://sushilshirbhate.wordpress.com/2011/07/07/magento-theme-development-cheat-sheet/
http://magento4u.wordpress.com/2011/03/28/add-extra-fields-in-registration-page/
http://www.magento.cc/custom-accountregistration-fields.html
http://www.magento.cc/category/magento/cms
http://www.magento.cc/category/magento/module
http://www.pauldonnellydesigns.com/blog/magento-display-address-fields-in-create-an-account/
http://www.excellencemagentoblog.com/magento-blogs/
http://www.itoris.com/magento-ajax-login-registration.html
http://www.magentoworks.net/magento-extension
http://www.cutehits.com/2011/07/overriding-core-controller-in-magento/
http://nickwan.wordpress.com/
http://blog.ecommercesoftwaresolutionsonline.com/archives/category/magento-developer-notes
http://oaktondata.com
http://wordcastnet.com/2009/speed-up-wordpress-with-google-gears-and-the-turbo-feature/
http://kb.magenting.com/category/5/general-configuration.html
http://www.webspeaks.in/2011/03/override-controllers-in-magento.html
http://learntipsandtricks.com/blog/magento/149/How-to-enable-Address-Information-on-Magento-Customer-Registration-Page
http://www.phptechi.com/category/php/magento
http://www.westwideweb.com/wp/page/4/
http://ultimento.com/wiki/blog/
http://xhtmlandcsshelp.blogspot.in/
http://xhtmlandcsshelp.blogspot.in/search?updated-max=2010-11-30T19:48:00%2B05:30&max-results=10&start=50&
by-date=false
http://alanstorm.com/category/magento
http://dbhoopendra.blogspot.in/search/label/Magento
http://www.learnmagento.org/magento-tutorials/how-to-install-sample-data-in-a-magento-site/#
http://www.devraju.com/category/magento/
http://www.johannreinke.com/en/category/php/magento/
http://www.webspeaks.in/
http://magentoshare.blogspot.in/
http://www.fmeextensions.com/
http://blog.magentoconnect.us/page/3/
http://blog.ecommercesoftwaresolutionsonline.com/archives/1036/magento-how-to-place-facebook-like-and-twitter-buttons-
in-the-products-view-page.html
Tuesday, 9 October 2012
Wednesday, 3 October 2012
Monday, 1 October 2012
Monday, 24 September 2012
Friday, 21 September 2012
Tuesday, 18 September 2012
How to create and custom page template in wordpress?
2). Paste the following code :
<?php
/*
Template Name: test
*/
get_header();
?>
<?php echo "test page is called";?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
3). Open wp-admin and create new page : view template on right side : select "test" option.
4). Done.
Monday, 17 September 2012
Thursday, 13 September 2012
CSV to HTML using PHP
$file_handle = fopen("path/to/file/Book2.csv", "r");
while (!feof($file_handle) ) {
$line_of_text = fgetcsv($file_handle, 1024);
print "<p>" . $line_of_text[0] . "</p>";
print "<p>" . $line_of_text[1] . "</p>";
print "<p>" . $line_of_text[2] . "</p>";
}
fclose($file_handle);
?>
Thursday, 6 September 2012
Magento Ajax scrolling functionality on product and search listing page
2. Extract it’s contents to the root of your Magento installation. You can use FTP to do that. It’s the directory containing index.php [App] [Skin] [Media] among others
3. Log in to your Magento backend
4. Go to System -> Cache Management, select all options, and in the action dropdown select “Refresh”. Then click Submit.
5. Log out/in to your backend
6. Go to System -> Configuration -> Catalog and drop down the “Front-end” selection
7. The extension adds a new option here; “Use jQuery Infinite Ajax Scroll” and this new version adds the option “Use jQuery UItoTop”.
8. Set both “Use jQuery Infinite Ajax Scroll” and “Use jQuery UItoTop” to “Yes”
9. Click save config.
10. All done!
Ajaxscroll
How to delete customers in magento?
TRUNCATE `customer_address_entity`;TRUNCATE `customer_address_entity_datetime`;TRUNCATE `customer_address_entity_decimal`;TRUNCATE `customer_address_entity_int`;TRUNCATE `customer_address_entity_text`;TRUNCATE `customer_address_entity_varchar`;TRUNCATE `customer_entity`;TRUNCATE `customer_entity_datetime`;TRUNCATE `customer_entity_decimal`;TRUNCATE `customer_entity_int`;TRUNCATE `customer_entity_text`;TRUNCATE `customer_entity_varchar`;TRUNCATE `log_customer`;TRUNCATE `log_visitor`;TRUNCATE `log_visitor_info`;ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;ALTER TABLE `customer_entity` AUTO_INCREMENT=1;ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;ALTER TABLE `log_customer` AUTO_INCREMENT=1;ALTER TABLE `log_visitor` AUTO_INCREMENT=1;ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;List of tables to store product
catalog_product_entity_datetime
catalog_product_entity_decimal
catalog_product_entity_gallery
catalog_product_entity_int
catalog_product_entity_media_gallery
catalog_product_entity_media_gallery_value
catalog_product_entity_text
catalog_product_entity_tier_price
catalog_product_entity_varchar
catalog_product_link
catalog_product_link_attribute
catalog_product_link_attribute_decimal
catalog_product_link_attribute_int
catalog_product_link_attribute_varchar
catalog_product_link_type
catalog_product_super_attribute
catalog_product_super_attribute_label
catalog_product_super_attribute_pricing
catalog_product_super_link
catalog_product_website
List of tables to store category
catalog_category_entity_datetime
catalog_category_entity_decimal
catalog_category_entity_int
catalog_category_entity_text
catalog_category_entity_varchar
catalog_category_flat
Friday, 17 August 2012
Magento get store config
$strFbLink = Mage::getStoreConfig('banner/socialnetworking/banner_facebook_url');
$strTwLink = Mage::getStoreConfig('banner/socialnetworking/banner_twitter_url');
$strLiLink = Mage::getStoreConfig('banner/socialnetworking/banner_linkedin_url');
Monday, 13 August 2012
Magento display date format
$arrReviewDate = explode(' ',$strReviewDate);
$intReviewDate = strtotime($arrReviewDate[0]);
$dtReviewDate = date('d F, Y',$intReviewDate);
echo " - ".$dtReviewDate;
?>
Sunday, 12 August 2012
How to display manufacturer attributes on product listing page in magento?
Thursday, 9 August 2012
magento custom add to cart link
Wednesday, 8 August 2012
How to display final price on listing page in magento?
$_taxHelper = $this->helper("tax");
$_finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true);
$_finalPriceFormated = $_coreHelper->currency($_finalPriceInclTax,true,false);
echo $_finalPriceFormated;
//echo $this->getPriceHtml($_product, true) ?>
Tuesday, 7 August 2012
Magento solve enable cookies
Monday, 6 August 2012
Remove Price from Custom Options
Comment following line
<reference name="content">
<remove name="product.clone_prices"/>
reference>Thursday, 19 July 2012
To Be implement in magento?
http://bluezeal.in/ccavenue4magento/ccavenue-payment-module-for-magento
http://keertikiran.blogspot.in/2012/05/display-date-in-specified-format-in.html
product question extension....
http://www.magentocommerce.com/magento-connect/cueblocks-zoom.html
Mturbo cache management
http://www.tonecruisers.com/OurMusic.html (to create playlist)
http://www.magentocommerce.com/magento-connect/cueblocks-zoom.html
http://www.magentocommerce.com/magento-connect/gala-color-swatches-free-9787.html
http://www.uniformadvantage.com/
Wednesday, 18 July 2012
How to play youtube videos in magento website?
Create an attribute "video_embed_code"
Now go to attribute set : Default
assign this attribute to general.
When you add product it shows on left side label Video Enbed Code : 12AvSETQ
Now save the product
While displaying product on product detail view page :
getData('video_embed_code')): ?>
getResource()->getAttribute('video_embed_code')->getFrontend()->getValue($_product); ?>
Tuesday, 17 July 2012
How to get Subtotal of current cart in magento?
$intTotal = $objCheckout->getSubtotal();
Sunday, 15 July 2012
How to implement ajax in magento? (frontend side)
------------
app/code/local/companyname/helloworld/controllers/indexController.php
---------------
class Companyname_HelloWorld_IndexController extends Mage_Core_Controller_Front_Action
{
public function AjaxAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
app/design/frontend/default/themename/layout/helloworld.xml
-----------------------
app/design/frontend/default/themename/template/page/ajax.phtml
--------------------------------
getChildHtml('content'); ?>
app/design/frontend/default/themename/template/helloworld/ajaxresponse.phtml
--------------------------------
echo "response of ajax is executed";
?>
How to implement module creater in magento?
--------------------------------------------------------------------------------
www.magentocommerce.com/magento-connect/modulecreator.html
install into local server and execute by folllowing url
--------------------------------------------------------------------------------
http://127.0.0.1/modulecreater/
Namespace : Your company name
Module : module name
Root Directory : ..\magento_blank (magento project name)
Design : default
Friday, 13 July 2012
How to get attribute details from attribute in magento?
$intAttributeLabel = 'color';
$objAttributeInfo = Mage::getModel('eav/entity_attribute')->load($intAttributeId);
$strFrontendLabel = $objAttributeInfo->getFrontendLabel();
Thursday, 12 July 2012
How to display mysql query in magento?
//echo $objCategoryProducts->printLogQuery(true);die;
Monday, 9 July 2012
in_array example
$intProductCategoryId = 66;
if(in_array($intProductCategoryId,$arrDefaultArray))
{}
How to get prarent category id from current category in magento?
$objCurrCat = Mage::getModel('catalog/category')->load($objParentCat->getParentId());
How to fetch all categories of product in magento (on product details page)?
$_product = $product_model->load($intCurrentProductId);
$arrAllCurrentProductCategories = $product_model->getCategoryIds($_product);
How to getch all root categories and its subcategories in magento?
$objParentCategories = Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('parent_id',$intRootCategoryId)->addAttributeToFilter('is_active',1)->setOrder('position','ASC');
foreach($objParentCategories as $objSpecParentCategory)
{
$objFinalCategory = Mage::getModel('catalog/category')->load($objSpecParentCategory->getId());
$objSubCategories = Mage::getModel('catalog/category')->getCollection()->addAttributeToFilter('parent_id',$objSpecParentCategory->getId())->addAttributeToFilter('is_active',1)->setOrder('position','ASC');
if ($objSubCategories->count())
{
foreach($objSubCategories as $objSpecSubCategory)
{
$objFinalSubCategory = Mage::getModel('catalog/category')->load($objSpecSubCategory->getId());
$objFinalSubCategory->getUrl();
$objFinalSubCategory->getName();
}
}
}
Sunday, 8 July 2012
Some Useful links
resume format http://speckyboy.com/2010/05/05/10-free-professional-html-and-css-templates/
for upload n number of files http://www.mediafire.com/myfiles.php?r=hjyye
torrent like for downloads http://www.picktorrent.com/
rajesh blog http://linuxopensourceindia.blogspot.com/
magento extension link http://www.magentocommerce.com/magento-connect/
vizualize me resume update site http://vizualize.me/
online recharge http://www.paytm.com/
for buying domain http://www.godaddy.com/
jobs website http://www.jobrapido.co.in/
online shopping link http://www.homeshop18.com/
xml and rss feed links http://www.w3schools.com/php/php_ajax_rss_reader.asp
for good sms http://www.feelings2share.com/
links for download serial keys http://www.serials.ws/index.php
light box important link http://orangoo.com/labs/GreyBox/
javascript key event code link http://www.webonweboff.com/tips/js/event_key_codes.aspx
trace mobile number (check mobile number is of which state and city) http://trace.bharatiyamobile.com/
websites ratings http://www.seomoz.org/web2.0
website for download document http://www.docstoc.com/
mysql cookbook http://www.freeopenbook.com/mysqlcookbook/mysqlckbk-chp-5.html
calculate internet speed http://pcnineoneone.com/speedtest.php
sms sending site with no site name come on footer http://www.site2sms.com/user/send_sms_next.asp
online tshirt purchase http://www.tshirts.in/
pick torrent http://www.picktorrent.com/
torrent links for download http://www.torrentportal.com/
torrent links for download http://extratorrent.com/
jquery slider carhousies http://www.designdim.com/2011/01/19-outstanding-jquery-sliders-and-carousels/
http://thomaslanciaux.pro/jquery/jquery_carousel.htm
How to create custom themes in magento ?
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
How to get price symbol of current store in magento?
Mage::helper('checkout')->formatPrice($this->getSubtotal())
How to get all subcategory details of current category in magento?
}
How to show total shopping cart price in Header Magento?
$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?
$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 remove index.php from URL magento?
- 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?
{
$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
if ($customerAddressId)
{
$address = Mage::getModel('customer/address')->load($customerAddressId);
}
else
{
$address = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress();
}
How to speed up Magento?
You can enable Magento Compilation from your Magento admin panel > System > Tools > Compilation.
How to show only first name in magento welcome message?
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?
$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
if($objEavAttribute->getFrontendInput() == 'select' || $objEavAttribute->getFrontendInput() == 'multiselect' || $objEavAttribute->getFrontendInput() == 'boolean')
{
echo $_product->getAttributeText($value);
}
else
{
echo $_product->getData($value);
}
Move or Remove Callouts on the left or right sidebar in magento
Custom 'Sort by' drop-down menu options Lowest price, Higest price, Name A-Z, Name Z-A, Newest to Oldest & Oldest to Newest in magento
http://magento-talks.blogspot.in/2011/08/custom-sort-by-drop-down-menu-options.html
How to show total shopping cart price in Header Magento?
$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 add Quantity Box in the Category Products Listing Page in magento?
How to delete test orders from database in magento?
TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
ALTER TABLE `sales_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_int` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_text` AUTO_INCREMENT=1;
ALTER TABLE `sales_order_varchar` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
Delete test products, categories, customers, products reviews and ratings in magento
SALES RELATED TABLES
***************************************
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
TRUNCATE `sales_flat_creditmemo_grid`;
TRUNCATE `sales_flat_creditmemo_item`;
TRUNCATE `sales_flat_invoice`;
TRUNCATE `sales_flat_invoice_comment`;
TRUNCATE `sales_flat_invoice_grid`;
TRUNCATE `sales_flat_invoice_item`;
TRUNCATE `sales_flat_order`;
TRUNCATE `sales_flat_order_address`;
TRUNCATE `sales_flat_order_grid`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_order_payment`;
TRUNCATE `sales_flat_order_status_history`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;
TRUNCATE `sales_flat_quote_shipping_rate`;
TRUNCATE `sales_flat_shipment`;
TRUNCATE `sales_flat_shipment_comment`;
TRUNCATE `sales_flat_shipment_grid`;
TRUNCATE `sales_flat_shipment_item`;
TRUNCATE `sales_flat_shipment_track`;
TRUNCATE `sales_invoiced_aggregated`; # ??
TRUNCATE `sales_invoiced_aggregated_order`; # ??
TRUNCATE `log_quote`;
ALTER TABLE `sales_flat_creditmemo_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_creditmemo_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_invoice_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_order_status_history` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_address_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_item_option` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_payment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_quote_shipping_rate` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_comment` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_grid` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_item` AUTO_INCREMENT=1;
ALTER TABLE `sales_flat_shipment_track` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated` AUTO_INCREMENT=1;
ALTER TABLE `sales_invoiced_aggregated_order` AUTO_INCREMENT=1;
ALTER TABLE `log_quote` AUTO_INCREMENT=1;
#########################################
# DOWNLOADABLE PURCHASED
#########################################
TRUNCATE `downloadable_link_purchased`;
TRUNCATE `downloadable_link_purchased_item`;
ALTER TABLE `downloadable_link_purchased` AUTO_INCREMENT=1;
ALTER TABLE `downloadable_link_purchased_item` AUTO_INCREMENT=1;
#########################################
# RESET ID COUNTERS
#########################################
TRUNCATE `eav_entity_store`;
ALTER TABLE `eav_entity_store` AUTO_INCREMENT=1;
##############################
# CUSTOMER RELATED TABLES
##############################
TRUNCATE `customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `tag_properties`; ## CHECK ME
TRUNCATE `wishlist`;
TRUNCATE `log_customer`;
ALTER TABLE `customer_address_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetime` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimal` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_int` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_text` AUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varchar` AUTO_INCREMENT=1;
ALTER TABLE `tag` AUTO_INCREMENT=1;
ALTER TABLE `tag_relation` AUTO_INCREMENT=1;
ALTER TABLE `tag_summary` AUTO_INCREMENT=1;
ALTER TABLE `tag_properties` AUTO_INCREMENT=1;
ALTER TABLE `wishlist` AUTO_INCREMENT=1;
ALTER TABLE `log_customer` AUTO_INCREMENT=1;
##############################
# ADDITIONAL LOGS
##############################
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;
TRUNCATE `report_event`;
TRUNCATE `report_viewed_product_index`;
TRUNCATE `sendfriend_log`;
### ??? TRUNCATE `log_summary`
ALTER TABLE `log_url` AUTO_INCREMENT=1;
ALTER TABLE `log_url_info` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor` AUTO_INCREMENT=1;
ALTER TABLE `log_visitor_info` AUTO_INCREMENT=1;
ALTER TABLE `report_event` AUTO_INCREMENT=1;
ALTER TABLE `report_viewed_product_index` AUTO_INCREMENT=1;
ALTER TABLE `sendfriend_log` AUTO_INCREMENT=1;
### ??? ALTER TABLE `log_summary` AUTO_INCREMENT=1;
SET FOREIGN_KEY_CHECKS=1;
How to display price with currency and format?
How to define block on cms pages on admin
How to define homepagecontent from backend page in magento?
ALso product category page having category id 36 included on home page.
OR