Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


bumbarash

Recommended Posts

I don't know what you mean with banner in the header. When I look at the header.php, there is nothing mentioned about a banner.

 

Andreas

 

Hello,

 

in: mobile/includes/header.php

 

find this line:

 

<div id="headerLogo"><?php echo '<a href="' . tep_mobile_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'baner_sar_mobile.jpg', STORE_NAME, 0,30) . '</a>';?></div>

 

change: baner_sar_mobile.jpg to the name of a reduced version of your shops logo (copy to image folder) you use in the header of your shop (this I mean with banner)

 

or if you don't wants to include your logo, put a dummy image like "pixel_trans.gif"

or try to erase this line, maybe this will resolve the problem too.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello,

 

in: mobile/includes/header.php

 

find this line:

 

<div id="headerLogo"><?php echo '<a href="' . tep_mobile_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . 'baner_sar_mobile.jpg', STORE_NAME, 0,30) . '</a>';?></div>

 

change: baner_sar_mobile.jpg to the name of a reduced version of your shops logo (copy to image folder) you use in the header of your shop (this I mean with banner)

 

or if you don't wants to include your logo, put a dummy image like "pixel_trans.gif"

or try to erase this line, maybe this will resolve the problem too.

 

regards

Rainer

The logo is not the problem. With version 5.1 the icons of shop, catalogue, account, search and information are not shown.

I now changed in header.php for example the line:

 

<td class="headerNavigation"><a href="<?php echo tep_mobile_link(FILENAME_DEFAULT);?>"><?php echo tep_image(DIR_WS_HTTP_CATALOG . DIR_MOBILE_IMAGES. "home.png") . "<br>" . TEXT_HOME; ?></a></td>

to

<td class="headerNavigation" id="headerShop"><a href="<?php echo tep_mobile_link(FILENAME_DEFAULT);?>"><?php echo tep_image(DIR_WS_HTTP_CATALOG . DIR_MOBILE_IMAGES. "home.png") . "<br>" . TEXT_HOME; ?></a></td>

 

and the icons are shown. It seems the id="headerShop" is missing in version 5.1 But this is not a nice

solution because in the text and not the icons are touchable so one has to be very carefull when touchng

the menubar. Is there a better solution for this?

 

Andreas

Link to comment
Share on other sites

The logo is not the problem. With version 5.1 the icons of shop, catalogue, account, search and information are not shown.

 

 

Andreas

 

open a page of your store in a browser, do a right click on the broken image and open in a new window. Look at the structure of the URL you got and you will find out what's wrong with the image linking.

Link to comment
Share on other sites

The logo is not the problem. With version 5.1 the icons of shop, catalogue, account, search and information are not shown.

I now changed in header.php for example the line:

 

<td class="headerNavigation"><a href="<?php echo tep_mobile_link(FILENAME_DEFAULT);?>"><?php echo tep_image(DIR_WS_HTTP_CATALOG . DIR_MOBILE_IMAGES. "home.png") . "<br>" . TEXT_HOME; ?></a></td>

to

<td class="headerNavigation" id="headerShop"><a href="<?php echo tep_mobile_link(FILENAME_DEFAULT);?>"><?php echo tep_image(DIR_WS_HTTP_CATALOG . DIR_MOBILE_IMAGES. "home.png") . "<br>" . TEXT_HOME; ?></a></td>

 

and the icons are shown. It seems the id="headerShop" is missing in version 5.1 But this is not a nice

solution because in the text and not the icons are touchable so one has to be very carefull when touchng

the menubar. Is there a better solution for this?

 

Andreas

 

 

I just copied the files from the iOSC 5.1 package to my unmodified oscommerce-2.2rc2a testshop and the icons show correct.

The "id="headerShop" code should not be necessary.

I began to adapt today the iOSC5.1 files to oscommerce-2.3.3 (unmodified testshop too) and no problem, the icons show correct there too.

 

So I can't recreate this bug to help you further.

 

Regards

Rainer

Link to comment
Share on other sites

open a page of your store in a browser, do a right click on the broken image and open in a new window. Look at the structure of the URL you got and you will find out what's wrong with the image linking.

This does not work because the image of the link is not there. There is only the name of the link present.

Only when I add id="headerShop", the image is shown, but again only the text is active and not also the

image.

 

I am using Firefox 16.0.1. You can see the behaviour here:

http://www.bitcorner.de/shop/mobile_index.php

 

Andreas

Link to comment
Share on other sites

This does not work because the image of the link is not there. There is only the name of the link present.

Only when I add id="headerShop", the image is shown, but again only the text is active and not also the

image.

 

I am using Firefox 16.0.1. You can see the behaviour here:

http://www.bitcorner.de/shop/mobile_index.php

 

Andreas

 

Try then the code of version 4.1:

 

<td class="headerNavigation" id="headerBoutique" onclick="location.href='<?php echo tep_mobile_link(FILENAME_CATALOG);?>'"><a href="<?php echo tep_mobile_link(FILENAME_CATALOG);?>"><?php echo TEXT_SHOP; ?></a></td>
<td class="headerNavigation" id="headerAccount" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>"><?php echo TEXT_ACCOUNT; ?></a></td>
<td class="headerNavigation" id="headerSearch" onclick="location.href='<?php echo tep_mobile_link(FILENAME_SEARCH);?>'"><a href="<?php echo tep_mobile_link(FILENAME_SEARCH);?>"><?php echo IMAGE_BUTTON_SEARCH; ?></a></td>
<td class="headerNavigation" id="headerAbout" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>"><?php echo TEXT_ABOUT; ?></a></td>

 

 

Maybe this will do it for you,

in my shop it didnt work that's why I changed it.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Try then the code of version 4.1:

 

<td class="headerNavigation" id="headerBoutique" onclick="location.href='<?php echo tep_mobile_link(FILENAME_CATALOG);?>'"><a href="<?php echo tep_mobile_link(FILENAME_CATALOG);?>"><?php echo TEXT_SHOP; ?></a></td>
<td class="headerNavigation" id="headerAccount" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>"><?php echo TEXT_ACCOUNT; ?></a></td>
<td class="headerNavigation" id="headerSearch" onclick="location.href='<?php echo tep_mobile_link(FILENAME_SEARCH);?>'"><a href="<?php echo tep_mobile_link(FILENAME_SEARCH);?>"><?php echo IMAGE_BUTTON_SEARCH; ?></a></td>
<td class="headerNavigation" id="headerAbout" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>"><?php echo TEXT_ABOUT; ?></a></td>

 

 

Maybe this will do it for you,

in my shop it didnt work that's why I changed it.

 

regards

Rainer

 

 

Another posibility could be to put the complete image path hardcoded:

 

www.bitcorner.de/shop/mobile/images/home.png

instead of:

DIR_WS_HTTP_CATALOG . DIR_MOBILE_IMAGES. "home.png"

 

 

Rainer

Link to comment
Share on other sites

Try then the code of version 4.1:

 

<td class="headerNavigation" id="headerBoutique" onclick="location.href='<?php echo tep_mobile_link(FILENAME_CATALOG);?>'"><a href="<?php echo tep_mobile_link(FILENAME_CATALOG);?>"><?php echo TEXT_SHOP; ?></a></td>
<td class="headerNavigation" id="headerAccount" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ACCOUNT);?>"><?php echo TEXT_ACCOUNT; ?></a></td>
<td class="headerNavigation" id="headerSearch" onclick="location.href='<?php echo tep_mobile_link(FILENAME_SEARCH);?>'"><a href="<?php echo tep_mobile_link(FILENAME_SEARCH);?>"><?php echo IMAGE_BUTTON_SEARCH; ?></a></td>
<td class="headerNavigation" id="headerAbout" onclick="location.href='<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>'"><a href="<?php echo tep_mobile_link(FILENAME_MOBILE_ABOUT);?>"><?php echo TEXT_ABOUT; ?></a></td>

 

 

Maybe this will do it for you,

in my shop it didnt work that's why I changed it.

 

regards

Rainer

Yes, thank you! The code of 4.x works and the icon is active too.

 

Andreas

Link to comment
Share on other sites

from viewing the source now, I can tell that you are using the old header where the images were called via css as backgrounds.

 

 

the id="headerShop" is missing in your first table cell

Link to comment
Share on other sites

Hi guys,

this is nice contrbituions is working well but have some problem with some pages. First i had "blank" pages, after small fix

 

i got the problem: Warning: Cannot modify header information - headers already sent by (output started at /home/mobile/includes/application_top.php:10) in /home/includes/functions/general.php on line 48

which is: <style type="text/css" media="screen"> from mobile/includes/application_top.php

 

Anybody knows what is wrong ? MySQL 5.0 but have old osc, so i hope is not PHP problem.

 

Please see it live: http://www.kacikpupila.pl/mobile_index.php and try press "KONTO - /login"

 

Greeings !

 

Exact same problem here. I see Oner has fixed it in his shop. Can you tell me how?

Link to comment
Share on other sites

Exact same problem here. I see Oner has fixed it in his shop. Can you tell me how?

 

I just visited your shop and I didn't get this error neither in firefox nor in Internet explorer.

Maybe you should just erase your browsers cache.

Another user told me he could get this resolved setting

output_buffering to 4096 in phpini

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hi! I really love this contribution... all the help in this forum is great (thank you thank you thank you) and I have got thru a few bugs on my installation. The one I can't find anything on is that the iphone.css does not load for my secure pages... login, account, checkout. etc. Along with the images in the secure pages as well. I think it must be in the mobile/includeds/ configuation.php but I have no clue what to change... Any help greatly apprecited!

Log Cabin Fever Gifts

Link to comment
Share on other sites

Hi! I really love this contribution... all the help in this forum is great (thank you thank you thank you) and I have got thru a few bugs on my installation. The one I can't find anything on is that the iphone.css does not load for my secure pages... login, account, checkout. etc. Along with the images in the secure pages as well. I think it must be in the mobile/includeds/ configuation.php but I have no clue what to change... Any help greatly apprecited!

 

 

Hello,

 

Open the file: mobile/includes/functions/general.php

 

At the top you will see there is the function "tep_mobile_link" which is used in the mobile site and doesn't include code for ssl support.

Below this finction you can see another called "tep_mobile_link2" which includes ssl support.

So I think you should try to change the link function from "tep_mobile_link" to "tep_mobile_link2" in the checkout pages where you wants to use ssl.

 

For example in: mobile_shopping_cart.php

 

line 216:

 

change

		 <td align="right" class="main"></form><?php echo tep_draw_form('cart_quantity', tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_CHECKOUT, 'name="checkout"') . '</form>'; ?></td>

 

to:

		 <td align="right" class="main"></form><?php echo tep_draw_form('cart_quantity', tep_mobile_link2(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_CHECKOUT, 'name="checkout"') . '</form>'; ?></td>

 

The same for all links in the other checkout pages, login, account etc. where you use ssl.

 

I can't test this as I don't use secure server but it could be this.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello,

 

Open the file: mobile/includes/functions/general.php

 

At the top you will see there is the function "tep_mobile_link" which is used in the mobile site and doesn't include code for ssl support.

Below this finction you can see another called "tep_mobile_link2" which includes ssl support.

So I think you should try to change the link function from "tep_mobile_link" to "tep_mobile_link2" in the checkout pages where you wants to use ssl.

 

For example in: mobile_shopping_cart.php

 

line 216:

 

change

		 <td align="right" class="main"></form><?php echo tep_draw_form('cart_quantity', tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_CHECKOUT, 'name="checkout"') . '</form>'; ?></td>

 

to:

		 <td align="right" class="main"></form><?php echo tep_draw_form('cart_quantity', tep_mobile_link2(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_CHECKOUT, 'name="checkout"') . '</form>'; ?></td>

 

The same for all links in the other checkout pages, login, account etc. where you use ssl.

 

I can't test this as I don't use secure server but it could be this.

 

regards

Rainer

 

Thank you so much for your reply. Unfortunatley that didn't work but I do think this is in the right direction! Thanks again!

Log Cabin Fever Gifts

Link to comment
Share on other sites

Have recently installed v5.1 to our site. The contribution is working fine as a mobile version of our site.

 

However, during the day we run several CRON jobs, the bulk of which, using a file obtained through FTP from our suppliers, updates the Product tables. When we switched on the IOSC3, we found these feeds would not run. We found that the Re-direct code in application_top.php is changing the name of our feed file to the mobile version, eg one file is named DDLTD.php and is called through CRON as such, the message I get from CRON is that it can't find the file mobile_DDLTD.php.

 

It does appear to run a portion of DDLTD.php. The file is split into 3 parts, 1st it downloads a CSV file from the supplier site via FTP, next it processes the CSV file and creates an array and thirdly updates the database.

 

The 1st part (the FTP part) seems to process, the rest dosen't. Also, Cron jobs that do not appear to have MYSQL calls works fine.

 

If I run the file manually, from the browser, it will process fine.

 

The previous versions (V4) of IOSC3 did not cause this problem.

 

It seems to be an incompatibility with the new re-direct function in application_top.php and CRON

 

Your assistance in this would be most welcome.

 

Steve

Link to comment
Share on other sites

Have recently installed v5.1 to our site. The contribution is working fine as a mobile version of our site.

 

However, during the day we run several CRON jobs, the bulk of which, using a file obtained through FTP from our suppliers, updates the Product tables. When we switched on the IOSC3, we found these feeds would not run. We found that the Re-direct code in application_top.php is changing the name of our feed file to the mobile version, eg one file is named DDLTD.php and is called through CRON as such, the message I get from CRON is that it can't find the file mobile_DDLTD.php.

 

It does appear to run a portion of DDLTD.php. The file is split into 3 parts, 1st it downloads a CSV file from the supplier site via FTP, next it processes the CSV file and creates an array and thirdly updates the database.

 

The 1st part (the FTP part) seems to process, the rest dosen't. Also, Cron jobs that do not appear to have MYSQL calls works fine.

 

If I run the file manually, from the browser, it will process fine.

 

The previous versions (V4) of IOSC3 did not cause this problem.

 

It seems to be an incompatibility with the new re-direct function in application_top.php and CRON

 

Your assistance in this would be most welcome.

 

Steve

 

 

Hello,

 

In includes/application_top.php

 

add the following to the redirect code:

if ($url_basename == 'DDLTD.php') {
				 $mobile_site = DDLTD.php;
 }

you can add this for example below:

if ($url_basename == 'recently_viewed.php') {
		 $mobile_site = str_replace('recently_viewed.php', 'mobile_index.php', $_SERVER['REQUEST_URI']);
}

 

This should prevent the file to be redirected to the mobile site.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello,

 

In includes/application_top.php

 

add the following to the redirect code:

if ($url_basename == 'DDLTD.php') {
				 $mobile_site = DDLTD.php;
 }

you can add this for example below:

if ($url_basename == 'recently_viewed.php') {
		 $mobile_site = str_replace('recently_viewed.php', 'mobile_index.php', $_SERVER['REQUEST_URI']);
}

 

This should prevent the file to be redirected to the mobile site.

 

regards

Rainer

 

Another possibility maybe to add the parameter "?redirectCancelled=true" to the cron job setup.

The file call should look then like this:

DDLTD.php?redirectCancelled=true

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Link to comment
Share on other sites

try to delete your browsers cache

 

Did not work. Tried it on IE and firefox. Even tried it with my smartphone.

 

Still not working on 2.3.3 and I can't get my head around it why

Link to comment
Share on other sites

Did not work. Tried it on IE and firefox. Even tried it with my smartphone.

 

Still not working on 2.3.3 and I can't get my head around it why

 

Hello,

 

Then I don't understand why this error doesn't appear when I visit your shop.

 

In any case you can try this:

 

Cut this line in mobile/includes/application_top.php:

<style type="text/css" media="screen">
@[member='import'] "<?php echo DIR_WS_HTTP_CATALOG . DIR_MOBILE_INCLUDES; ?>iphone.css";
</style>

 

And paste it to mobile/includes/header.php

just before the "</head>" tag.

 

Another possibility would be to add it to every page at the top below:

require(DIR_MOBILE_INCLUDES . 'header.php');

 

Please let me know if one of this works.

 

regards

Rainer

 

PS: I'm working on the iOSC integration on my second shop which is based on oscommerce 2.3.3 and never got this error message neither.

So I can't recreate the problem and have to do these kind of "blind strokes".

Sorry

Edited by raiwa
Link to comment
Share on other sites

Does not work either. But it is not a css problem

 

Go to http://www.shoptuin.nl/mobile and press on the account button. The page goed blank. and the url is http://www.shoptuin.nl/mobile_account.php

 

I think the problem is that it needs to check if you logged in or not. If you are not logged in it needs to redirect you to the login page and this does not happen.

 

Same problem when you go directly to the login page and try to login. The page goed blank aswell. but if I refresh the page after the login attempt everthing works well. Even If I press on account.

 

So as far as I can tell. The problem is this function or something related with it. Maybe in application top

 

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

tep_redirect(tep_mobile_link(FILENAME_LOGIN, '', 'SSL'));

}

 

the server is running on

PHP Version 5.3.10

Edited by mbuist
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...