All about Magento E-commerce Store.......MagentoForum: August 2011

Wednesday, August 24, 2011

Magento: How to change order status programmatically?

Here, I will show you, how you can change your order status programmatically (with PHP coding).
First, you need to load your order.
If you have order id, you can load order in the following way:-

Magento: PayPal Website Payments Standard not displayed

I am having problem in displaying PayPal payment method in payment method section of onepage checkout in Magento.
I am using "PayPal Website Payments Standard".
I have enabled this module from backend (System -> Configuration -> SALES -> Payment Methods -> PayPal Website Payments Standard).
I have also entered the Business Name and Business Account at "Website Payments Standard" (System -> Configuration -> SALES -> PayPal Accounts -> Website Payments Standard). I have set Sandbox Flag = Yes and Debug Flag = Yes. I am using Sandbox business name and account.

Magento: How to change or reorder top links?

In the default magento installation, the top links are as follows:
My Account | My Wishlist | My Cart | Checkout | Log In
In order to change or reorder them you have to do some changes in layout files (xml files).
You can do changes for My Account, Log Out, and Log In from customer.xml file. You can change the title and position of these menu from there.

Magento: Show Currency Selector in header

Here, I will show you how you can change the location of currency selector to header in Magento.
By default, the currency selector is displayed in the left sidebar. Here, I will show you how you can show it in header just below the language selector.

Magento: Show Currency Selector in right sidebar

Here, I will show you how you can change the location of currency selector in Magento.
By default, the currency selector is displayed in the left sidebar. Here, I will show you how you can show it in right sidebar.
Showing currency selector in product view detail page
Put the following code in layout/directory.xml

Magento: Convert Price from Current Currency to Base Currency and vice-versa

Here is a quick code to convert price amount from current currency of the shop to base currency. This is applicable when you have a multiple currency shop.
From the code below, you can convert any currency you desire. You just need the 'From Currency Code' and 'To Currency Code'. In the example below, I will be converting the current currency price to base currency price. You can do the vice-versa as well.

Magento: How to change Currency symbol by Model Override ?

In my previous article, I have written about how you can change the currency symbol by making some change in the Zend (lib/Zend/Locale/Data/en.xml) file.
It's easy way but the main drawback of this method is that all your changes will vanish once you upgrade Magento.
A better way will be overriding Magento model classes that are responsible for fetching the currency symbol.
In this article, I will be showing you how to override Magento model classes to change the currency symbol.

Wednesday, August 10, 2011

Develop your own Magento mobile application

Great! I'll give you some pointers on how to get a grasp on Magento's XMLConnect, an extension that serves Magento Mobile application.Keep in mind that XMLConnect extension comes 'preinstalled' in Magento CE 1.5 and later, but you can get it from Magento Connect.

The Big Picture
Do you want to develop your own Magento mobile application?
Awhile ago, Magento Mobile was released for iPhone, iPad and Android devices. It consists of two parts: a Magento web store with an XMLConnect extension installed and configured, and a native application itself.
XMLConnect extension's purpose here is to serve your application with requested data (category listing, product information, etc.) and execute desired actions (buy, log in, checkout, etc.).
Basically, application sends a request (plain HTTP GET/POST) to your Magento store (XMLConnect) and it responds with an XML result.
The best way to get familiar with XMLConnect is to see it in action:
1) Set up a Magento store on your web server with some sample data
2) In Magento admin->Mobile->Manage Apps add a new mobile application
3) Install Magento Mobile on your device
4) Start Magento Mobile on your device with your Magento store url and the app code of the application you just created in Magento admin->Mobile
While exploring Magento Mobile, keep an eye on (Apache) activity log file to see exactly what the application is requesting from the server.
For instance, the first request would probably be the application configuration request.
We recognize in this request an app code (in this example it is "defand1″) and your device's screen size (here it's "480×800″).
Let's check out what is the result of this request. In your browser navigate to:
(obviously, replace "magentoivica.loc" with your web server name. Recognize the rest of the url?)
Voilá, what you should get is an entire configuration of your app (as it is set in your Magento admin) in an XML format.
Using this practice, you can easily explore most of the capabilities of XMLConnect. Also, it may be necessary to get into the code of XMLConnect if you want to master some of the more advanced actions (such as the checkout process).
Ok, now you know basics of using XMLConnect, how to make a request and what to expect as a result. But, how to use this information in an Android (Java) environment?
You probably already know something about parsing XML data. I will show you a better way (probably) which will allow you to have more modularity and sustainability in an Android application development.
So, stay tuned :)