To create your connection, create a custom module and add the following to your config.xml. The code below is the bare minimum needed to get the external database connection working.
This works fine, however kind of takes the point away from having this connection available in Magento.
Using models to access the database keeps our code style uniform throughout Magento. Also, it means we can integrate any other CMS or database driven application without learning it's coding practices. To achieve this, simply add models to your custom module like you would for any other module.
I will attempt to demonstrate how to set up the models and config.xml files now. For this example I will pretend I am integrating Magento with a system that lists books (reading is cool!).
That's the bare minimum needed for your models to be able to access the database!
To inform Magento about our models, we need to register them in config.xml. Below is an updated version of config.xml with the models for Book registered.
That's it, the models should now be registered in Magento!
Testing them is easy enough, just treat them like normal Magento models.
//You can even update records!
This is one of my first blogs so I probably haven't written this up as well as I could have, however, I think that using a second database in Magento can be extremely useful. I've written a very good WordPress/Magento plugin which gives access to all WordPress post/category/image/link etc information. If you would like to discuss this plugin or would like to use it in one of your sites then please let me know!
Magento is a new and powerful eCommerce system offering rich customization possibilities by extensions and modules. Magento is built on a fully modular model that influences an unlimited scalability and flexibility for your store. Part of customizing Magento is, creating Magento custom Modules. These allow you to inject functionality anywhere, whether in a "static" block fashion that's more than static, or a shipping/payment module, or large module to do something as large as integrating a 3rd party system (or multiple systems).
Basically, magento module is an extension which extends the features and functionality of Magento. Some concrete examples of modules are additional payment gateway integrations, or a featured items promotional tool. With Magneto's fully object-oriented programming, all modules are immediately accessible via templates tags from any template files. And because Magento is feature-rich right out of the box, you'll never again have to be dependent on a programmer to finish the simplest tasks for you. Magento also thrives on an extensive network of knowledgeable community members (including the official Magento Team), so you will never need to think twice about where to get guidance should you need it along the way.
Part of customizing Magento is, of course, creating custom Modules. These allow you to inject functionality anywhere, whether in a "static" block fashion that's more than static, or a shipping/payment module, or large module to do something as large as integrating a 3rd party system (or multiple systems).
Creating a magento module involve several steps. This article describes the steps that need to be followed to create a new module.
1) Create directory app/code/local/mymodulepack. Here 'mymodulepack' will be the new directory folder where you can create modules.
2) Create module named 'My Module' in above defined directory path. This will be your module directory which will contain required files like models, blocks, controllers etc.
3) Now add your new module xml file in app/etc/modules/mymodulepack _All.xml. Consider that _All.xml will be used to add all new module definitions to the same file instead of cluttering the etc/modules folder with many files.
4) Following defined code is used to inform Magento that there is an active module (you can turn it off from here by setting 'active' to false). Also that it is located in the 'local' code pool.
5) Now you can enable or disable this module at Admin -> System -> Advanced. Here you can see your new module 'Mymodulepack_MyModule' listed there with status enable.
6) And now create the block php class file at app/code/local/Schogini/Example/Block/Myview.php which contains a function that returns the string 'Hello World'.
7) Now make a config.xml file in app/code/local/Mymodulepack/MyModule/etc directory. This is done to enter configuration information for the module.
8) Now we need to create a template file which uses the View Block Class to display the message "Hello World". Create a template (phtml) called myview.phtml in the following directory: appdesignfrontenddefaultdefaulttemplatemymodulemyview.phtml.
9)The module is now ready for use. You can view the output by two ways.
At Biztech Consultancy – India based website Development Company, we offer an efficient Magento Development & Magento customization services for ecommerce website development at competitive price. Our Magento developer helps in Magento Themes development, Magento Design Integration, Magento module development, magento custom module development, Magento Custom Development, etc.
Magento is becoming one of the best E-commerce store which is gaining popularity by leaps and bounds. With this rate of increasing popularity, many existing and new stores are bound to migrate or start with Magento pretty soon. Although, Magento is quite good but it requires proper knowledge before you indulge yourself into Magento customization. If you want to create a new Magento theme by yourself that's a different story altogether but if want to leverage the functionality and layout provided by any premium or free Magento theme then you should know how to install the theme soon after successful download.
Install via placing appropriate theme template folders in your Magento Installation.
It entirely depends upon the theme availability and theme quality but if the theme is available in Magento Connect (it has a good collection of free & premium themes) then you can install it very easily without any technical knowledge. Following is a breakdown of how to install a Magento theme via Magento Connect and via inserting new theme template in your existing or new Magento installation.
2. Now, you will see a button right under the theme image called "Get Extension Key". You need to click "Get Extension Key" and agree to extension license agreement.
3. After you select agree checkbox and click "Get Extension Key" you will see the Magento extension key right there itself (displayed in the box). You need to paste this extension key in your store's Magento connect tab. Keep it safe.
5. In order to install this theme into your Magento store you need to login to your store admin panel and go to System->Magento Connect->Magento Connect Manager. Magento connect manager will ask you to login again. You need to use your store admin login credentials to get past the login screen.
You need to paste the theme extension key copied from the Magentocommerce.com's Magento connect here.
Magento connect checks for the extension key validity and downloads the theme on your system. Depending upon your internet connection speed (bandwidth) and theme size it will take time to install. These extension keys are specifically created with a unique combination so that there is no confusion over which extension to download. If you have correct extension key and there are no errors in theme or your internet bandwidth you will not see any error messages. In case there are any error messages try downloading and installing again. If you do not succed at all then you can contact the theme owner or ask questions in the theme documentation tab.
6. Soon after you see "Theme successfully installed" message go to System->Configuration->Design->Themes and provide the theme name in Default field (which will change your default theme to this new theme) and click "Save Config" button at the top right corner of your screen.
7. A Magento theme revolves around different columns in your theme layout. In case your store home page doesn't load properly and shows weird design then go to CMS->Manage Pages. You will notice that there are two different layouts for the home page (may be more depending upon how many themes you have tried in the past). Based on your new theme layout disable all the other home page layouts. You can easily disable/enable the layouts by clicking "Enabled" or "Disabled" links provided in the status field.
8. Check your home page if the store is looking just like your new theme, you are done. If you still see problems chances are that you haven't disabled the correct home page layout. Repeat step 7 until you see a correct store home page (not required if you have only two home page layouts showing in your "Manage Pages" section.
This was the easiest and fastest way of installing a Magento theme using Magento Connect manager.
Many Magento theme sites don't publish their theme template in Magento connect (sometimes their themes do not pass through Magento connect guidelines). These themes are provided directly by the theme owner sites. If you are interested in downloading a Magento theme from such sites then following are the steps required to install a Magento theme within your existing Magento installation.
Unlike single template themes (WordPress) Magento themes are quite different as its layout depends on four elements i.e.
In order to install and integrate a new theme you need to follow few steps more than what you are accustomed to follow in case of wordpress themes.
If you have already downloaded your preferred Magento theme then here is how you can install and integrate this new theme into your existing Magento installation.
Now, as you have added your newly downloaded theme in your Magento store you need to login to your Magento store admin to tell Magento which theme to use as layout.
Sometimes Magento Cache doesn't let you see your changes instantly. In order to test your new theme it would be wise to disable cache for the time being. Go to System > Cache Management and select "Disable" then click "Save Cache". Once you are done with all the steps Enable the cache again.
Type the name of your new theme which you have copied in your Magento installation in front of skin (Images/CSS) input box and click "Save Config".
Optional – If you have downloaded a widget ready Magento template then you need to install the widget provided with the theme. In order to install Magento theme widget you have to go to CMS -> Static Blocks and click on "Add New Block". Based on your widget installation instructions you have to add your new widget and activate that using this new widget block. Finally select "Enabled" and click "Save Block". Go and select "Custom Design" Tab and in Layout select "Homepage" otherwise your widget won't show on home page.
Optional – Home page of default Magento store is a CMS block so you have to provide custom code there in order to display something on home page. To do so you have to go to CMS- > Manage Pages and select "Home page" and in the content area type the home page content code which comes up with your new theme. You can change this area anytime you want.
All set. Open up a new page on your browser and type in your store name to see the new theme. Your new Magento theme is ready to be used.
I have installed a New Magento Theme but i can't see any products showing up, why?
Select the category you want to show on your Homepage and look for its ID.
Paste the code for showing Products on home page with the selected category ID.
I hope this is quite comprehensive tutorial for installing Magento themes. I would love to hear your thoughts, views and experiences. Please leave me a comment and let me know.
We can completely create a customized wp plugin. Some time we may require to add text editor on our plugin.
We can directly using the_editor() function to getting the text editor on our plugin.
When the site loads on my I pad the red menu bar is red and turns black along the right side of the page?Actually menu bar is inside a div.And i have given bg color as red with 100%.
Problem is on the iPad viewport .iPad default viewport is 980 pixels .So even if you are giving 100% width we will not get the actual result.He when the site loads on my I pad the red menu bar is red and turns black along the right side of the pagere we are not setting content /element width .So by resetting the width of the view port , we can solve the issue.I added the following code on my style sheet and solved the issue.Thanks to all the div available on net.
PhpMyAdmin is a great tool to manage the mysql database.But if we have large database and table to handle,it will be great if we able to do the same with the help of the linux command.