Magento Hosting BLOG

Blog about Magento, Technologies and Hosting Service

Magento Hosting - ASPHostPortal.com :: Magento API Roles Not Updating

clock June 28, 2013 06:14 by author Mike

Magento is an opensource e-Commerce web application trusted by the world's leading brands. Magento has become a popular choice in the last few years because of all the choices and features it gives while developing an ecommerce website. If you or a 3rd party developer needs to access your Magento powered ecommerce store, then you’ll want to do so via the built-in API. Granting access to the Magento API is a fairly simple task. Giving a Role custom or full access is done under Web Services > Roles. Choose your Role, then select the Role Resources tab. From this screen you can set the access that this particular Role has.

While creating a Role and giving access to the Catalog section I noticed that the Role Resources were never updating, no matter if I gave full or custom permissions. The version of Magento was 1.6.2 (latest at the time of development). There is apparently a bug with the code that affects 1.6.X versions of Magento Community Edition (CE).

The fix is fairly simple and requires a small code adjustment on the core code. Generally, it’s best to copy over the core code you are editing to a local version as your edits will get overwritten if you update the core code. But, since we know that this has been patched in 1.7, it’s best to let Magento overwrite it when we do upgrade.

Below is the code edit: Inside app/code/core/Mage/AdminHtml/Block/Api/Tab/RolesEdit.php we will look inside the constructor for a function call to getPermission.

The old line of code should be:

if (array_key_exists(strtolower($item->getResource_id()), $resources) && $item->getPermission() == 'allow')

The new line of code should be:

if (array_key_exists(strtolower($item->getResource_id()), $resources) && $item->getApiPermission() == 'allow')

This's all step fixed the issue for others running 1.6.X and not being able to edit an API User’s Role Resouces.



Magento Hosting :: SEO Tips for Setting Up Magento eCommerce and Making the Magento product import fully automatic

clock June 14, 2013 06:21 by author ben

Magento eCommerce is quickly becoming one of the more popular eCommerce platforms for businesses of all sizes. Launched in March of 2008, this platform seems to have it all—catalog management, mobile commerce, analytics and reporting, checkout, etc.—and offers both a free version as well as a paid enterprise-level version. However, there is one thing that Magento eCommerce doesn’t get right: SEO.

Search engine optimization (SEO) is one of the most important aspects of Internet marketing. Fortunately, Magento eCommerce isn’t a lost cause. Although it may not be search-engine-ready right away, there are a few things a company owner can do to help get it ready.

Getting Magento eCommerce Ready for SEO

  • Rewrite the Default URL.

You should always look at your URL configuration and make sure it is ready to go for the search engine bots. Long URLs, or URLs in their dynamic forms, can be confusing to search engines and then cause them to miss information that a URL can offer. Fixing a URL configuration is known as “rewriting” the URL, and this can often be completed with a variety of tools. With the Magento platform, it’s as easy as clicking the System section à Configuration panel à Web option à and setting the feature to “Yes.

You may also want to turn off your Store ID code additions so they are not included in your URL. You can find this option in the web configuration setting,

Finally, it’s a good idea to take advantage of 301 redirects to make sure that whether your visitors type in the domain with a “www” and used without the “www” they are taken to the same place. To do this, you must access your site’s .htaccess file and set up rewrites so that search engines know how to index your URLs. You can learn more about the .htaccess file here.

  • Customize aspects of all the different pages for SEO.

As with all things SEO, the content on the magneto platform needs to be optimized for search engines. This means that you should focus on a few specific keywords and make sure that your meta tags, title of your pages, and URL are all optimized for that keyword. You can do this by going to the backend of your site and going from Catalog à the Manage categories section. You will also want to make sure that your images are optimized by using your keywords in the titles of your images. You can find this by going from Images à to Product information.

  • Help speed up your site.

Having a site that loads and works quickly is becoming more and more important in the eyes of Google, but it’s also important if you want to keep your users engaged and decrease frustration. The Magento platform is not known for its speed, but fortunately there are a few things you can do to help speed up the system. First, go to the cache management section and enable all of the caching choices. Next, consider whether or not your web host can handle the volume Magento offers. Finally, combine all of your CSS files into a single page to help improve speed.

Making the Magento product import fully automatic.

If we got the above working, we need to get the working fully automatic. We want to import our products and do a complete reindex of magento every night. First we create a file that can be executed by the shell that imports the products and reindexes it. Call it something like import.sh (sh from shell):

echo mag_import.php 7
php /PATH/TO/YOUR/MAGENTOINSTALLATION/shell/mag_product_import.php 7
echo indexer.php reindexall
php /PATH/TO/YOUR/MAGENTOINSTALLATION/shell/indexer.php reindexall

Try and run the file with the following:

bash /PATH/TO/YOUR/MAGENTOINSTALLATION/shell/shell_dayly.sh

If that all works properly, we can setup our cronjob to do it automatically every night. Enter the following into you shell:

crontab -e

Now, if something happens to our import, somethings goes wrong, etc, we wan't to get notified. Add the following line at the top of the crontab file.

[email protected]

Below the Magento line we add our import cron:

0 0 * * * bash /PATH/TO/YOUR/MAGENTOINSTALLATION/shell/import.sh

Now save the crontab (depends on the editor how) and your all set.

Note: if you want to see error regarding the import, lines that could not be processed open /PATH/TO/YOUR/MAGENTOINSTALLATION/var/log/import.log or browse to the file in the shell and type:

tail -f import.log



About ASPHostPortal.com

We’re a company that works differently to most. Value is what we output and help our customers achieve, not how much money we put in the bank. It’s not because we are altruistic. It’s based on an even simpler principle. "Do good things, and good things will come to you".

Success for us is something that is continually experienced, not something that is reached. For us it is all about the experience – more than the journey. Life is a continual experience. We see the Internet as being an incredible amplifier to the experience of life for all of us. It can help humanity come together to explode in knowledge exploration and discussion. It is continual enlightenment of new ideas, experiences, and passions

Corporate Address (Location)

ASPHostPortal
170 W 56th Street, Suite 121
New York, NY 10019
United States

Sign in