Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


bumbarash

Recommended Posts

thanks @@raiwa tried || substr(basename($PHP_SELF), 0, 6) == 'search' but seems to ignore it ?

but if i disable ajax (for all mobile site) in the admin it then works?

 

is the line above correct.

 

Hello @@ShaGGy,

 

the code looks good. Sure you mean search.php not advanced_search.php?

Then you could try to add data-ajax="false" to the search page link in includes/header.php (point 11A in add-on support.doc):

<li>'.tep_button_jquery( IMAGE_BUTTON_SEARCH, tep_mobile_link(FILENAME_SEARCH), 'a' , '' , 'id="search" data-icon="custom" data-ajax="false"' ).'</li>

 

regards

Rainer

Link to comment
Share on other sites

Hello,

 

I have a problem:

 

On the PC version, when i add a product to my cart, i don't show the shopping_cart.php -> display_cart is false to the configuration menu.

-> OK, no problem.

 

But, on the mobile verson, how to make when I add a product the page shopping_cart.php appears directly?

 

Thank you in advance.

Link to comment
Share on other sites

Hello,

 

I have a problem:

 

On the PC version, when i add a product to my cart, i don't show the shopping_cart.php -> display_cart is false to the configuration menu.

-> OK, no problem.

 

But, on the mobile verson, how to make when I add a product the page shopping_cart.php appears directly?

 

Thank you in advance.

 

Hello @@mickael34,

 

the mobile works the same like the classic version, once you added a product you 'll find the shopping cart link (icon) in the upper right part of the header.

 

regards

Rainer

Link to comment
Share on other sites

Ok but when i add a product to the mobile version, i want to be redirect to the page mobile_shopping_cart.php.

 

I have no redirection because in the configuration menu of my shop, "display cart when i add a product" is false.

 

 

The solution is maybe In application_top :

 

if (DISPLAY_CART == 'true') {
 $goto = FILENAME_SHOPPING_CART;
 $parameters = array('action', 'cPath', 'products_id', 'pid');
} else {
 $goto = basename($PHP_SELF);
 if ($HTTP_GET_VARS['action'] == 'buy_now') {
 $parameters = array('action', 'pid', 'products_id');
 } else {
 $parameters = array('action', 'pid');
 }
}

 

 

how to make the mobile version to be different ?

Edited by mickael34
Link to comment
Share on other sites

Ok but when i add a product to the mobile version, i want to be redirect to the page mobile_shopping_cart.php.

 

I have no redirection because in the configuration menu of my shop, "display cart when i add a product" is false.

 

 

The solution is maybe In application_top :

 

if (DISPLAY_CART == 'true') {
 $goto = FILENAME_SHOPPING_CART;
 $parameters = array('action', 'cPath', 'products_id', 'pid');
} else {
 $goto = basename($PHP_SELF);
 if ($HTTP_GET_VARS['action'] == 'buy_now') {
 $parameters = array('action', 'pid', 'products_id');
 } else {
 $parameters = array('action', 'pid');
 }
}

 

 

how to make the mobile version to be different ?

 

Hello @@mickael34,

 

you can use the mobile session constant to modify the code snippet:

if (DISPLAY_CART == 'true' || defined('MOBILE_SESSION') ) {
 $goto = FILENAME_SHOPPING_CART;
 $parameters = array('action', 'cPath', 'products_id', 'pid');
} else {
 $goto = basename($PHP_SELF);
 if ($HTTP_GET_VARS['action'] == 'buy_now') {
 $parameters = array('action', 'pid', 'products_id');
 } else {
 $parameters = array('action', 'pid');
 }
}

 

see also add-on support.doc point 10

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Ok thanks.

I have no the last version of iosc and i have no in my code the mobile_session constant.

I go to install the last vesrion if is the only solution.

 

Thanks.

 

Hello @@mickael34,

 

If you are using version 5 you can use any constant defined in mobile/includes/configure.php and not defined on the classic site like FILENAME_MOBILE_ACCOUNT or add this line to mobile/includes/configure.php or mobile/includes/application_top.php:

define ('MOBILE_SESSION', true);

 

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello @@mickael34,

 

If you are using version 5 you can use any constant defined in mobile/includes/configure.php and not defined on the classic site like FILENAME_MOBILE_ACCOUNT or add this line to mobile/includes/configure.php or mobile/includes/application_top.php:

define ('MOBILE_SESSION', true);

 

 

regards

Rainer

 

sorry the MOBILE_SESSION definition should be added at the very beginning to mobile/includes/application_top.php before calling the standard application_top.php

Link to comment
Share on other sites

@@raiwa I hope all is well. Just a couple questions/concerns...

 

1st, I frequently see redirect issues via who's online such as;

/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/mobile/my-product-lbs-mpi-3450.html

 

Most often (judging by the IP's) I believe it is google/etc bots. Also most often the links are 404 (the above example is not - as you can see its going to mpi - mobile, product image... I think?). However, when I browse directly to the above link it goes to my custom 404 page - http_error.php?error_id=404&FWR-URL=%.....

 

2nd, did you ever figure a fix for google analytics ecommerce tracking for 2.3.x.x? If I remember the code included with addon support here; http://addons.oscommerce.com/info/8578 was for the 2.2 addon here; http://addons.oscommerce.com/info/3756

 

 

Link to comment
Share on other sites

@@raiwa I hope all is well. Just a couple questions/concerns...

 

1st, I frequently see redirect issues via who's online such as;

 

 

Most often (judging by the IP's) I believe it is google/etc bots. Also most often the links are 404 (the above example is not - as you can see its going to mpi - mobile, product image... I think?). However, when I browse directly to the above link it goes to my custom 404 page - http_error.php?error_id=404&FWR-URL=%.....

 

2nd, did you ever figure a fix for google analytics ecommerce tracking for 2.3.x.x? If I remember the code included with addon support here; http://addons.oscommerce.com/info/8578 was for the 2.2 addon here; http://addons.oscommerce.com/info/3756

 

Hello Scott @@greasemonkey,

 

For the first:

I never observed this in my stores. Maybe you could check the installation (includes/configure.php, includes/functions/html_output.php, includes/functions/general.php, SEO URL modifications).

Otherwise you could try to add this to robots.txt:

Disallow: /mobile/mobile/

or exclude it in Google Webmaster Tools / Google Index / remove URLs

 

For the second I will have a look on it and do the update, thank you.

 

regards

Rainer

Link to comment
Share on other sites

Hello Scott @@greasemonkey,

 

For the first:

I never observed this in my stores. Maybe you could check the installation (includes/configure.php, includes/functions/html_output.php, includes/functions/general.php, SEO URL modifications).

Otherwise you could try to add this to robots.txt:

Disallow: /mobile/mobile/

or exclude it in Google Webmaster Tools / Google Index / remove URLs

 

For the second I will have a look on it and do the update, thank you.

 

regards

Rainer

 

Just thought the robots.txt is not a good aproach since the directory /mobile/mobile/ doesn't really exist.

Link to comment
Share on other sites

@@raiwa I hope all is well. Just a couple questions/concerns...

 

1st, I frequently see redirect issues via who's online such as;

 

 

Most often (judging by the IP's) I believe it is google/etc bots. Also most often the links are 404 (the above example is not - as you can see its going to mpi - mobile, product image... I think?). However, when I browse directly to the above link it goes to my custom 404 page - http_error.php?error_id=404&FWR-URL=%.....

 

2nd, did you ever figure a fix for google analytics ecommerce tracking for 2.3.x.x? If I remember the code included with addon support here; http://addons.oscommerce.com/info/8578 was for the 2.2 addon here; http://addons.oscommerce.com/info/3756

 

Hello Scott @@greasemonkey,

 

Just uploaded version Mobile OsC 7.3.0. with support for all OsC 2.3.x header tag modules.

Link to comment
Share on other sites

Strange, for me it works perfectly. I have tested it on my iPhone and in my browser, and the too large images resize perfectly while the ones that are too small are just enlarged to their actual size.

 

If you want to check again, this product has an image that is 1500x1500px originally:

http://mobile.breakthrough.ch/mobile/product_info.php?products_id=49442

 

While the image for this product is only 241x208px:

http://mobile.breakthrough.ch/mobile/product_info.php?products_id=49442

 

I think that it does work :)

 

Hello Raphael @@rafhun,

 

Just uploaded Mobile OsC 7.3.0. which inludes support for the product title and image resize.

Link to comment
Share on other sites

@@raiwa, I have updated and all looks good. I'm using KISS images so I didn't make those changes...

 

Also, Maybe include header_tags_social_bookmarks.php in the contribution support addon?

 

I just wanted to confirm the google analytics support addon for 2.3.x.x in mobile/includes/header.php should be - should it not?

 

<?php
include_once(DIR_WS_MODULES . 'header_tags/ht_google_analytics.php');
?>

 

Not

 

<?php
include_once(DIR_WS_MODULES . 'analytics/analyticstracking.php');
?>

 

 

 

Link to comment
Share on other sites

@@raiwa, I have updated and all looks good. I'm using KISS images so I didn't make those changes...

 

Also, Maybe include header_tags_social_bookmarks.php in the contribution support addon?

 

I just wanted to confirm the google analytics support addon for 2.3.x.x in mobile/includes/header.php should be - should it not?

 

<?php
include_once(DIR_WS_MODULES . 'header_tags/ht_google_analytics.php');
?>

 

Not

 

<?php
include_once(DIR_WS_MODULES . 'analytics/analyticstracking.php');
?>

 

Hello Scott @@greasemonkey,

 

The instructions for the google analytics support in the contribution support package are for the case someone uses the generic intructions given in the google analytics support page (In google). For the core support included in OsCommerce since 2.3.1 it is not necessary to add any additional code.

It is all done including the new code in the mobile header and footer:

<?php
$oscTemplate->buildBlocks();
echo $oscTemplate->getBlocks('header_tags');
?>

<?php echo $oscTemplate->getBlocks('footer_scripts'); ?>

 

The mistake is to call it for OsC 2.3.x.x..Sorry, I'll change the instructions to explain this better in the next update.

Edited by raiwa
Link to comment
Share on other sites

@@raiwa, Just a follow up on your earlier reply...

 

I never observed this in my stores. Maybe you could check the installation (includes/configure.php, includes/functions/html_output.php, includes/functions/general.php, SEO URL modifications).

 

I have double checked my install and everything is good with includes/configure.php & includes/functions/general.php.

 

I have SEO URL's 5, so there are no mods to html_output.php. This is handled my SEO urls... and this is my guess as to where the problem starts. If you have any ideas please let me know...

 

 

Link to comment
Share on other sites

Hi all,

 

paypal standard module follows mobile standards but the express checkout not. Is it right?

Edited by Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

Hi all,

 

paypal standard module follows mobile standards but the express checkout not. Is it right?

 

Hello @@Gergely,

 

There is a mod. included in the iosc mobile installation for the PayPal express module since Mobile OSC 7.2.1.

It adds the link rel="external" tag to the PayPal express button in mobile shopping cart, if you mean this.

 

regards

Rainer

Link to comment
Share on other sites

@@raiwa, Just a follow up on your earlier reply...

 

 

 

I have double checked my install and everything is good with includes/configure.php & includes/functions/general.php.

 

I have SEO URL's 5, so there are no mods to html_output.php. This is handled my SEO urls... and this is my guess as to where the problem starts. If you have any ideas please let me know...

 

Hello @@greasemonkey,

 

I'll research this ASAP.

 

Rainer

Link to comment
Share on other sites

@@raiwa interesting read here; http://perishablepress.com/stop-404-requests-for-mobile-versions-of-your-site/

 

Is there a way of redirecting these looping mobile/ 404 requests via htaccess?

 

I have both Jack's headerstatus handler and custom 404 page installed. Below is what my htaccess looks like;

 

 # Change RewriteBase using the instructions above  
 RewriteBase /
 RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
# IOSC mobile site
 RewriteRule ^([a-z0-9/-]+)-mp-([0-9]+).html$ mobile/product_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mc-([0-9_]+).html$ mobile/catalog_mb.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mm-([0-9_]+).html$ mobile/catalog_mb.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mpi-([0-9]+).html$ mobile/popup_image.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mpr-([0-9]+).html$ mobile/product_reviews.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mpri-([0-9]+).html$ mobile/product_reviews_info.php [NC,L,QSA]
 # Articles contribution
 RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
 # Information pages
 RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
 # Links contribution
 RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
 # Newsdesk contribution
 RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
# Mobile Articles contribution
 RewriteRule ^([a-z0-9/-]+)-mt-([0-9_]+).html$ mobile/articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mau-([0-9]+).html$ mobile/articles.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-ma-([0-9]+).html$ mobile/article_info.php [NC,L,QSA]
 # Mobile Information pages
 RewriteRule ^([a-z0-9/-]+)-mi-([0-9]+).html$ mobile/information.php [NC,L,QSA]
 # Mobile Links contribution
 RewriteRule ^([a-z0-9/-]+)-mlinks-([0-9_]+).html$ mobile/links.php [NC,L,QSA]
 # Mobile Newsdesk contribution
 RewriteRule ^([a-z0-9/-]+)-mn-([0-9]+).html$ mobile/newsdesk_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mnc-([0-9]+).html$ mobile/newsdesk_index.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mnri-([0-9]+).html$ mobile/newsdesk_reviews_info.php [NC,L,QSA]
 RewriteRule ^([a-z0-9/-]+)-mnra-([0-9]+).html$ mobile/newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>

ErrorDocument 400 /http_error.php?error_id=400
ErrorDocument 401 /http_error.php?error_id=401
ErrorDocument 403 /http_error.php?error_id=403
ErrorDocument 404 /http_error.php?error_id=404
ErrorDocument 405 /http_error.php?error_id=405
ErrorDocument 408 /http_error.php?error_id=408
ErrorDocument 415 /http_error.php?error_id=415
ErrorDocument 500 /http_error.php?error_id=500
ErrorDocument 501 /http_error.php?error_id=501
ErrorDocument 502 /http_error.php?error_id=502
ErrorDocument 503 /http_error.php?error_id=503
ErrorDocument 505 /http_error.php?error_id=505
ErrorDocument 504 /http_error.php?error_id=504

 

I was thinking something like this? But it doesn't work - just causes redirect loop;

 

# REDIRECT 404 MOBILE REQUESTS
<ifmodule mod_rewrite.c>
RewriteCond %{REQUEST_URI} /mobile/mobile/?$ [NC,OR]
RewriteRule (.*) http://www.mysite.com/ [R=301,L]  
</ifmodule>

 

Manually, when I go to one of these links, I do get a 404 page. However, the bots seem check mobile/my-bad-link.php get a 404 and so move on to mobile/mobile/my-bad-link.php then mobile/mobile/mobile/my-bad-link.php etc etc.... I must have had more than 200 links like this and my previous post above going most of the day yesterday (normally its only a few).

Link to comment
Share on other sites

Hello Scott @@greasemonkey,

 

Try this, it works for me:

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

 

Put it in the SEO URL part, it will redirect all mobile/mobile/... URLs to the mobile root.

 

Hope this helps for now, but I would like to find the root of this problem.

 

kind regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

@@raiwa thank you. That script works (doesn't cause a redirect loop error) unfortunately it does not help the issue of mentioned above;

 

mobile/my-bad-link.php get a 404 and so move on to mobile/mobile/my-bad-link.php then mobile/mobile/mobile/my-bad-link.php etc etc

 

I haven't figured out the cause yet, however, I can reproduce the issue now on command. I had installed the apple touch icon addon here; http://addons.oscommerce.com/info/7646

 

So, I had presumed the issue was ONLY caused by bots - it is not. The issue happens to some degree every time a real customer (not a bot) bookmarks the site from an apple mobile device. As I said above, I can recreate the issue by bookmarking the site.

 

This leads me to believe there is an issue with apple touch addon (or my install of the addon) - @@Gergely , any input you can provide would be greatly appreciated. The apple touch icon is located in the root - see my posts above, why would it be looking at the /mobile/ dir for apple-touch-icon.png (leading to a 404 error)? I have updated my apple touch addon from the Fed. 2013 release to the Nov. 2013 and changing my mobile/includes/header.php from;

 

<?php 
 $oscTemplate->buildBlocks();
 echo $oscTemplate->getBlocks('header_tags');
?>

 

to

 

<?php 
 echo $oscTemplate->getBlocks('mobile_header_tags');
 echo $oscTemplate->getBlocks('header_tags');
?>

 

But it doesn't help. BTW, which is correct?

 

The apple touch icon issue is just a symptom of the actual issue. Because the issue will happen on many 404 pages in the /mobile/ directory.

 

Thoughts?????

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...