Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


bumbarash

Recommended Posts

@@raiwa

 

I've been trying to get OPI to work on the mobile version front end for days now. It seems you may have uploaded the wrong product_info.php for the mobile directory. It still references template_top, template_bottom rather than header and footer and as @quinzou mentioned, the products_images table is not needed for the opi mobile version. Contrary to your statement and included instructions, there are currently many edits to be made in products_info.php not mentioned in the docs.

 

My intentions where to make these edits and repackage all the necessary front end changes as a new update but I got to situate this image display issue first.

 

I cant seem to get any of the images on the mobile front end to show up for the life of me on my 2.3.3.3 store. Had a feeling changing my images handler would be much more pain than it was worth. 

Dear Eric @@breakbred101,

 

I think there may be some confusion. All mentioned to @quinzou is not related to mobile, only to classic store.

The OPI package:

OPI 2.1:

http://addons.oscommerce.com/info/8139

and the included product_info.php files are for classic (standard) store frontend only.

 

Instructions for mobile support are included in the contripution mobile support package:

http://addons.oscommerce.com/info/8578

There is no modified product_info.php included in that package.

The instructions there for the mobile product_info.php are valid for OsC until 2.3.3.4.

However as mentioned: the only necessary changes are to add: . 'thumbs/def/display/' .  to the image paths.

  $pi_query = tep_db_query("select image, htmlcontent from " . TABLE_PRODUCTS_IMAGES . " where products_id = '" . (int)$product_info['products_id'] . "' order by sort_order");

Is also needed in mobile product_info.php for the additional (big) images.

 

I copy this post to the iosc mobile thread where is it's place.

 

hope this helps and kindest regards

Rainer

Link to comment
Share on other sites

@@raiwa I'm having a minor issue with my canonical tags and the following lines you are changing is classic_redirect from 7.5.6 to 7.5.7

 

 

  if(!isset($_GET['redirectCancelled']) && $_GET['redirectCancelled'] != 'true') {

    $classic_url .= ((stripos($classic_url,'?') > 0) ? '&' : '?') . "redirectCancelled=true";

Replace with:

  if(!isset($_GET['MredirectCancelled']) && $_GET['MredirectCancelled'] != 'true' && stripos($classic_url,'MredirectCancelled=true') == 0) {

    $classic_url .= ((stripos($classic_url,'?') > 0) ? '&' : '?') . "MredirectCancelled=true";

 

 

When redirecting from mobile to classic this leaves me with a URL like;

 

 

www mysite com/?redirectCancelled=true&MredirectCancelled=true

 

Which I cannot seem make canonical (with a modified header tags SEO) with a line like;

$str_replace_from = array('-mc-', '-mi-', '-mby-', '-mpr-', '-mpri-', '-mp-', '-mm-', 'catalog_mb.php', 'about.php',  'search.php', 'currencies.php', 'languages.php', 'mobile/', '?redirectCancelled=true', '?MredirectCancelled=true', '?redirectCancelled=true&MredirectCancelled=true');
$str_replace_to = array('-c-', '-i-', '-by-', '-pr-', '-pri-', '-p-', '-m-', 'index.php', 'index.php', 'index.php', 'index.php', 'index.php', 'index.php');

I presume its the extra "&" in the url - its showing as & in the source.

 

Any ideas?

Edited by greasemonkey
Link to comment
Share on other sites

Hello Scott @@greasemonkey,

 

Please try that in mobile/includes/classes/classic_redirect.php line 2-10:

//BEGIN: CLASSIC REDIRECT_SCRIPT
  $url_replace_from = array('%redirectCancelled=true%', '%' . DIR_WS_HTTP_MOBILE .'%', '%' . FILENAME_CATALOG_MB .'%', '%^' . FILENAME_SEARCH .'%', '%' . FILENAME_ABOUT .'%', '%credits.php%', '/-mp-/', '/-mc-/', '/-mm-/', '/-mpr-/', '/-mpri-/', '/-mpi-/', '/-ma-/', '/-mau-/', '/-mby-/', '/-mf-/', '/-mfc-/', '/-mfri-/', '/-mfra-/', '/-mi-/', '/-mlinks-/', '/-mn-/', '/-mnc-/', '/-mnri-/', '/-mnra-/', '/-mpm-/', '/-mpo-/', '/-mt-/');
  $url_replace_to = array('MredirectCancelled=true', DIR_WS_HTTP_CATALOG, FILENAME_DEFAULT, FILENAME_DEFAULT, FILENAME_DEFAULT, FILENAME_DEFAULT, '-p-', '-c-', '-m-', '-pr-', '-pri-', '-pi-', '-a-', '-au-', '-by-', '-f-', '-fc-', '-fri-', '-fra-', '-i-', '-links-', '-n-', '-nc-', '-nri-', '-nra-', '-pm-', '-po-', '-t-');
  $classic_url = (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . preg_replace($url_replace_from, $url_replace_to, htmlspecialchars($_SERVER['REQUEST_URI']));
  
  if(!isset($_GET['MredirectCancelled']) && $_GET['MredirectCancelled'] != 'true' && stripos($classic_url,'MredirectCancelled=true') == 0) {
    $classic_url .= ((stripos($classic_url,'?') > 0) ? '&' : '?') . "MredirectCancelled=true";
  }	
//END: CLASSIC REDIRECT_SCRIPT

And that in mobile/includes/classes/mobile_redirect.php line 32-39:

  if(!isset($_GET['redirectCancelled']) && $_GET['redirectCancelled'] != 'true') {
    if(stripos($mobile_url,'MredirectCancelled=true') == 0) {
    $mobile_url .= ((stripos($mobile_url,'?') > 0) ? '&' : '?') . "redirectCancelled=true";
    } else {
    $mobile_url = str_replace('MredirectCancelled=true', 'redirectCancelled=true', $mobile_url);
    }
  }
//END: MOBILE REDIRECT_SCRIPT    

Please confirm and I'll upload the fix.

 

Thank you

Rainer

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

i'll try to install mobile version in mi modified oscommerce 2.3.4 (php 5.5)

the problem is that i can't show images (THIS IMAGE FAILED TO LOAD)

I don't have addons about images installed, colud you help me, where i need to check to understand the problem

 product_info.php si modificated with Multi Vendor System and Product Specification, but I don't think they create problems,

Any helo is appreciate

 

Marco

Link to comment
Share on other sites

Hello,

i'll try to install mobile version in mi modified oscommerce 2.3.4 (php 5.5)

the problem is that i can't show images (THIS IMAGE FAILED TO LOAD)

I don't have addons about images installed, colud you help me, where i need to check to understand the problem

 product_info.php si modificated with Multi Vendor System and Product Specification, but I don't think they create problems,

Any helo is appreciate

 

Marco

Hello Marco,

 

Can you please give some more information:

- the DIR_WS_IMAGES definition in your configure.php

- your mobile installation is subdomain or subdirectory

- it would be good you could post your store URL, if you wish in a private message

 

regards

Rainer

Link to comment
Share on other sites

hi,

 

my DIR_WS_IMAGES

before

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

and after installed mobile

  (defined('MOBILE_SESSION') ? define('DIR_WS_IMAGES', ((getenv('HTTPS') == 'on')? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_HTTP_CATALOG) . 'images/') : define('DIR_WS_IMAGES', 'images/'));

I installed CATALOG/MOBILE/

 

at the moment is in local under xampp

 

thanks

Marco

Link to comment
Share on other sites

hi,

 

my DIR_WS_IMAGES

before

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

and after installed mobile

  (defined('MOBILE_SESSION') ? define('DIR_WS_IMAGES', ((getenv('HTTPS') == 'on')? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_HTTP_CATALOG) . 'images/') : define('DIR_WS_IMAGES', 'images/'));

 

I installed CATALOG/MOBILE/

 

at the moment is in local under xampp

 

thanks

Marco

@@marcochiana,

 

I never got this message "THIS IMAGE FAILED TO LOAD". Can you post the information which is shown on right click on the image "show image information".

What happens if you right click "show image"??

 

1. You can try to change the image directory to:

  (defined('MOBILE_SESSION') ? define('DIR_WS_IMAGES', '../images/') : define('DIR_WS_IMAGES', 'images/'));

2. Check how your store is set up in configure.php, it should be:

  define('HTTP_SERVER', 'http://localhost');
  define('HTTPS_SERVER', 'http://localhost');
 .................
  define('DIR_WS_HTTP_CATALOG', '/myxamppstoredirectory/');
  define('DIR_WS_HTTPS_CATALOG', '/myxamppstoredirectory/');

3. If you have .htacces protection in your image directory, try to remove it.

 

regards

Rainer

Link to comment
Share on other sites

Hello all,

 

I am very frustrated with iOSC right now.  Here is the short story:

 

1) First, I set up OSC 2.3.4 and got everything working OK.  I know my platform is stable, and I am learning my way around OSC.

 

2) I found iOSC, then tried to install it into a copy of my site, got a major mess (mostly my fault;  I had made some customizations to my site.)

 

3) I created a plain-vanilla installation of OSC 2.3.4 (no modifications except what was necessary to install) and tried to install iOSC.  I did this three different times, because the documentation was confusing to me.

Using this "out of the box" OSC 2.3.4 + iOSC 7.5.7r2 (installed as per Install_osc_2_3.docx), I have managed to get the Admin screens to work, and the mobile site seems to work.  However, the desktop site is broken.

 

When I attempt to load the desktop site, I get:

Fatal error: Cannot redeclare stripsessionidcan() (previously declared in /mypath/catalog/includes/modules/header_tags/ht_canonical.php:36) in /mypath/catalog/includes/modules/header_tags/ht_canonical.php on line 36

 

Google didn't find that error referenced anywhere.

 

I thought maybe there was an "include" or "require" somewhere that should have been "include_once" or "require_once", but I couldn't find it, so I added the following to ht_canonical.php:

           if (!function_exists('StripSessionIDcan')) {
               {{existing StripSessionIDcan declaration}}
           }

That got me past the redeclaration error, but now I get:

 

Fatal error: Call to undefined function tep_mobile_link() in /mypath/catalog/includes/header.php on line 114

 

 

Instead of chasing this down a rabbit hole, I thought I'd ask for help.  I assume I either have a configuration problem or I messed up the iOSC install again.  Anyone have any thoughts?  Thanks in advance.

 

Environment details:

Server OS: Linux 2.6.18-400.1.1.el5PAE      Database: MySQL 5.5.40-36.1-log HTTP Server: Apache PHP Version: 5.2.17 (Zend: 2.2.0)
Link to comment
Share on other sites

Fatal error: Call to undefined function tep_mobile_link() in /mypath/catalog/includes/header.php on line 114

 

Hello Jonathan @@Piquanti,

 

It seems there is something wrong, tep_mobile_link is called in the mobile header, but the header in your error message is in the store root:

/catalog/includes/header.php

 

it should be:

/catalog/mobile/includes/header.php

 

Maybe you replaced the standard header with the mobile header.

 

Also: Did you place the mobile files in the subdirectory "mobile/"

 

Could you please post your includes/configure.php without the database details at the bottom, to have a look.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

@@raiwa - Thank you.  I feel like an idiot - I somehow overwrote catalog/includes/header.php with catalog/mobile/includes/header.php.  Replacing the stock version of catalog/includes/header.php did the trick.  I am now reviewing every file to make sure I don't have any other accidental overwrites hiding in the tree.

 

Thanks again.  Hopefully, any future questions I might have will not revolve entirely around my own stupidity.

Link to comment
Share on other sites

Hello,

just completed the install of Mobile OSC 7.5.7r2 on a 2.2 rc2a shop on an offline webserver.

One question though: Whereas from the iphone box switch I get to the mobile version, on the mobile version some links dont work right except credits.php:

Ctrl+U in the browser shows ALL urls miss the mobile directory path ex:

 http://www.example.com/about.php?language=de", href="http://www.example.com/catalog_mb.php?redirectCancelled=true"

Those of course dont work, others shown in the horizontal menu which also exist in the root of the shop (index,login/account) work

but redirect to the classic shop.

Those for example underneath the horizontal menu on "http://www.example.com/mobile/about.php" which exist in the root of the shop (privacy, shipping.php, contact_us.php, conditions.php) do not work at all,

do not redirect either to the mobile versions or as above to the classic shop pages. The pages just freeze without any error message.

Would you have maybe an easy hint to get it running ?? Would be very grateful!

Many thanks + Kind regards

 

N.B Also, entering the links by hand in the navigation bar by hand, works fine though. with the /mobile/ in btween ;-)

Ouups just turned off "ajax page load' in  mobile settings and pages that exist load now right but are the classic versions,

not yet the mobile ones ....

Edited by Eim2

david

Link to comment
Share on other sites

N.B Sorry, By turning off "ajax page load' in  mobile settings  pages that exist in the shop and which e.g. on http://www.example.com/mobile/about.php"

should link below the horizontal menu to the corresponding pages in mobile version load but are then still classic versions, not yet the mobile ones ....

Edited by Eim2

david

Link to comment
Share on other sites

Hello David @@Eim2,

 

Please check the following in that order:

- if you are using SEO URLs, check if you added the appropiate SEU URL support and check all modifications.

- check the modifications in tep_href_link function in includes/funktions/html_output.php

- check the modifications in tep_redirect function in includes/functions/general.php

- check the modifications in includes/configure.php

 

If you can't find the error, please send me your store URL in a private message and I'll have a look.

 

Kind regards

Rainer

Link to comment
Share on other sites

Hi again, as u can guess I m really not a PHP programmer nor a programmer of any kind at all,

so my question, maybe stupid now but I ve little time searching, is why isn't there any configure.php

file  in the mobile/includes directory anymore?

 

Kind regards

david

Link to comment
Share on other sites

Hi

thanks a lot I ll have a look and will put the contrib online asap

Acutally I have an old Chemo seo url but not loaded locally

+ define ('SEO_ENABLED', 'false'); in configure.php
 

 

Kind regards

Edited by Eim2

david

Link to comment
Share on other sites

Good morning Chris @@chrism78,

 

Here the fix:

 

in: includes/application_top.php

find line 320 within the shopping cart actions:

      $goto = $PHP_SELF;

change it to:

      $goto = defined('MOBILE_SESSION')? basename($PHP_SELF): $PHP_SELF;

I'll upload this fix to the add-on package.

 

Thank you for the report

Rainer

 

Hi Rainer,

this fix didn't work for me (i was already use basename on $PHP_SELF).

I'm installing mobile version on a subfolder.

Actually pages which already exists in main catalog folder are correctly redirected to mobile version while pages which doesn't exist in main catalog folder, as for example catalog_mb.php, retunrs error loading page.

I've installed the latest version from 2nd march.

Do you have any idea where i should to find a solution?

I'm also testing from desktop computer and if i start a mobile session, wherever i click (on working links) i get redirect to classic site, is this a normal behaviour?

Thanks in advance.

Edited by fozzo
Link to comment
Share on other sites

Hello @@raiwa

 

For clarifications:

 

Hello raiwa :)  worked

 

Solved so far. Will sleep better !!! Thanks so much

 

Kind regards

 

PS. Installing SEO Support (5 min.) as per instructions did it, and could also turn on "ajax page load' in the mobile config ... Now lets look at SPPC ;-)

david

Link to comment
Share on other sites

I made the mobile changes from the post

***open the file 'detectmobilebrowser.php.txt' you downloaded and copy only the 3rd line which begins with:

if(preg_match('/android.+mobile|avantgo|bada\/|blackbe.........................bstr($useragent,0,4)))

The result is that the mobile view does not work anymore. It is just loading when I click the link to mobile page.

But the expected result should be to automatically recognise whether it's either a mobile device or not and redirect .

Link to comment
Share on other sites

Hi Rainer,

this fix didn't work for me (i was already use basename on $PHP_SELF).

I'm installing mobile version on a subfolder.

Actually pages which already exists in main catalog folder are correctly redirected to mobile version while pages which doesn't exist in main catalog folder, as for example catalog_mb.php, retunrs error loading page.

I've installed the latest version from 2nd march.

Do you have any idea where i should to find a solution?

I'm also testing from desktop computer and if i start a mobile session, wherever i click (on working links) i get redirect to classic site, is this a normal behaviour?

Thanks in advance.

 

Ok i got it, it was because of the seo url.

Thanks anyway :)

Link to comment
Share on other sites

I made the mobile changes from the post

***open the file 'detectmobilebrowser.php.txt' you downloaded and copy only the 3rd line which begins with:

if(preg_match('/android.+mobile|avantgo|bada\/|blackbe.........................bstr($useragent,0,4)))

The result is that the mobile view does not work anymore. It is just loading when I click the link to mobile page.

But the expected result should be to automatically recognise whether it's either a mobile device or not and redirect .

Hello Kira @@Andromeda100,

 

Could you please post your modified file.

Link to comment
Share on other sites

@@raiwa

Hi raiwa,

i'm testing the mobile site on some devices. Actually iPhone 6 have a little problem, the products page make the vertical view with three columns but all the cell are really screwed because they would need more space. How can i handle it to make it view only 1 column instead of 3?

Link to comment
Share on other sites

 

Hello Fabio @@fozzo,

 

Ok i got it, it was because of the seo url.

 

You didn't read my Start Here doc??

 

IMPORTANT NOTE:

For installation in subdirectory “mobile/”, finish “Install_osc_2_2.doc” or Install_osc_2_3.doc” before testing the mobile files.

For installation under subdomain finish also “Configure_ subdomain.doc” before testing the mobile files.

If you are using SEO URL, finish also “SEO URL” support installation included in the Add-On support package before testing the mobile redirects.

If you are using an image thumbnail add-on, finish also “image thumbnail” add-on support installation included in the Add-On support package before testing the mobile images.

 

 

@@raiwa

Hi raiwa,

i'm testing the mobile site on some devices. Actually iPhone 6 have a little problem, the products page make the vertical view with three columns but all the cell are really screwed because they would need more space. How can i handle it to make it view only 1 column instead of 3?

 

Please see Install doc at the end:

Point 2. in: Admin/Configuration/Mobile Site

 

Columns in product listing

and

Responsive Breakpoint for product listing

 

However the product listing should be responsive and show always one column if the screen width is below the defined breakpoint width.

 

Kind regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...