ImportError: No module named magento

Leave a comment

2014-09-19 07:01:56,768 18467 CRITICAL ? openerp.modules.module: No module named magento
2014-09-19 07:01:56,768 18467 ERROR ? openerp.service: Failed to load server-wide module `web`.
The `web` module is provided by the addons found in the `openerp-web` project.
Maybe you forgot to add those addons in your addons_path configuration.
Traceback (most recent call last):
File “/var/www/juvaliaOpenErp/openerp/service/__init__.py”, line 60, in load_server_wide_modules
openerp.modules.module.load_openerp_module(m)
File “/var/www/juvaliaOpenErp/openerp/modules/module.py”, line 415, in load_openerp_module
getattr(sys.modules[‘openerp.addons.’ + module_name], info[‘post_load’])()
File “/var/www/juvaliaOpenErp/openerp/addons/web/http.py”, line 628, in wsgi_postload
openerp.wsgi.register_wsgi_handler(Root())
File “/var/www/juvaliaOpenErp/openerp/addons/web/http.py”, line 517, in __init__
self.load_addons()
File “/var/www/juvaliaOpenErp/openerp/addons/web/http.py”, line 580, in load_addons
m = __import__(‘openerp.addons.’ + module)
File “/var/www/juvaliaOpenErp/openerp/modules/module.py”, line 133, in load_module
mod = imp.load_module(‘openerp.addons.’ + module_part, f, path, descr)
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/__init__.py”, line 6, in <module>
import magento_model
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/magento_model.py”, line 34, in <module>
from .unit.backend_adapter import GenericAdapter
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/unit/__init__.py”, line 5, in <module>
import import_synchronizer
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/unit/import_synchronizer.py”, line 32, in <module>
from ..related_action import link
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/related_action.py”, line 35, in <module>
from .unit.backend_adapter import GenericAdapter
File “/var/www/juvaliaOpenErp/openerp/addons/magentoerpconnect/unit/backend_adapter.py”, line 26, in <module>
import magento as magentolib
ImportError: No module named magent

 

 

Ans : 

use this commands

sudo apt-get install python-pip
sudo pip install magento

Magento: Get the current date and time according to the timezone

4 Comments

1
2
3
4
Mage::getModel('core/date')->date('Y-m-d H:i:s');
OR
date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time()));

More

Get customer name in Magento

Leave a comment

1
2
3
4
5
6
$session = Mage::getSingleton('customer/session');
 
if($session->isLoggedIn()) {
   $customer = $session->getCustomer();
   echo $customer->getName();
}

PHP Installation / How to Installation PHP

Leave a comment

What do you Need?

If your server supports PHP you don’t need to do anything.

Just create some .php files in your web directory, and the server will parse them for you. Because it is free, most web hosts offer PHP support.

However, if your server does not support PHP, you must install PHP.

Here is a link to a good tutorial from PHP.net on how to install PHP5: http://www.php.net/manual/en/install.php

Download PHP

Download PHP for free here: http://www.php.net/downloads.php

Download MySQL Database

Download MySQL for free here: http://www.mysql.com/downloads/

Download Apache Server

Download Apache for free here: http://httpd.apache.org/download.cgi

Magento Check if on Product Page or Magento Check is Product Page

Leave a comment

I needed to setup a Google Website Optimizer test on one of our store’s product pages, which meant that rather than injecting GWO javascript onto unnecessary pages, it would be more efficient for the end user to only receive this code on product view pages.  The code to quickly check if a product is available and thus on a product page and also avoid using a Singleton or setting up a typical $product object, use:



<?php if (Mage::registry('current_product')) { ?>



A registry, in my limited understanding, is a large collection of objects in which a key is requested and a value returned.

Remove Sidebar Blocks With Layout Update XML

Leave a comment

Magento’s sidebar comes with lots of great features like a quick view of your shopping cart and items you’ve marked to compare.

But what if you don’t want to use all of those items on a page? Sure, you could disable features, but what if you only want to hide features on a specific page?

Say, for example, you want to create a homepage using the 2-columns-left layout. Having the sidebar navigation available on your homepage could be a great way to increase accessibility on your site, but the Shopping Cart and other features may not be appropriate for the home page.

The best solution for a scenario like this is to remove unwanted blocks from a specific page using Layout Update XML.

For this example you would set up your categories and your homepage as usual, and then to remove the extra sidebar blocks on the homepage, go to edit your homepage’s CMS page, and under Layout Update XML, create the appropriate remove tags, as in this example:

<reference name="left">
<remove name="cart_sidebar"></remove>
<remove name="catalog.compare.sidebar"></remove>
<remove name="sale.reorder.sidebar"></remove>
</reference>

This method can be used on CMS pages, categories, product pages – just about anywhere on your site!

For more help on this topic, ask a real Magento Expert at https://anilpawar1202.wordpress.com/ and get a quick answer to your Magento question for free!

Adding a Static Block to your .phtml files in Magento

Leave a comment

How to change footer links

Leave a comment

This tutorial will show you how to edit footer link in Magento templates. Usually the footer links are:

About Us, Customer Service, Site Map, Search Terms, Advanced Search, Contact Us

Before you proceed please make sure your Magento cache is refreshed and disabled.

Static Block footer links

The footer links could be different for each template. You can find them in the Magento admin panel > CMS > Static blocks. However each Magento template has static block called Footer Links

This block contains 2 links: About Us and Customer Service.

The static block code looks as follows:

1
2
3
4
<ul>
  <li><a href="{{store direct_url="about-magento-demo-store"}}">About Us</a></li>
  <li class="last"><a href="{{store direct_url="customer-service"}}">Customer Service</a></li>
</ul>

To link it to the extarnal URL replace:

1
store direct_url="about-magento-demo-store"

with your website URL (http://your_URL_here)

To link it to the internal page replace:

1
store direct_url="about-magento-demo-store"

with:

1
store direct_url="HERE INSERT THE PAGE, CATEGORY OR PRODUCT PAGE LINK"

For example:

1
store direct_url="sample_product"

Magento core footer links

Other 4 links Site Map, Search Terms, Advanced Search, Contact Us are stored in XML files. Open your Magento installation folder, go to app/design/frontend/ folder.

Depending on the template version you may see folders like: blank, base and default. Open each and search for your template folder (theme###).When you are in the template folder open Layout folder.

Site Map

Open catalog.xml file. Edit:

1
2
3
4
5
6
<reference name="footer_links">
    <action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map">
        <label>Site Map</label><url helper="catalog/map/getCategoryUrl" />
        <title>Site Map</title>
    </action>
</reference>

Search Terms and Advanced Search

Open catalogsearch.xml file. Edit:

1
2
3
4
5
6
7
8
9
10
11
12
<reference name="footer_links">
    <action method="addLink" translate="label title" module="catalogsearch" ifconfig="catalog/seo/search_terms">
        <label>Search Terms</label><url helper="catalogsearch/getSearchTermUrl" />
        <title>Search Terms</title>
    </action>
    <action method="addLink" translate="label title" module="catalogsearch">
        <label>Advanced Search</label>
        <url helper="catalogsearch/getAdvancedSearchUrl" />
        <title>Advanced Search</title>
    </action>
</reference>

Contact Us

Open contacts.xml file. Edit:

1
2
3
4
5
6
7
8
<reference name="footer_links">
    <action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled">
        <label>Contact Us</label>
        <url>contacts</url>
        <title>Contact Us</title>
        <prepare>true</prepare>
    </action>
</reference>

In case your footer contains RSS link it could be found in the layout/rss.xml file

1
2
3
4
5
6
7
<reference name="footer_links">   <action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled">
        <label>Contact Us</label>
        <url>contacts</url>
        <title>Contact Us</title>
        <prepare>true</prepare>
    </action>
</reference>

Note: if your template folder (theme###/layout) doesn’t contain the necessary files search in the parent theme folder. For example if there are no necessary files in default/default/layout folder search in default/theme###/layout. The same if no files in the base/theme###/layout folder, search in base/default/layout folder.

How to change footer links, 3.0 out of 5 based on 1 rating

How to install Magento ?

Leave a comment

Steps:-

Hello world!

1 Comment

Welcome to WordPress.com! This is your very first post. Click the Edit link to modify or delete it, or start a new post. If you like, use this post to tell readers why you started this blog and what you plan to do with it.

Happy blogging!