Jump to content
Latest News: (loading..)
bumbarash

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

Recommended Posts

@Jack_mcs and @Matjaz,

 
This is what Goolgel states on the referenced page:

 

 

Annotation in the HTML
On the desktop page (http://www.example.com/page-1), add:
<link rel="alternate" media="only screen and (max-width: 640px)"
href="http://m.example.com/page-1">

and on the mobile page (http://m.example.com/page-1), the required annotation should be:
<link rel="canonical" href="http://www.example.com/page-1">

This rel=”canonical” tag on the mobile URL pointing to the desktop page is required.

 

The actual code in header tags does this:

if (defined mobile) {
 <link rel="canonical" href="classic-url" >
} else {
<link rel="alternate" media="only screen and (max-width: 640px)" href="mobile_url" >
}

another possibility following other users opinion could be:

if (defined mobile) {
 <link rel="canonical" href="classic-url" >
} else {
 <link rel="canonical" href="classic-url" >
 <link rel="alternate" media="only screen and (max-width: 640px)" href="mobile_url" >
}

But on the mobile side, a category page uses category_mb.php while it is index.php on the desktop side and I don't know of a way to detect what the other page should be. Rainer, is there a way to know which page to link to? If there is a generic way to do that so it catches all of the pages, then I think the above would switch correctly.

 

Since the classic auto redirect feature was introduced, the easiest way to retrieve the correspondent links is to use "$classic_url" and "$mobile_url" which are defined in mobile/includes/classes/classic_redirect.php and mobile_redirect.php.

 

They show the correct URLs even with SEO URLs installed. You only would need to strip "MredirectCancelled=true" and "redirectCancelled=true" to get all clean.

 

regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

@@raiwa

 

Just out of curiousity, for the "viewport" setting in /mobile/includes/header.php

<meta name="viewport" content="width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

Is there a reason why width is forced to 320 rather than width=device-width  ?

 

Thanks!

Share this post


Link to post
Share on other sites

@@raiwa

 

2nd question :)

 

In regards to google analytics, I saw this error:

 

--------------

The Ad Destination URL http://www.mysite.com/ from the AdWords account xyz@gmail.com (xxx-xxx-xxxx):xxxxxxxxx has accrued a significant number of clicks but a lower-than-expected number of sessions from mobile clients because the page is dropping or altering the gclid parameter inserted by Google. Check the web server's redirect logic or its use of a URL rewrite engine to ensure the gclid parameter is preserved.

 

For example, the Destination URL with autotagging is: www.example.com/redirecting-page?gclid=TeSter-123, when the redirect occurs it should forward the user to www.example.com/new-url?gclid=TeSter-123 (note here that the gclid parameter remains the same, although the page URL changes).

------------

 

I imagine this is happening because of the redirect to "www.mysite.com/mobile/"   when that happens, the gclid is lost.

 

Any ideas on how to preserve that?

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

For viewport:

Yes, you are right. It is a "relict" from the first iosc versions. Nowadays it should be "width=device-width".

 

For Google Analytics:

The Google Analytics script needs to be added to mobile.

If your store is 2.3.3.4 or 2.3.4, the Google Analytics code can be included to mobile via the ht_google_analytics Header Tag module.

If your store version is older or the script is added by hand, it needs to be added by hand to the mobile header or footer.

 

regards

Rainer

Share this post


Link to post
Share on other sites

@@raiwa,

 

Hi after Mobile IOSC installation we receive the error below when running a .php script to feed products to another website. The URL for the feed is http://www.hdcabling.co.za/bidorbuy.php?debug=0&zip=0&add_vat=1. The company providing the feed does not know either why the error below occurs and I told them no SQL security changes were done and not sure why this would occur after mobile upgrade. If you have any ideas please let me know since it seems like an authentication issue but from tests below it is not SQL database related. Nowhere in the .php file is user 'hdcablin' specified only in the configure.php

 

"Warning: mysql_query(): Access denied for user 'hdcablin'@'localhost' (using password: NO) in /home/hdcablin/public_html/bidorbuy.php on line 292

Warning: mysql_query(): A link to the server could not be established in /public_html/bidorbuy.php on line 292
Access denied for user 'hdcablin'@'localhost' (using password: NO)"

 

On the specific bidorbuy.php file line 292 code below

 

$results = mysql_query($products_query) or die(mysql_error());

 

When I create a subdomain with old FTP backup before iOSC Mobile website Installation and using the same database as after mobile upgrade the code works fine as at http://test.hdcabling.co.za/bidorbuy.php?debug=0&zip=0&add_vat=1.

 

I really need someone's help on this since I am clueless on where the error could be and skills on .php very poor since it works on the same database from pre-mobile iOSC install.

Share this post


Link to post
Share on other sites

@@alladin76ro,

 

did you add the SEO URLs support for mobile included in the contribution support package:
http://addons.oscommerce.com/info/8629

 

you should also switch error reporting on to see the eventual error message or check in your servers error log.

Share this post


Link to post
Share on other sites

Sorry, but I couldn't find SEO URLs support package.

 

Here's the error log:

 

[26-May-2015 17:34:39 Europe/Bucharest] PHP Warning: include(/includes/configure.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/magazinp/public_html/includes/application_top.php on line 28
[26-May-2015 17:34:39 Europe/Bucharest] PHP Warning: include() [<a href='function.include'>function.include</a>]: Failed opening '/includes/configure.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/magazinp/public_html/includes/application_top.php on line 28
[26-May-2015 17:34:39 Europe/Bucharest] PHP Warning: require(DIR_WS_FUNCTIONScompatibility.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/magazinp/public_html/includes/application_top.php on line 40
[26-May-2015 17:34:39 Europe/Bucharest] PHP Warning: require(DIR_WS_FUNCTIONScompatibility.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in /home/magazinp/public_html/includes/application_top.php on line 40
[26-May-2015 17:34:39 Europe/Bucharest] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required 'DIR_WS_FUNCTIONScompatibility.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/magazinp/public_html/includes/application_top.php on line 40

Thank you for your answer.

Share this post


Link to post
Share on other sites

Helo Dorian @@alladin76ro,

 

The first error points to the first modification to apply in catalog/includes/application_top.php, point 1a in the install_osc_2_3.doc.

The following errors are consequences of the first error and will disappear if the first one is fixed.

 

I posted the SEO URLs support download URLin the first message.

Also see: Add-On Support.doc point 1a.

 

regards

Rainer

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

For viewport:

Yes, you are right. It is a "relict" from the first iosc versions. Nowadays it should be "width=device-width".

 

For Google Analytics:

The Google Analytics script needs to be added to mobile.

If your store is 2.3.3.4 or 2.3.4, the Google Analytics code can be included to mobile via the ht_google_analytics Header Tag module.

If your store version is older or the script is added by hand, it needs to be added by hand to the mobile header or footer.

 

regards

Rainer

 

Hi Rainer @@raiwa

 

Let me clarify a little more.  The problem is not with adding analytics to the mobile site.

 

The problem is more with "adwords".   For example, when you do a google search, and one of my paid ads appears, if you click on that paid ad it will direct you to www.mysite.com/gclid?=abc123

 

Which is fine if you are using a desktop/laptop PC.  If you are using a mobile device, that link above should be redirected to:  www.mysite.com/mobile/gclid?=abc123

 

What is happening instead is that you are simply redirected to www.mysite.com/mobile/     and you are losing the "Gclid?=abc123" part.

 

Is there a way to retain that information in the URL on redirect to the mobile site?

 

Thanks!

Bill

Share this post


Link to post
Share on other sites

Hello again Rainer @Mention,

 

I kind of solved first problem, now i have errors inside the mobile version, products not loading. I disabled for now SEO URLs, mobile products still not loading. I downloaded the zip file, search inside but didn't find SEO URLs support. Can you be more specific?

 

Thank you.

Share this post


Link to post
Share on other sites

Dear Dorian @@alladin76ro,

 

I had a look on your store, there are more errors/missing installation steps.

 

Please check all of this in this order (all in the main catalog files, not mobile files):

 

- 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

- check the modifications in includes/filenames.php

- check the modifications in includes/application_top.php

 

You NEED to add the SEO URL support to get the category and product pages to work correct. It is not the same to switch it off in Admin.

 

You read my installation instructions, you didn't?? :-

 

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.

 

Install_osc_2_3.doc point 4:

4) catalog/includes/functions/html_output.php

NOTE: If you use SEO URLs this code is not present here.

For ULTIMATE Seo Urls 5 ( r205 ) - by FWR Media and SEO URLs 2.2. by chemo:
No need to modify anything here, leave the code like it was modified by the original SEO URL installation. But you need to do the other additional modifications explained in the support package.

So don’t try to run the mobile pages until you finished the additional installation.

 

 

 Mobile SEO URL support is included in the iosc Mobile Contribution support package:

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

You will find 2 SEO URL support folders in the package:

1. SEO URLs USU5_vers3.3

2. SEO URLs_2.2._by_chemo_vers3.4

 

There is no mobile support for other SEO URL add-ons/versions available.

 

If you still have trouble, please read again ALL documentation and check careful ALL installation instructions.

 

If you still have trouble, post again.

 

kind regards

Rainer

 

PS: Please, understand that I spent a lot of time writing the installation docs and I already answered these basic installation things many, many times. o:)

Edited by raiwa

Share this post


Link to post
Share on other sites

@@raiwa

 

Thank you for your help.

 

I checked twice the documentation and I'm still missing something. On my mobile homepage, when I click on recent added products or specials, an animated gif representing a circle appears, and no redirection to the product description. Except the design, I solved all the problems (I guess :) ). Again, I'm very grateful for your patience and understanding.

 

Best regards,

Dorian

Share this post


Link to post
Share on other sites

Hello Dorian @@alladin76ro,

 

I'm glad that you could fix it.

For the products please try this:

In: mobile/includes/modules/products.php

FIND line 80:

    $path = '<a href="' . tep_mobile_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">';

and CHANGE to:

    $path = '<a data-ajax="false" href="' . tep_mobile_link(FILENAME_PRODUCT_INFO, 'products_id=' . $listing['products_id']) . '">';

This disables ajax page load and should make it more stable.

 

See also: Add-On Support.doc point 11

 

regards

Rainer

Share this post


Link to post
Share on other sites

@@raiwa I hope all is well Rainer.

 

As you know I've used this wonderful addon for a couple of years now - and wanted to thank you very kindly for your fantastic support!

 

However, times are changing and I look forward to launching my bootstrap store in the coming weeks (I'm finished development.... just de-bugging and testing).

 

Do you have an suggestions on how to direct my indexed mobile links back to their regular link? Using a wild card 301 redirect for the directory /mobile/ is easy enough... However, I'm stuck with the -mp- bits back to -p-.

 

I'm thinking it really may require some version of the classic_redirct class that also throws out a 301 installed in the new BS store and call it in application top?

 

Am I over thinking this?

 

Scott

If it makes any difference I'm using FWR urls.

Share this post


Link to post
Share on other sites

@@raiwa and all other users -

 

Has anyone implemented a shipping estimator on the mobile platform?  (To check freight costs prior to creating an account?)

 

Thanks!

Share this post


Link to post
Share on other sites

Hello @@greasemonkey,

 

Thank you, I'm fine and hope you too.

 

Oh yes, I'm also on the point with my new bootstrap store and will need the same.

 

I think it might be easier to use rewrite rules in .htaccess

 

For the normal pages this should do it:

  RewriteRule ^(.*?)mobile/catalog_mb.php$ index.php [R=301,NC,L]
  RewriteRule ^(.*?)mobile/about.php$ index.php [R=301,NC,L]
  RewriteRule ^(.*?)mobile/search.php.php$ index.php [R=301,NC,L]
  RewriteRule ^(.*?)mobile/([a-z0-9/-]+).php$ index.php [R=301,NC,L]

For the categories and products I'll need some time, I'm not too versed in rewrite rules.

Please, give me 2 days to try or, you can give it a try meanwhile.

 

regards

Rainer

Share this post


Link to post
Share on other sites

@@greasemonkey,

 

ok,

 

found it for products and categories:

  RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mc-([0-9_]+).html$ index.php?cPath=$3 [NC,QSA]
  RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mm-([0-9_]+).html$ index.php?manufacturers_id=$3 [NC,QSA]
  RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mp-([0-9]+).html$ product_info.php?products_id=$3 [NC,QSA]
  RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mpr-([0-9]+).html$ product_reviews.php?products_id=$3 [NC,QSA]
  RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mpri-([0-9]+).html$ product_reviews_info.php?products_id=$3 [NC,QSA]

Should be placed BEFORE the standard SEO URL rewrites.

 

What I'm still struggling is to find a generic rewrite rule for all other store pages:

  RewriteRule ^(.*?)mobile/([a-z0-9/-]+).php$ $2 [R=301,NC,L]

This redirects all other pages to "index.php" instead of to "conditions.php" for example.

Edited by raiwa

Share this post


Link to post
Share on other sites

@phil148 there is... Look in the support addon for ship in cart.

 

Cool, anybody also implemented that alongside Multi Vendor Shipping (MVS) ?

Share this post


Link to post
Share on other sites

@@raiwa testing this now...

 

found it for products and categories:

RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mc-([0-9_]+).html$ index.php?cPath=$3 [NC,QSA]
RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mm-([0-9_]+).html$ index.php?manufacturers_id=$3 [NC,QSA]
RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mp-([0-9]+).html$ product_info.php?products_id=$3 [NC,QSA]
RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mpr-([0-9]+).html$ product_reviews.php?products_id=$3 [NC,QSA]
RewriteRule ^(.*?)mobile/([a-z0-9/-]+)-mpri-([0-9]+).html$ product_reviews_info.php?products_id=$3 [NC,QSA]

Should be placed BEFORE the standard SEO URL rewrites.

 

What I'm still struggling is to find a generic rewrite rule for all other store pages:

RewriteRule ^(.*?)mobile/([a-z0-9/-]+).php$ $2 [R=301,NC,L]

This redirects all other pages to "index.php" instead of to "conditions.php" for example.

Share this post


Link to post
Share on other sites

@@raiwa these rewrite rules are working to a certain degree....

 

I didn't use the generic rule

 RewriteRule ^(.*?)mobile/([a-z0-9/-]+).php$ $2 [R=301,NC,L]

I did manual rewrites for each of the main pages....

 

I see a couple issue in my error log that maybe you can help me with;

 

1) I see many errors for;

[Sat Jun 13 09:06:30 2015] [error] [client ***.**.**.**] File does not exist: /home/******/public_html/mobile

Note... no trailing slash... can't find a rule to add the trailing slash only to mobile/

 

The strange thing is.... www.mysite.com/mobile and www.mysite.com/mobile/ seem to forward just fine....

 

2)also seeing a bunch of;

[Sat Jun 13 09:01:51 2015] [error] [client **.**.***.**] File does not exist: /home/********/public_html/my-product-p-4066.html&redirectCancelled=true

I can't seem to find a rule to remove &redirectCancelled=true

 

That doesn't add a trailing slash... I end up with my-product-p-4066.html/ which is 404 because of the /

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

×