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

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

Recommended Posts

Hello Bill @@phi148,

 

Yes ok. I checked it and this happens if the main switcher in:

Admin => Configuration => Mobile Site => Enable Mobile Site? is set to false

AND

Auto Redirect to Desktop Site is set to true

 

Please set both to true or both to false for a fast fix.

 

Then I found these modifications which allow to use both settings in any combination:

 

In catalog/includes/application_top.php

At the very end modify the mobile redirect  to:

  //BEGIN : MOBILE REDIRECT_SCRIPT    
	require(DIR_FS_MOBILE . 'includes/functions/devicelist.php');
	if ( (MOBILE_SITE=='True' || MOBILE_CLASSIC_REDIRECT == 'true') && !defined('MOBILE_SESSION') ) {
	  require(DIR_FS_MOBILE . 'includes/classes/mobile_redirect.php');
	    if ( !strpos($_SERVER['REQUEST_URI'], 'checkout') )
			$mobileRedirect = new mobileRedirect;
	} elseif ( !strpos($_SERVER['REQUEST_URI'], 'checkout') ) {
	  require(DIR_FS_MOBILE . 'includes/classes/classic_redirect.php');
	  $mobileRedirect = new classicRedirect;
	}
//END : MOBILE REDIRECT_SCRIPT

In: catalog/mobile/includes/classes/mobile_redirect.php:

find:

    function isCancelled() {
    	if (tep_session_is_registered('MredirectCancelled')) 
    		return true;
    	if(isset($_GET['MredirectCancelled']) && $_GET['MredirectCancelled'] == 'true') {
    		tep_session_register('MredirectCancelled');
    		return true;
    	}
    	return false;
    }

and change to:

    function isCancelled() {
    	if (MOBILE_SITE != 'True') 
    		return true;
    	if (tep_session_is_registered('MredirectCancelled')) 
    		return true;
    	if(isset($_GET['MredirectCancelled']) && $_GET['MredirectCancelled'] == 'true') {
    		tep_session_register('MredirectCancelled');
    		return true;
    	}
    	return false;
    }

Please try and let me know if it works for you too.

I'll include this fix then in the next update.

 

regards

Rainer

 

PS: nothing to do with subdirectory or subdomain. Should work for both.

 

Works like a charm!  I can't THANK YOU enough!

Share this post


Link to post
Share on other sites

One other question, I am using the KISS image thumbnailer, seems to work fine.

 

The only odd thing is, every now and then, when on the mobile site, if I click on a product, the picture does not appear in the product listing.  However, if I simply hit the refresh button in my browser, the picture then shows up just fine.  It is simply on the first load that the picture does not show.

 

Any ideas on that one?

 

Thanks again for the excellent support!  :)

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

Please try this:

in: catalog/mobile/includes/header.php

Find:

<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Modify to:

<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Let me know, I'll include it then in the next update.

 

Thank you very much for the reports and testing.

 

kind regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

Please try this:

in: catalog/mobile/includes/header.php

Find:

<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Modify to:

<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Let me know, I'll include it then in the next update.

 

Thank you very much for the reports and testing.

 

kind regards

Rainer

 

Fixed!  

 

I also have some additional MVS fixes that I'll be passing to you via PM.

 

Additional modifications to checkout_process.php and checkout_confirmation.php appear to be needed.

 

Thanks!

Share this post


Link to post
Share on other sites

@@phi148,

 

I do not use MVS myself, please see the post from @@marcochiana

 

http://forums.oscommerce.com/topic/327785-contribution-iosc-mobile-version-of-osc-on-your-iphone/?p=1726801

 

and the next posts.

 

Please contact him for support.

Edited by raiwa

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

Please try this:

in: catalog/mobile/includes/header.php

Find:

<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Modify to:

<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Let me know, I'll include it then in the next update.

 

Thank you very much for the reports and testing.

 

kind regards

Rainer

 

Actually, I think there is a bug in that code you posted.  colorbox and photoset-grid do not exist in "mobile/ext"

Share this post


Link to post
Share on other sites

@@phi148,

 

ohps well, you are right. I was too fast with this, I just copied the base url above. Of course it should be the main server and directory:

<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/photoset-grid/jquery.photoset-grid.min.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo ($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/colorbox.css" />
<script type="text/javascript" src="<?php echo ($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_HTTP_CATALOG; ?>ext/colorbox/jquery.colorbox-min.js"></script><?php

Sorry and thank you.

 

For the description links to contact_us.php:

Just add the same redirect snippet you added to catalog/index.php and catalog/product_info.php also to catalog/contact_us.php

 

For the Header Tgas:

In catalog_mb.php and product_info.php they look all ok.

On the other mobile pages it seems you didn't add the header tags, they are not showing.

 

regards

Rainer

Edited by raiwa

Share this post


Link to post
Share on other sites

Thanks for the feedback.

 

I've moved onto the support package containing the mobile sitemap.

 

I copied the folder (usu5_sitemaps) and I ran the index.php

 

All the sitemaps were indeed generated, however they do not contain the SEO URL's.  For example, this is part of the output of sitemapMobileProducts.xml

 

<url>
<loc>
http://www.mysite.com//mobile/product_info.php?products_id=1252
</loc>
<lastmod>2015-04-26</lastmod>
<changefreq>weekly</changefreq>
<priority>0.5</priority>
<image:image>
<image:loc>
http://www.mysite.com/images/xxx/xxx.jpg
</image:loc>
<image:title>Widget</image:title>
</image:image>
<mobile:mobile/>
</url>
 
Any clue on the fix for that one?
Edited by phi148

Share this post


Link to post
Share on other sites

Hi Bill @@phi148 ,

I appreciate, if you share the modification needed for MVS in mobile checkout_process.php and checkout_confirmation.php here or via PM

 

Thanks

Marco

Share this post


Link to post
Share on other sites

Hi Bill @@phi148 ,

I appreciate, if you share the modification needed for MVS in mobile checkout_process.php and checkout_confirmation.php here or via PM

 

Thanks

Marco

 

Sure, I'll be in touch soon.  I should have time tomorrow to get the information together.

Edited by phi148

Share this post


Link to post
Share on other sites

Raiwa

 

Do you know how I can default the "sort" to be by price from low to high?  Right now default sort is by Product Name.

 

Thanks!

Share this post


Link to post
Share on other sites

Hello Bill @@phi148,

 

In mobile/catalog_mb.php

find:

        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by pd.products_name";
          break;

change to:

        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by order by final_price desc";
          break;
Edited by raiwa

Share this post


Link to post
Share on other sites
I have a problem.
I have version 2.3.4. and for some years also SEO Urls 5. If I don't delete application.php :
 
  /**
  * ULTIMATE Seo Urls 5 PRO by FWR Media
  */
  
Usu_Main::i()->setVar'languages_id'$languages_id )
               ->
setVar'request_type'$request_type 
               ->
setVar'session_started'$session_started 
               ->
setVar'sid'$SID 
               ->
setVar'language'$language )
               ->
setVar'filename'$PHP_SELF )
               ->
initiate( ( isset( $lng ) && ( $lng instanceof language ) ) ? $lng : array(), $languages_id$language );

and until I dont delete in html_output.php;
 
  /**
  * ULTIMATE Seo Urls 5 PRO by FWR Media
  * Replacement for osCommerce href link wrapper function
  */
  
require_once DIR_WS_MODULES 'ultimate_seo_urls5/main/usu5.php';
  
  function 
tep_href_link$page ''$parameters ''$connection 'NONSSL'$add_session_id true$search_engine_safe true ) {
    return 
Usu_Main::i()->hrefLink$page$parameters$connection$add_session_id$search_engine_safe );
  }
 
my web site does not work properly in mobile way. When I add original not corrected html_output.php files mobile supplement:

    defined('MOBILE_SESSION') ? $mobile_directory = HTTP_MOBILE_SERVER . DIR_WS_HTTP_MOBILE : $mobile_directory = HTTP_SERVER . DIR_WS_HTTP_CATALOG;
    defined('MOBILE_SESSION') ? $mobile_secure_directory = HTTPS_MOBILE_SERVER . DIR_WS_HTTPS_MOBILE : $mobile_secure_directory = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG;
    if ($connection == 'NONSSL') {
      $link = $mobile_directory;
    } elseif ($connection == 'SSL') {
      if (ENABLE_SSL == true) {
        $link = $mobile_secure_directory;
      } else {
        $link = $mobile_directory;

mobile works without any problem. What I have missed? How to install SEO Urls 5 code that I had to delete so that SEO Urls 5 works again?

Share this post


Link to post
Share on other sites

Hello @@Matjaz,

 

Yes it's this.

 

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

:-

 

regards

Rainer
 

Share this post


Link to post
Share on other sites

 

Hello Bill @@phi148,

 

In mobile/catalog_mb.php

find:

        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by pd.products_name";
          break;

change to:

        if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
          $HTTP_GET_VARS['sort'] = $i+1 . 'a';
          $listing_sql .= " order by order by final_price desc";
          break;

 

Thanks Raiwa

 

You have a slight typo:

 

$listing_sql .= " order by order by final_price desc";

 

should be:

 

$listing_sql .= " order by final_price desc";

 

Also, how do I get the dropdown sort box to reflect this current status.  Doing the change above works fine, however the sort dropdown box is now misleading as it defaults to: "Sorted by: Product Name"

 

When in reality, on page load, it is sorted by price with the change you suggested.

 

Thanks

bill

Share this post


Link to post
Share on other sites
Am I looking proper for KissIT_image_thumbnailer_r9? This I cannot find in my mobile file. I have osc 2.3.4

 

Thanks 

 

 

1. in: mobile/product_info.php

 

OsCommerce 2.3.

2 same entries:

a. *** FIND line 73:

 

$pi_entry .= '" target="_blank">' . tep_image(DIR_WS_IMAGES . $pi['image'], $product_info['products_name'], MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT) . '';

 

*** CHANGE TO:

 

$pi_entry .= '" target="_blank">' . tep_image(DIR_WS_IMAGES . $pi['image'], $product_info['products_name'], KISSIT_MAIN_PRODUCT_IMAGE_WIDTH/2, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT/2) . '';

 

 

b. *** FIND line 88:

 

 

<?php echo '' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT) . ''; ?>

 

*** CHANGE TO:

 

<?php echo '' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), KISSIT_MAIN_PRODUCT_IMAGE_WIDTH/2, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT/2) . ''; ?>

 

 

b. *** FIND line 192:

 

 

$pi_entry .= '" target="_blank">' . tep_image(DIR_WS_IMAGES . $pi['image'], $product_info['products_name'], MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT) . '';

 

*** CHANGE TO:

 

$pi_entry .= '" target="_blank">' . tep_image(DIR_WS_IMAGES . $pi['image'], $product_info['products_name'], KISSIT_MAIN_PRODUCT_IMAGE_WIDTH/2, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT/2) . '';

 

 

 

2. in: mobile/includes/modules/product_header.php

 

OsCommerce 2.2. and OsCommerce 2.3

a. *** FIND:

 

echo '

' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT) . '

';

 

*** CHANGE TO:

 

echo '

' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], KISSIT_MAIN_PRODUCT_IMAGE_WIDTH, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT, '') . '

';

 

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

 

3. in: mobile/includes/header.php

 

*** FIND:

 

' . tep_image(DIR_WS_HTTP_MOBILE . DIR_MOBILE_IMAGES . 'store_logo.png', STORE_NAME) . '

 

 

*** CHANGE TO:

 

' . tep_image(DIR_WS_HTTP_MOBILE . DIR_MOBILE_IMAGES . 'store_logo.png', STORE_NAME, MOBILE_LOGO_WIDTH, MOBILE_LOGO_HEIGHT) . '

 

 

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

 

4. in: includes/catalog_mb.php

 

*** FIND (inside other code):

 

$img = strlen($item['categories_image']) > 0 ? tep_image(DIR_WS_IMAGES . $item['categories_image'], $item['categories_name']) : tep_image(DIR_MOBILE_IMAGES . 'placeholder_trans.gif') ;

 

*** CHANGE TO:

 

$img = strlen($item['categories_image']) > 0 ? tep_image(DIR_WS_IMAGES . $item['categories_image'], $item['categories_name'], KISSIT_MAIN_PRODUCT_IMAGE_WIDTH/2, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT/2) : tep_image(DIR_MOBILE_IMAGES . 'placeholder_trans.gif') ;

 

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

 

5a. in: includes/configure.php

 

*** FIND:

 

// Width and height of the main product_info.php image

define ( 'KISSIT_MAIN_PRODUCT_IMAGE_WIDTH', 300 );

define ( 'KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT', 200 );

 

*** ADD BELOW:

 

define ( 'MOBILE_LOGO_WIDTH', '' );

define ( 'MOBILE_LOGO_HEIGHT', 50 );

 

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

 

5b. in: includes/configure.php

 

NOTE: This modification works for mobile installation in subdirectory. If your mobile site is installed under subdomain leave the standard setting and try.

If it doesn't work try another thumbnail add-on.

 

*** FIND:

 

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

 

*** CHANGE TO:

 

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

Share this post


Link to post
Share on other sites

@@phi148,

 

Great that you found it.

 

Fo rthe default selected sort by:

One line above the first change:

          $HTTP_GET_VARS['sort'] = $i+1 . 'b';
          $listing_sql .= " order by final_price desc";

change $i+1 to $i+2 if you are using the default order:

Image=1

Product Name=2

Product Price=3

 

If you changed the order in

Admin => Configuration=>Mobile Site

then try changing the number until Price shows by default

 

Change the letter b for descendent and a for ascendent.

Share this post


Link to post
Share on other sites

Hello @@Matjaz,

 

The kissit image thumbnail support has not been updated to the actual 2.3.4 version, so there are some minor changes.

However the main request for kissit image thumbnail to work are only 2:

1. the tep_image function must be used to call the image

2. fix image size (width and height) must be passed to the tep_image function.

 

so it's not difficult to modify the code even it changed a little bit:

 

For your points:

 

1. you can use here the instructions in KissIT_image_thumbnailer_BS, it's the same code in 2.3.4 mobile like in the main file:

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

 

2. very little change find:

					echo '<div class="visuel">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT) . '</div>';

and MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT to KISSIT_MAIN_PRODUCT_IMAGE_WIDTH, KISSIT_MAIN_PRODUCT_IMAGE_HEIGHT

 

It works also with the original code, just try, its only a question of the image size.

 

3+4 this code is there like shown in the instructions.

 

5. This has been updated in 7.5.8, the instructions are for iosc Mobile 7.5.0.

 

Search now for:

  (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/'));

However you should try to understand the sense of the code and not only search and replace for exact text strings.

In this line the image directory is defined and the line to replace can be identified if you look for: define('DIR_WS_IMAGES',

 

replace all line with the given code in the kissit instructions.

 

I'm sorry, but it is impossible to keep all add-on support updated for all changes and updateds in core files and other add-ons which are related.

 

regards

Rainer

Share this post


Link to post
Share on other sites

Thanks Raiwa, yet again, awesome support.

 

Everything seems to be working spot on.  Just one more question.

 

What would be the easiest way to either eliminate or redirect "home" to "store" ?

 

I would really like customers to land on "catalog_mb" rather than "index.php" when going to :   www.mysite.com/mobile

 

I really have no need for the "home" as it does not list categories and forces the customer to click on "store" to start navigating the site.

Share this post


Link to post
Share on other sites

 

Raiwa

 

That change actually breaks SEO URLS 5.

 

I've noticed that now the .htaccess rewrites are incorrect as they reference "catalog_mb.php" that no longer exists if I get rid of that file.  I changed the .htaccess to "index.php" instead, but it appears there are still more changes needed.

 

Can you help?

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

×