Magento Forum

Offline testing Magento Mobile contents without lincense code
 
bzhang
Jr. Member
 
Avatar
Total Posts:  26
Joined:  2009-02-25
Sydney
 

Hi all there is some error when I submit the post lol, I lost all the typing lol.
So I have to make it quick.
install the Magento Mobile my magento is enterprise 1.8.0
install it manually is better. You can even put this extension to local code not in core as it is just a extension and EE1.8 has no downloader
or Mangeto connect to maintain it, no point to make it core code, haha.
And then find the file code/Mage/core/Controller/Action.php
comment the code below “Load application by specified code and make sure that application exists” to get rid of the licence code.

public function preDispatch()
    
{
        parent
::preDispatch();
        
$this->getResponse()->setHeader('Content-type''text/xml; charset=UTF-8');

        
/**
         * Load application by specified code and make sure that application exists
         */
        /*
        $cookieName = Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME;
        $appCode = isset($_COOKIE[$cookieName]) ? (string)$_COOKIE[$cookieName] : '';
        if (!$appCode) {
            $this->_message(Mage::helper('xmlconnect')->__('Specified invalid application code'), self::MESSAGE_STATUS_ERROR);
            $this->setFlag('', self::FLAG_NO_DISPATCH, true);
            return;
        }
        $appModel = Mage::getModel('xmlconnect/application')->loadByCode($appCode);
        if ($appModel && $appModel->getId()) {
            Mage::app()->setCurrentStore(Mage::app()->getStore($appModel->getStoreId())->getCode());
            Mage::register('current_app', $appModel);
        }
        else {
            $this->_message(Mage::helper('xmlconnect')->__('Specified invalid application code'), self::MESSAGE_STATUS_ERROR);
            $this->setFlag('', self::FLAG_NO_DISPATCH, true);
            return;
        }
        */
    
}
after that you can preview your contents of your iphone store in XML by http://yourstore.com/xmlconnect/index/index
which shows the store categories XML and more… checkout the controller and if you are the developer, it is easy to know all the URLs you are looking for. if you want o see your product which id is 3839 then use http://yourstore.com/xmlconnect/catalog/product?id=3839
if you want to see a cms page use http://yourstore.com/xmlconnect/catalog/product?id=cmspagecode here cmspagecode is the unique code of your cms page it is not number but the url code. you can find it in your admin cms grid view.
This extension is just a XML generator it create the content of your store and make it in XML and send it to Magento then they convert it with Object-C to make it display nice in Apple apps.

So that all the developers, if you are a good Object C developer and you can make use of this XML generator and fetch the content of the store and customize your mobile view or people can just use JS like jQTouch or Sencha Touch to make a web apps for APPLE with the similar animations for iphone and ipad or ipod. Hope someone come up with something more customize way as we need more customize way of add to cart function. My store need to add people details into the product, so I use custom option text but I need them to field the text input with my format, and this can not be done by magento default and that is not working using magento mobile which is not allow you to customized this way of add to cart funciton and I also need to update the qty when more people add to one product which is actually a service not a physical product. Hope Magento can come up with some solution and we will go with Magento Mobile.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Tim Schulz
Member
 
Avatar
Total Posts:  42
Joined:  2009-11-29
Los Angeles, CA
 

This is a great point.  One of the primary missions of Magento is to “enable the ecosystem”, which means that we’re all about providing our community with the tools they need to innovate and keep our 70,000+ merchants competitive ahead of the innovation curve.  Yes, we’re building a series of incredible applications for the iPhone, Android, iPad, etc.  But what if a merchant or developer just needs to have the building blocks for mobile commerce that other platforms don’t provide?  The answer is as you expressed it..  We’ve created an open source product that now allows developers to build their own innovative and INTEGRATED “mCommerce” products on top of Magento!

 
Magento Community Magento Community
Magento Community
Magento Community
 
bzhang
Jr. Member
 
Avatar
Total Posts:  26
Joined:  2009-02-25
Sydney
 

Thank you for your reply, and Magento is an awesome platform of PHP eCommerce, I really like the cache and the session control and also the collection and its database control which is much more organised than other open source platform no matter Joomla or wordpress or drupal, which sometimes have to write code direct access the database which is hard to read and hard to make extension on top of an extension as the code is not organised or too massy. Our company are really want to lauch the apple app using your services which can provide the professional support and save our development time on object-C and Android, and focus on our business service. We could love to purchase the lincense and the service after solving the challenge that we have currently. As we have customized this eCommerce platform to a booking and reservation platform and we have some custom option attached to each product and it is required and it is just simple text field but we restrict its input by certain format, which I can manage that by page generation or javascript but in the apple app I have no control of that and it will display as default view. I could manage to send the XML custom option from text field to select field and inject the options I have customized, but I need to know the response XML format to store or convert the quote to order by converting the customized options to the simple text field custom option, and create the order object. I do think this is a good challenge, but if we can solve this, and it can solve a lot of problem that other people may have, and make this mobile app extension more flexible and useful. Thank you for the nice work of manento team to make this platform much more outstanding, and I and my company will keep checking this extension, and we are waiting for more good news about it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
cschwan
Jr. Member
 
Total Posts:  3
Joined:  2008-10-07
Freiburg
 

Hey Guys,

there is a better way;-)

1.) open /app/code/core/Mage/XmlConnect/etc/config.xml

Line 352

<magentocommerce_url>www.YOURURL.de/magento/mobile/activate/</magentocommerce_url>
                <
activation_key_url>http://www.YOURURL.de/</activation_key_url>
                
<resubmission_key_url>http://www.YOURURL.de/product/mobile#resubmission</resubmission_key_url>
2.) make your Own index.php to response on : www.YOURURL.de/magento/mobile/activate/
<?php
$arr 
= array ('message'=>'Valid','success'=>true);
echo 
json_encode($arr);
?>
3.) open /app/code/core/Mage/XmlConnect/Controller/Action.php + Add your App Code on 59

public function preDispatch()
    
{
        parent
::preDispatch();
        
        
$this->getResponse()->setHeader('Content-type''text/xml; charset=UTF-8');

        
/**
         * Load application by specified code and make sure that application exists
         */
        
$cookieName Mage_XmlConnect_Model_Application::APP_CODE_COOKIE_NAME;
        
$appCode = isset($_COOKIE[$cookieName]) ? (string) $_COOKIE[$cookieName] '';
        
$screenSizeCookieName Mage_XmlConnect_Model_Application::APP_SCREEN_SIZE_NAME;
        
$screenSize = isset($_COOKIE[$screenSizeCookieName]) ? (string) $_COOKIE[$screenSizeCookieName] '';
//         if (!$appCode) {
//             $this->_message(Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::MESSAGE_STATUS_ERROR);
//             $this->setFlag('', self::FLAG_NO_DISPATCH, true);
//             return;
//         }
        
$appModel Mage::getModel('xmlconnect/application')->loadByCode('geriph1');
        
$appModel->setScreenSize($screenSize);

So now it should work the right way;-)

Christian

 
Magento Community Magento Community
Magento Community
Magento Community
 
purohit_rakesh
Jr. Member
 
Total Posts:  2
Joined:  2011-09-06
 

when i used this step.....

my admin section has stooped working...and getting the error request URl not found on this server

please give solution....for troubelshoot this error.???

 
Magento Community Magento Community
Magento Community
Magento Community
 
Enase
Jr. Member
 
Total Posts:  19
Joined:  2010-05-11
 

Hi Everybody,

All code changes described in the topic are useless. Please do not try to change your code in this way.

Verification code below used to check weather application code exists in your database or not. Most of all actions will work wrong if you provide application code that is not exist. Mobile module can’t initialize device model (android/iphone and etc.) in a right way if you comment out this code.

if (!$appCode{
            $this
->_message(Mage::helper('xmlconnect')->__('Specified invalid app code.'), self::MESSAGE_STATUS_ERROR);
            
$this->setFlag(''self::FLAG_NO_DISPATCHtrue);
            return;
        
}

Also, you don’t need to activate your application to get the xml responses.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top