Jump to content



* * * * * 2 votes

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


  • Please log in to reply
1207 replies to this topic

#1201   raiwa

raiwa
  • Members
  • 374 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Mataró, Barcelona, Spain

Posted 21 March 2014 - 08:51 AM

View Postrafhun, on 21 March 2014 - 07:29 AM, said:

Hi Rainer @raiwa

thanks for your reply. So I figured out that the session ID was lost in the banner link or rather just not added which probably started a new session?

Thing is that the banners are managed through the internal banner manager and are the same as in the classic shop. I tweaked the index page a little to automatically display banners of the group which corresponds to the current category ID. This makes it very easy to show fitting banners below the categories… That's why I cannot alter the links too much.
However I found a solution by tweaking the redirect page (mobile/redirect.php, l16) some more:

case 'banner':
	 $banner_query = tep_db_query("select banners_url from " . TABLE_BANNERS . " where banners_id = '" . (int)$HTTP_GET_VARS['goto'] . "'");
	 if (tep_db_num_rows($banner_query)) {
	 $banner = tep_db_fetch_array($banner_query);
	 tep_update_banner_click_count($HTTP_GET_VARS['goto']);
	 if (tep_not_null($SID)) {
	 $_sid = $SID;
	 } elseif ( ( ($request_type == 'NONSSL') && ($connection == 'SSL') && (ENABLE_SSL == true) ) || ( ($request_type == 'SSL') && ($connection == 'NONSSL') ) ) {
	 if (HTTP_COOKIE_DOMAIN != HTTPS_COOKIE_DOMAIN) {
		 $_sid = tep_session_name() . '=' . tep_session_id();
	 }
	 }

	 tep_redirect(str_replace('profimusic.it/catalog', 'mobile.profimusic.it/mobile', $banner['banners_url']).'&'.$_sid);
	 }
	 break;

I borrowed the obtaining of the $SID from the tep_href_link function. The string replace automatically converts my banner links to mobile links and now that the session ID is appended the shopping cart problem is solved :)

regards Raphael

Great, I'll have a look for the next update to solve this, but as the banners are normally used for external links your solution can't be used as a generic modification.

#1202   rafhun

rafhun
  • Members
  • 16 posts
  • Real Name:Raphael Hüni

Posted 21 March 2014 - 09:24 AM

View Postraiwa, on 21 March 2014 - 08:51 AM, said:

Great, I'll have a look for the next update to solve this, but as the banners are normally used for external links your solution can't be used as a generic modification.

Yeah, of course… we at the moment only have internal links for the banners… otherwise I would probably create a new tep_display_banner function which redirect with int_banner resp. ext_banner to the redirect.php and there introduce a new case in the switch where internal links have the string replace and session id added and external links are handled "normally".

#1203   papalevies

papalevies
  • Members
  • 12 posts
  • Real Name:Nick

Posted 27 March 2014 - 01:23 PM

I just noticed that jquery is linked twice in mobile/includes/header.php, once on it's own and once in header_tags. As a result fancybox doesn't work. I reorganized by replacing the first link of jquery with
echo $oscTemplate->getBlocks('header_tags');
basically I moved the code at the top because there are dependencies on jquery in the code that follows and now it's working. I only noticed because I was upgrading the jquery version on the site.

I also noticed that the images don't resize and overflow their containers. That's easily fixable by adding another class for product images and using css:
max-width: 100%;
height: auto;

Edited by papalevies, 27 March 2014 - 01:38 PM.


#1204   raiwa

raiwa
  • Members
  • 374 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Mataró, Barcelona, Spain

Posted 27 March 2014 - 05:05 PM

Hello Nick @papalevies,

View Postpapalevies, on 27 March 2014 - 01:23 PM, said:

I just noticed that jquery is linked twice in mobile/includes/header.php, once on it's own and once in header_tags. As a result fancybox doesn't work. I reorganized by replacing the first link of jquery with
echo $oscTemplate->getBlocks('header_tags');
basically I moved the code at the top because there are dependencies on jquery in the code that follows and now it's working. I only noticed because I was upgrading the jquery version on the site.

Could you please post your modified header? I couldn't find the jquery link in header tags.
I checked this and in the standard osc mobile version 7.3.2. fancybox works fine. Maybe it has something to do with your update?

View Postpapalevies, on 27 March 2014 - 01:23 PM, said:

I also noticed that the images don't resize and overflow their containers. That's easily fixable by adding another class for product images and using css:
max-width: 100%;
height: auto;
This is done since version 7.3.0. at least in product_info.php and includes/modules/product_header.php:
	  $pi_entry .= '" target="_blank">' . tep_image(DIR_WS_IMAGES . $pi['image'], $product_info['products_name'], MOBILE_PRODUCT_IMAGE_WIDTH, MOBILE_PRODUCT_IMAGE_HEIGHT, 'style="max-width:100%; max-height:100%"') . '</a>';
Together with the admin configuration setting "auto" for MOBILE_PRODUCT_IMAGE_WIDTH and MOBILE_PRODUCT_IMAGE_HEIGHT.

Maybe you mean that it is still missing in the product listing (catalog_mb.php-includes/modules/products.php)?

Thanks for the clearing up
Kind regards
Rainer

#1205   mrossi

mrossi
  • Members
  • 75 posts
  • Real Name:Matthew

Posted 05 April 2014 - 10:24 PM

just upgraded to 7.3.2 but for some reason I get error loading page when I click a header link.  I didn't have a lot of free time to read the forums, so if this has already been answered I apologize.

http://www.isorm.com/mobile/

#1206   raiwa

raiwa
  • Members
  • 374 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Mataró, Barcelona, Spain

Posted 07 April 2014 - 08:54 AM

View Postmrossi, on 05 April 2014 - 10:24 PM, said:

just upgraded to 7.3.2 but for some reason I get error loading page when I click a header link.  I didn't have a lot of free time to read the forums, so if this has already been answered I apologize.

http://www.isorm.com/mobile/

Hello Matthew @mrossi,

The links in all mobile site are pointing to the classic site. So it seems that the mods in the tep_href_link funtion in includes/functions/html_output.php need to be added.
Then I found that you are using SEO URLs, so you need to add the support for this to the mobile site.
It is included in the support package:
http://addons.oscommerce.com/info/8578

Kind regards
Rainer

#1207   rafhun

rafhun
  • Members
  • 16 posts
  • Real Name:Raphael Hüni

Posted 08 April 2014 - 06:14 AM

Hi Rainer @raiwa

I just did a small fix to my mobile/login.php file… Changed line89 to:
<?php echo tep_input_jquery('email_address', '', '', 'email'); ?>

so entering your email as login on a mobile device gets easier…

Regards
Raphael

#1208   raiwa

raiwa
  • Members
  • 374 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Mataró, Barcelona, Spain

Posted 08 April 2014 - 06:17 AM

View Postrafhun, on 08 April 2014 - 06:14 AM, said:

Hi Rainer @raiwa

I just did a small fix to my mobile/login.php file… Changed line89 to:
<?php echo tep_input_jquery('email_address', '', '', 'email'); ?>

so entering your email as login on a mobile device gets easier…

Regards
Raphael

Hello Raphael @rafhun,

Thank you. This is already prepared for the next update. All input fields will be enhanced.

regards
Rainer