Page 5 - Magento Tutorial
-
- January 11, 2014
Magento Wordpress Related Post using fishpig integration display Related Post
-
- January 11, 2014
If you are modifyed some file automaticaly like log , cache in any application , web site on development or live . you does`t want to update that particular file into your git repository .
You have a question about How to change Git updated index to previous index setting , just use this following comment in your comment line with current available git copy of your folder .
find {your folder} -type f -exec git update-index --assume-unchanged '{}' \;
for example from magento change the index of media folder
find media/catalog/product/v/ -type f -exec git update-index --assume-unchanged '{}' \;
-
- January 11, 2014
Hi friends,
Some people ask about the difference betweenMage::getModel() and Mage::getSingleton()
in Magento. Here is the difference between these two:
Mage::getModel('module/model')
will create a new instance of the model object (if such object exists in configuration)
So if we write:Mage::getModel('catalog/product'),
it will create new instance of the object product each time. So,
$p1 = Mage::getModel('catalog/product');
$p2 = Mage::getModel('catalog/product');
Then $p1 is a one instance of product and $p2 is another instance of product.While Mage::getSingleton('catalog/product') will create reference on existing object (if object does not exist then this method will create an instance using ::getModel() and returns reference to it).
So, if
$p1 = Mage::getSingleton('catalog/product');
$p2 = Mage::getSingleton('catalog/product');
Then $p1 and $p2 both refer to the same instance of product as reference $p2.That's all.. Cheers.. :)
-
- January 11, 2014
Magento Wordpress Integrated Search
Magento Wordpress integrated search is used to search your blog content in your magento search.view your blog content results in magento front end .
Content Search From
* wordpress blog
* Hesk Knowledgebase
* Drpal content
* Joomla content
comeing soon...
-
- January 11, 2014
Here is the detail for Get current store id in magento
Magento Get store data.
Mage::app()->getStore();
Magento Store IdMage::app()->getStore()->getStoreId();
Magento Store codeMage::app()->getStore()->getCode();
Magento Website IdMage::app()->getStore()->getWebsiteId();
Magento Store NameMage::app()->getStore()->getName();
Magento Is ActiveMage::app()->getStore()->getIsActive();
Magento Store Home Url.Mage::app()->getStore()->getHomeUrl();
-
- January 11, 2014
You want to integrate your store to blog.simply follow my simple steps.
Step 1:
Goto magneto store files edit index.php add these lines
if ( strpos($_SERVER['REQUEST_URI'], 'index.php/admin') === FALSE )
{
define('WP_USE_THEMES', false);
require_once('../wp-load.php'); // configure your WordPress location.
}
Step 2:
copy "Your-magento-folder/app/code/core/Mage/Core/functions.php"
to "Your-magento-folder/app/code/local/Mage/Core/functions.php"
If u not have the folder structure create that folder and paste .
Step 3:
find "function __() " this line around 90 to 100 in "Your-magento-folder/app/code/local/Mage/Core/functions.php"
thats look like
"function __(){return Mage::app()->getTranslator()->translate(func_get_args());}"U change it like this"if (!function_exists('__')) {function __(){return Mage::app()->getTranslator()->translate(func_get_args());}}" -
- January 11, 2014
Step 1:
Go to this folder "{Your vtiger root}/vtlib/ModuleDir/" copy any of the folder you want to create module for which version if vtiger . Paste in to {Your vtiger root}/modules/{Your Module name}.
Step 2:
Go to following directory "{Your vtiger root}/modules/{Your Module name}/" . You have to change the files name as following. Replace "ModuleFile" into {Your Module name}
ModuleFileAjax.php -> {Your Module name}Ajax.php
ModuleFile.js -> {Your Module name}.js
ModuleFile.php -> {Your Module name}.php
Step 3:
edit the following file in your faverot editor "{Your vtiger root}/modules/{Your Module name}/{Your Module name}.php"
change "payslip" into "{Your Module name}" case sensitive
Change "ModuleClass" into "{Your Module name}"
-
- January 11, 2014
In this tutorial we tell you how to retrive the content from database with the use of table name . here is the core help to fetch the content using select query .
$connection = Mage::getSingleton('core/resource')->getConnection('YOUR_DATABASE_NAME');
//I assuming that you created the model for your table
$result = $connection->fetchAll("SELECT *FROM YOUR_TABLE");///just checking the result
print_r($result);Hope this is helps you .
-
- January 11, 2014
how to add wordpress header and footer in magento.after complete my previus tutorial How to integrate magento and wordpress follow my simple steps.
Step 1:(include wordpress header in Your magento store )
Go to this link in your file manager
"
YOUR-MAGENTO-FOLDER/app/design/frontend/default/YOUR-THEME/template/page/html/header.phtml
"
in top of this file u add this simple wordpress function .
"<?php get_header();?>
"
now You check in your magento store wordpress header show nice .
Step 2:(include wordpress footer in Your magento store)
Go to this link in your file manager"YOUR-MAGENTO-FOLDER/app/design/frontend/default/YOUR-THEME/template/page/html/footer.phtml"
open that file delete all coding in that file u add this simple wordpress function only.
"<?php get_footer();?>
"now You check in your magento store wordpress footer show nice .
Note:after adding all this you see some errors in prototype.js file. how to clear this error in next tutorial. -
- January 11, 2014
I have a downloadable product. After I order the product and when my order is complete, I am able to download the product links from ‘My Downloadable Products’ menu in Customer Account section.
I go to ‘My Downloadable Products’ section and I click on the links to download. However, the PDF file opens in the browser itself. I would like to have the feature that asks to download / save as instead of directly opening in the browser.
It is fine with ZIP files. It asks to download and save. However, the PDF files, Images, HTML files, etc. are directly opened in the browser. I want them to download and save. So, a window appearing and asking to save and download the file is what I want.
Solution:
There is a very easy solution to this.
By default, Magento has the Configuration settings to make those files open in the browser itself. You can adjust the configuration settings in Magento Admin to ask for download files instead of opening in the browser.
- Go to