Jump to content
bumbarash

[Contribution] iOSC - mobile version of OSC on your iPhone

Recommended Posts

Yes, as it was mentioned before "Checkout" currently doesn't work on IE. This contribution was initially developed for iPhone and tested on Safari and FF only.

I'm working on IE compatibility right now.

 

ok... thank you... keep all of us posted on the compatibility with IE.... I think if checkout is compatible with IE then it will support all mobile browsers

Share this post


Link to post
Share on other sites

Changes in v1.2

More compatible with IE.

PC Site button link to corresponding page on your main site

When PC Site button clicked redirect is suspended

Share this post


Link to post
Share on other sites
Changes in v1.2

More compatible with IE.

PC Site button link to corresponding page on your main site

When PC Site button clicked redirect is suspended

 

wow thanks... works well on my mobiles...

most payment gateways are not accessable via a mobile browser... can somebody help and tell me how can ssl protected payment gateways be accessed using mobile phones... i have integration codes for wap.... is anybody else facing this problem?

Share this post


Link to post
Share on other sites

Thanks for adding the mobile redirect.

 

Can you explain how the redirect works ?

 

For instance, it does not redirect from the home page. This might be because I made a few changes.

 

It seems to redirect everywhere else which is fabulous. Especially the products page.

 

FANTASTIC JOB.

Share this post


Link to post
Share on other sites

For those of you that wish to add a login/logoff button to the header of your pages.

 

In catalog/mobile/includes/classes/header_title.php

 

Find

$leftButton = " ";

and replace with

        if (tep_session_is_registered('customer_id'))

		$leftButton = '[url="http://%27%20.%20tep_mobile_link%28FILENAME_LOGOFF%29%20.%20%27"]' . tep_image(DIR_MOBILE_IMAGES . "logoff.png") . '[/url]';

	else    	

   		$leftButton = '[url="http://%27%20.%20tep_mobile_link%28FILENAME_ACCOUNT%29%20.%20%27"]' . tep_image(DIR_MOBILE_IMAGES . "login.png") . '[/url]';

 

Don't forget to create a logoff.png and login.png file !!!! and put those two files in your catalog/mobile/images folder.

 

If there is an alignment challenge, change these three lines:

<td class="headerTitleLeft">' . $leftButton . '</td>

 

<td class="headerTitle">' . $this->title . '</td>

 

<td class="headerTitleRight">' . $rightButton . '</td>

 

to:

 

<td align="left">' . $leftButton . '</td>

 

<td class="main" align="center">' . $this->title . '</td>

 

<td align="right">' . $rightButton . '</td>

 

If you wish to remove the login line from your account go to:

 

catalog/mobile/account.php and add two front-slashes (//) to line 23:

 

// echo tep_mobile_selection(tep_mobile_link(FILENAME_LOGOFF), array(HEADER_TITLE_LOGOFF));

 

Send me a pm with an email address if you want the login/logoff buttons

Share this post


Link to post
Share on other sites

Add a website specific icon to the homescreen of the iphone.

 

Create a 59 x 59 apple_touch_icon.png file with your website logo and place it in catalog/mobile/ directory.

Share this post


Link to post
Share on other sites

Don't forget to put Google Analytics in the catalog/mobile/includes/footer.php file.

 

Monitoring this for three days showed (in our case) 27% of our traffic was redirected to the iPhone.

 

Now it will be interesting to see how many want to browse the full site.

Share this post


Link to post
Share on other sites
Can you explain how the redirect works ?

For instance, it does not redirect from the home page. This might be because I made a few changes.

 

The redirect functionality is in catalog/mobile/includes/classes/mobile_redirect.php file

If it detects that browser is iPhone or Blackberry, then it takes current file and insert directory name 'mobile/' in front of it.

 

So in default OSC installation with SEO URL support

url: http://yoursite.com/the-matrix-p-6.html is actually

 

http://yoursite.com/product_info.php?products_id=6

 

and it will be redirected to

http://yoursite.com/mobile/product_info.php?products_id=6

 

then you press "PC Site" button, redirect will be disabled.

if you have a custom page , let say http://yoursite.com/frontpage.php then you need to create corresponding http://yoursite.com/mobile/frontpage.php

 

Or you could play with .htaccess file to create redirect

Share this post


Link to post
Share on other sites
Andrey - just made a test order in your zaramir store on my iPhone. Went well.

 

Nice work!

 

opps sorry replied to the wrong post

Edited by angelstudio54

Share this post


Link to post
Share on other sites

Everything works great except

 

I get this when trying to checkout

its when i go to mobile/shopping_cart.php

 

Fatal error: Call to undefined method: payment->checkout_initialization_method() in /homepages/33/d200592320/htdocs/catalog/catalog/mobile/shopping_cart.php on line 160

 

 

and

 

I can get all the way threw to checkout process where you confirm payment and it takes you to paypal or whatever processor

and it doenst complete, takes me to the paypal homepage and for google checkout I get this

 

Error 404 - Not found

Your browser can't find the document corresponding to the URL you typed in.

 

Any ideas?

 

Also I use https and found out I needed to add

 

define('DIR_WS_HTTPS_CATALOG', '/catalog/mobile/');

 

to my configure file for anyone haveing the problem of it going to the main site when using https

Hope that helps someone....

and thanks so much for this contibution!!!!

 

Seems the world is going mobile and this really is an amazing addition for all of us, resizes to fit my screen portait or if I flip it to landscape....

Thanks thanks thanks!!!

Edited by angelstudio54

Share this post


Link to post
Share on other sites
I had this code before, nothing with osc. But I changed it to your reference like:

<?php

define('DIR_MAIN_HTTP_CATALOG', '');

define('DIR_WS_HTTP_CATALOG', '/mobile/');

define('DIR_WS_IMAGES', '../images/');

define('DIR_WS_INCLUDES', '../includes/');

define('DIR_MOBILE_IMAGES', 'images/');

define('DIR_MOBILE_INCLUDES', 'includes/');

define('DIR_MOBILE_MODULES', DIR_MOBILE_INCLUDES . 'modules/');

define('DIR_MOBILE_CLASSES', DIR_MOBILE_INCLUDES . 'classes/');

define('DIR_MOBILE_HEADERS', DIR_MOBILE_INCLUDES . 'headers/');

define('DIR_MOBILE_LANGUAGES', 'includes/languages/');

define ('MOBILE_IMAGE_WIDTH', '80px');

define ('MOBILE_IMAGE_HEIGHT', '80px');

define ('FILENAME_MOBILE', 'mobile.php');

define ('FILENAME_PRODUCTS', 'products.php');

define ('FILENAME_ABOUT', 'about.php');

define ('FILENAME_SEARCH', 'search.php');

define ('FILENAME_LANGUAGES', 'languages.php');

define ('SEO_ENABLED', 'false');

?>

 

And it´s still the same. I come directly to the main website when I click on one of the category names :blush:

 

Maybe something interesting, it worked better with the first version, there I had only the problem, wehn I had only a main catergory without a subcategory I was directly linked to the main website. It worked well when I had subcategories. Everything was seen perfectly.

 

So now nothing ois working, I have a direct relinking to the main shop.

 

Any ideas what is going on because I really like this contri!!

 

Thanks a lot

 

 

IF you're using https try adding this to your mobile/includes/configure.php file

 

define('DIR_WS_HTTPS_CATALOG', '/mobile/');

 

i had that problem too then realized it was taking me to https, works fine now

Share this post


Link to post
Share on other sites
Fatal error: Call to undefined method: payment->checkout_initialization_method() in /homepages/33/d200592320/htdocs/catalog/catalog/mobile/shopping_cart.php on line 160

The solution is described here:

http://forums.oscommerce.com/index.php?s=&...t&p=1372554

 

I can get all the way threw to checkout process where you confirm payment and it takes you to paypal or whatever processor

and it doenst complete, takes me to the paypal homepage and for google checkout I get this

Do you know which Paypal and Google contributions you used?

Share this post


Link to post
Share on other sites

Hi there,

 

Thank you for this fantastic contribution. i've just installed it ( iOSC - v1.2) but i've some problems.

- When i click on 'add to cart' button the cart stay empty.

- I've added the the provided code to redirect to mobile but it don't redirect. :huh:

It would be great if someone can help.

Many thanks in advance. :rolleyes:

Share this post


Link to post
Share on other sites
- When i click on 'add to cart' button the cart stay empty.

- I've added the the provided code to redirect to mobile but it don't redirect. :huh:

 

I guess you are testing it on IE (which version do you use?). There are still some compatibility issues , I guess.

Redirect will work only for iPhone/iPod/Blackberry (there is no point to automatically redirect IE or FF , right :) )

Share this post


Link to post
Share on other sites
The solution is described here:

http://forums.oscommerce.com/index.php?s=&...t&p=1372554

 

 

Do you know which Paypal and Google contributions you used?

 

 

Thanks, that fixed the cart issue...

 

as for the contributions I lost track so not sure, I have google checkout, paypal, alertpay, none of them work on mobile, the cash/check works. I also use the coupon CCGV

contribution which has you add lots of things to the checkout_confirmation.php page. That's the only thing I can think of that could be messing it up?

 

Thanks for the help

Share this post


Link to post
Share on other sites
I guess you are testing it on IE (which version do you use?). There are still some compatibility issues , I guess.

Redirect will work only for iPhone/iPod/Blackberry (there is no point to automatically redirect IE or FF , right :) )

 

 

Yes, tried on IE8 and also on 2 mobile but this is the same.

When i use'add to cart' it comes 'View you cart page' 'your cart is empty'

Also when i type: www.mysite.com there is no redirection even on mobiles.

Is there any solutions?

Thanks for your Help.

Share this post


Link to post
Share on other sites
When i use'add to cart' it comes 'View you cart page' 'your cart is empty'

It might be a cookie problem, let me investigate.

When you click on item do you see 'osCsid=....' as part of the query string? What about when you click on 'Add to cart'? Is it same?

I tested it on IE7 seems tobe working. Did you try

http://www.zaramir.com/osc

 

Also when i type: www.mysite.com there is no redirection even on mobiles.

What mobile do you use?

Could you try this link and post me a result:

http://www.zaramir.com/br.php

Share this post


Link to post
Share on other sites
as for the contributions I lost track so not sure, I have google checkout, paypal, alertpay, none of them work on mobile, the cash/check works. I also use the coupon CCGV

contribution which has you add lots of things to the checkout_confirmation.php page. That's the only thing I can think of that could be messing it up?

 

Right now iOSC is working with standard OSC v2.2 contributions (CC, cash on delivery) . I will add Paypal and Google , just give me some time

Share this post


Link to post
Share on other sites
It might be a cookie problem, let me investigate.

When you click on item do you see 'osCsid=....' as part of the query string? What about when you click on 'Add to cart'? Is it same?

I tested it on IE7 seems tobe working. Did you try

http://www.zaramir.com/osc

 

 

I've tested the url you've provided with IE8 i can add to cart fine also tested http://www.zaramir.com/osc/mobile and it's work fine i can add to cart With IE8 and mobile as well.

 

 

What mobile do you use?

Could you try this link and post me a result:

http://www.zaramir.com/br.php

 

 

I've tested the url you've provided with IE8 i can add to cart fine, also tested http://www.zaramir.com/osc/mobile and it's work fine i can add to cart With IE8 and mobile as well.

 

 

I've try the above address it gives: [MAUI_WAP_Browser

 

Thanks very much for your time and your help.

Share this post


Link to post
Share on other sites
I've tested the url you've provided with IE8 i can add to cart fine, also tested http://www.zaramir.com/osc/mobile and it's work fine i can add to cart With IE8 and mobile as well.

I've try the above address it gives: [MAUI_WAP_Browser

Go to mobile/includes/classes/mobile_redirect.php and add this code at line 21

		if(tep_browser_detect('MAUI_WAP_Browser'))
		return 'GenericWAP';

 

What about osCsid?

Do you have osCsid in your product URL?

Does it look like this?

product_info.php?products_id=21&osCsid=11111111

Share this post


Link to post
Share on other sites
Right now iOSC is working with standard OSC v2.2 contributions (CC, cash on delivery) . I will add Paypal and Google , just give me some time

 

Ah ok sweet thanks, and yeah the cash worked fine.

As far as I could remember I beleive they were just the standard ones, you just drop em in the modules payment, unistall and install sort of thing...

Thanks again

Share this post


Link to post
Share on other sites
Go to mobile/includes/classes/mobile_redirect.php and add this code at line 21

		if(tep_browser_detect('MAUI_WAP_Browser'))
		return 'GenericWAP';

 

What about osCsid?

Do you have osCsid in your product URL?

Does it look like this?

product_info.php?products_id=21&osCsid=11111111

 

 

 

Hello,

 

Thanks very much now it's redirect perfectly, so thanks a lot.

 

For the osCsid yes, i have it in my browser IE8 & FF and yes it look like this:

product_info.php?products_id=21&osCsid=11111111

Share this post


Link to post
Share on other sites

Ok I use tmobile wing which uses IEMobile web browser, might not be totally correct but it finally works for me to redirect me to the mobile site when I go to my site now, it didn't before with IEMobile.

 

What I did:

in mobile/includes/classes/mobile_redirect.php

 

find:

if(tep_browser_detect('Blackberry'))

return 'Blackberry';

 

add below:

 

if(tep_browser_detect('IEMobile'))
           return 'iPhone';

 

Should work if you use IEmobile

let me know if it works for anyone else, btw I'm not really versed in PHP so I got lucky.

Thanks

Share this post


Link to post
Share on other sites

Hi,

Just tried to setup this module but having some problems.

uploaded all the files with directory mobiles to the root folder, so that the website add would be www.xyz.com/mobile

 

after uploading files and correcting the configure.php file when loading up the mobile site i am getting this error

Warning: include(includes/functions/security.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 79

Warning: include(includes/functions/security.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 79

Warning: include() [function.include]: Failed opening 'includes/functions/security.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/application_top.php on line 79

Warning: include(includes/classes/cache.class.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 319

Warning: include(includes/classes/cache.class.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 319

Warning: include() [function.include]: Failed opening 'includes/classes/cache.class.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/application_top.php on line 319

Fatal error: Class 'cache' not found in /var/www/html/includes/application_top.php on line 320

 

Can you please help solve this. Why is this error coming up

 

regards,

Kunal

Share this post


Link to post
Share on other sites
Hi,

Just tried to setup this module but having some problems.

uploaded all the files with directory mobiles to the root folder, so that the website add would be www.xyz.com/mobile

 

after uploading files and correcting the configure.php file when loading up the mobile site i am getting this error

Warning: include(includes/functions/security.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 79

Warning: include(includes/functions/security.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 79

Warning: include() [function.include]: Failed opening 'includes/functions/security.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/application_top.php on line 79

Warning: include(includes/classes/cache.class.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 319

Warning: include(includes/classes/cache.class.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/includes/application_top.php on line 319

Warning: include() [function.include]: Failed opening 'includes/classes/cache.class.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /var/www/html/includes/application_top.php on line 319

Fatal error: Class 'cache' not found in /var/www/html/includes/application_top.php on line 320

 

Can you please help solve this. Why is this error coming up

 

regards,

Kunal

 

Hi.

could you please decribe in more details

There is your main catalog located?

Is it /var/www/html/

Where did you create mobile directory?

What change did you do in configure.php?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×