Jump to content
bumbarash

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

Recommended Posts

what must i do to enable the multi vendor + multi geo zone works together with this mobile site, as it goes direct to the default shipping?? basically i just need the shipping part from the vendor

 

many thanks

Have you done what i did in my previous posts, also you will have to copy and extra code in any modified files to corresponding mobile files

 

Steve

Share this post


Link to post
Share on other sites

1 thing that puzzles me is mobile_advanced_search_result.php seems a redundant file as mobile_search.php does not send results to that page

 

Keyword search has been designed not to work to fix that

 

replace code in mobile_products.php with code below

 

<?php
require_once('mobile/includes/application_top.php');

   $listing_sql = "select 	p.products_id,  
   						pd.products_name, 
   						p.manufacturers_id, 
   						p.products_price, 
   						p.products_image, 
   						p.products_tax_class_id, 
   						IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, 
   						IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . 
   						TABLE_PRODUCTS_DESCRIPTION . " pd," .
   						TABLE_PRODUCTS . " p left join " . 
   						TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . 
   						TABLE_SPECIALS . " s on p.products_id = s.products_id, " . 
   						TABLE_PRODUCTS_TO_CATEGORIES . " p2c 
   						where p.products_status = '1' 
   						and p.products_id = p2c.products_id 
   						and pd.products_id = p2c.products_id 
   						and pd.language_id = '" . (int)$languages_id . "'";

if (isset($_GET['keywords'])){
	$keywords=explode(' ',addslashes($_GET['keywords']));
	foreach($keywords as $v) if(isset($v{1})) $listing_sql .= " and pd.products_name LIKE '%" . $v . "%'";
}

   if (isset($_GET['cPath']))
       $listing_sql .= " and p2c.categories_id = '" . (int)$current_category_id . "'";
   if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id']>0) 
       $listing_sql .= " and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";

   $listing_sql .= " order by pd.products_name";

   $PCSITE = DIR_MAIN_HTTP_CATALOG . FILENAME_DEFAULT . '?' . tep_get_all_get_params();
   require(DIR_MOBILE_INCLUDES . 'header.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

$headerTitle->write($breadcrumb->_trail[sizeof($breadcrumb->_trail)-1]['title']);

require(DIR_MOBILE_MODULES . 'products.php');
require(DIR_MOBILE_INCLUDES . 'footer.php'); 
?>

 

it will be slow if you have thousands of products but at least search on keywords will now work

 

Steve

Share this post


Link to post
Share on other sites

Thank you very much for your contribution. It works really good, except for the following two errors I got.

I am having problems with my iOSC installation.

I am doing tests on it. I have a fresh install of oscommerce RC2a.

My problems is that I cannot edit a billing or shipping address on the checkout process. If I try to do so, it redirects to a blank page.

Second, I cannot edit my address book entry.

When I try to do so, nothing happens when clicking on the update bottom.

 

Andre

Share this post


Link to post
Share on other sites

Thank you very much for your contribution. It works really good, except for the following two errors I got.

I am having problems with my iOSC installation.

I am doing tests on it. I have a fresh install of oscommerce RC2a.

My problems is that I cannot edit a billing or shipping address on the checkout process. If I try to do so, it redirects to a blank page.

Second, I cannot edit my address book entry.

When I try to do so, nothing happens when clicking on the update bottom.

 

Andre

Hi Andre,

 

A Blank page means there is errors, have a look in the error log if you have one, or output php errors

 

Im having trouble even loging i now on my server on mobile_login.php so i cant test the edit address, follow a few posts back i made changes to the mobile/includes/configure.php file

 

Steve

Share this post


Link to post
Share on other sites

ok my cart problem solve, i removed the changes made to : mobile_product_info.php

 

i wonder why

server i guess, it works fine on my 2 test servers, if i didnt make changes it sent me to main website cart, rediret didnt or doesnt work, maybe its my php version who knows

 

Steve

Share this post


Link to post
Share on other sites

ok some more changes the directory is wrong, so its looking for file in /includes/ not /mobile/includes/

 

in /mobile/includes/classes/split_page_results_ajax.php

 

find

<script language="javascript" src="includes/ajax.js"></script>
<script language="javascript" src="includes/split_page_results_ajax.js"></script>

 

change it to

<script language="javascript" src="mobile/includes/ajax.js"></script>
<script language="javascript" src="mobile/includes/split_page_results_ajax.js"></script>

 

Steve

Edited by steve_s

Share this post


Link to post
Share on other sites

Thank you very much for your contribution. It works really good, except for the following two errors I got.

I am having problems with my iOSC installation.

I am doing tests on it. I have a fresh install of oscommerce RC2a.

My problems is that I cannot edit a billing or shipping address on the checkout process. If I try to do so, it redirects to a blank page.

Second, I cannot edit my address book entry.

When I try to do so, nothing happens when clicking on the update bottom.

 

Andre

 

Hi Andre,

 

Try these changes http://forums.oscommerce.com/topic/327785-contribution-iosc-mobile-version-of-osc-on-your-iphone/page__view__findpost__p__1468922

 

Steve

Share this post


Link to post
Share on other sites

another thing i have noticed on checkout success you cant use main stores checkout success language file as links are wrong unless redirect works for you

in mobile_checkout_success.php

find

require(DIR_WS_LANGUAGES . $language . '/checkout_success.php');

 

change it to

require(DIR_WS_LANGUAGES . $language . '/mobile_checkout_success.php');

 

now make a copy of includes/languages/xxxx/checkout_success.php and rename in it mobile_checkout_success.php

 

and find any tep_href_link and change to tep_mobile_link

 

Steve

Share this post


Link to post
Share on other sites

Hello,

 

is just installed the Version 2.0

It was great. only copy the files an it works.

 

But I have a problem with the categories.

I have an multishop contribution.

On the mobile sites all categories was shown.

I think in the categories.js the categories was prepair?

But I can't js. At which point I have to change that only the categories was shown for these Shopfrontend.

In the categories table was a field shop_id.

 

 

Thanks Gero

Share this post


Link to post
Share on other sites

I cannot get a header image to show up.

 

define('DIR_MOBILE_IMAGES', 'mobile/images/');

define('DIR_MOBILE_INCLUDES', 'mobile/includes/');

 

My header image is 320 x 120 and is located in 'mobile/images/

 

I change the files under /mobile/includes header.php and iheader.php to the file name which is a JPEG and it still doesn't show.

 

 

 

Also the category icons are distorted. I have them at 40 x 30 which i set here

 

 

define ('MOBILE_IMAGE_WIDTH', '40px');

define ('MOBILE_IMAGE_HEIGHT', '30px');

 

The original images are proportionate at 160 x 120 off our website so it should not be distorted and it shows at 40 x 40.

 

yes i cleared the cache and hit refresh mutilple times also.


Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

Share this post


Link to post
Share on other sites

For those of you that wish to add a login/logoff button to the header of your pages.

 

In catalog/mobile/includes/classes/header_title.php

 

Find

$leftButton = " ";

and replace with

 if (tep_session_is_registered('customer_id')) 			$leftButton = '[url="http://%27%20.%20tep_mobile_link%28FILENAME_LOGOFF%29%20.%20%27"]' . tep_image(DIR_MOBILE_IMAGES . "logoff.png") . '[/url]'; 		else 		$leftButton = '[url="http://%27%20.%20tep_mobile_link%28FILENAME_ACCOUNT%29%20.%20%27"]' . tep_image(DIR_MOBILE_IMAGES . "login.png") . '[/url]'; 

 

Don't forget to create a logoff.png and login.png file !!!! and put those two files in your catalog/mobile/images folder.

 

If there is an alignment challenge, change these three lines:

<td class="headerTitleLeft">' . $leftButton . '</td>

 

<td class="headerTitle">' . $this->title . '</td>

 

<td class="headerTitleRight">' . $rightButton . '</td>

 

to:

 

<td align="left">' . $leftButton . '</td>

 

<td class="main" align="center">' . $this->title . '</td>

 

<td align="right">' . $rightButton . '</td>

 

If you wish to remove the login line from your account go to:

 

catalog/mobile/account.php and add two front-slashes (//) to line 23:

 

// echo tep_mobile_selection(tep_mobile_link(FILENAME_LOGOFF), array(HEADER_TITLE_LOGOFF));

 

Send me a pm with an email address if you want the login/logoff buttons

 

IT SHOULD BE:

 

if (tep_session_is_registered('customer_id'))

 

$leftButton = '<a href="' . tep_mobile_link(FILENAME_LOGOFF) . '">' . tep_image(DIR_MOBILE_IMAGES . "logoff.png") . '</a>';

 

else

 

$leftButton = '<a href="' . tep_mobile_link(FILENAME_ACCOUNT) . '">' . tep_image(DIR_MOBILE_IMAGES . "login.png") . '</a>';


Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

Share this post


Link to post
Share on other sites

I cannot get a header image to show up.

 

define('DIR_MOBILE_IMAGES', 'mobile/images/');

define('DIR_MOBILE_INCLUDES', 'mobile/includes/');

 

My header image is 320 x 120 and is located in 'mobile/images/

 

I change the files under /mobile/includes header.php and iheader.php to the file name which is a JPEG and it still doesn't show.

 

 

 

Also the category icons are distorted. I have them at 40 x 30 which i set here

 

 

define ('MOBILE_IMAGE_WIDTH', '40px');

define ('MOBILE_IMAGE_HEIGHT', '30px');

 

The original images are proportionate at 160 x 120 off our website so it should not be distorted and it shows at 40 x 40.

 

yes i cleared the cache and hit refresh mutilple times also.

 

I FOUND THE HEADER IMAGE ONLY APPEARS WHEN I LOG IN WITH AN ACCOUNT, HTTPS://. CAN WE FIX THIS?


Remember what the Bible says: He who is without sin, cast the first rock. And I shall smoketh it.

Share this post


Link to post
Share on other sites

Hi, I have installed the iosc_1_2_3 and it was working great, but i recently moved server to a PHP5 server and I reinstalled the contribution but is no longer working, I get a blank page. I made a .htaccess with php_flag display_errors On so I can see the errors, and they are:

 

Notice: Constant DIR_WS_HTTP_CATALOG already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 21

 

Notice: Constant DIR_WS_HTTPS_CATALOG already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 22

 

Notice: Constant DIR_WS_IMAGES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 23

 

Notice: Constant DIR_WS_INCLUDES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 26

 

Notice: Constant DIR_WS_TEMPLATES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 34

 

Notice: Constant DIR_WS_CONTENT already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 35

 

Warning: require() [function.require]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) is not within the allowed path(s): (/var/www/vhosts/mydomain.co.uk/httpdocs:/tmp) in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Warning: require(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) [function.require]: failed to open stream: Operation not permitted in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Fatal error: require() [function.require]: Failed opening required '/var/www/vhosts/lond-moda.co.uk/httpdocs/../includes/database_tables.php' (include_path='.:') in /var/www/vhosts/lond-moda.co.uk/httpdocs/includes/application_top.php on line 52

 

 

I tried the fix with the domxml-php4-to-php5.php but no luck... Please help..I really like this contribution

Share this post


Link to post
Share on other sites

I love the idea of this contribution but I can't seem to get it to work.

 

My store is a domain so I do not have the typical var/www/domain.com/catalog directory tree. As the root system it is var/www/domain.com

 

Per the instructions I:

 

Uploaded the mobile directory as is to the root of my site

Uploaded the .php files also into the root of my site.

 

So my tree is:

 

var/www/domain.com/mobile

var/www/domain.com/mobile_index.php

etc

etc

etc

 

I then added the line to my includes/application_top.php per the instructions.

 

After reading the forum, I do have:

SEO urls enabled from the admin configuaration area

 

 

The issues:

 

I am not being redirected on my iphone to mobile_index.php or mobile directory

 

If I navigate to the page http://www.shopsaveshipit.com/mobile_index.php, I see the new mobile format but when I click on a category, I am returned to the normal site.

 

What have I done wrong?

 

Thank you all on a great contribution and as far as I can see, nicely moderated by the authors and other experts!

 

I look forward to getting this working.

 

Thanks in advance!

Joshua

Edited by joshuag

Share this post


Link to post
Share on other sites

I'm looking for a contribution that will convert my site to iPhone friendly. Does this contribution do that or just address the Admin site?

Share this post


Link to post
Share on other sites

I'm looking for a contribution that will convert my site to iPhone friendly. Does this contribution do that or just address the Admin site?

Hi this is catalog side of osc

 

Steve

Share this post


Link to post
Share on other sites

Hi, I have installed the iosc_1_2_3 and it was working great, but i recently moved server to a PHP5 server and I reinstalled the contribution but is no longer working, I get a blank page. I made a .htaccess with php_flag display_errors On so I can see the errors, and they are:

 

Notice: Constant DIR_WS_HTTP_CATALOG already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 21

 

Notice: Constant DIR_WS_HTTPS_CATALOG already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 22

 

Notice: Constant DIR_WS_IMAGES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 23

 

Notice: Constant DIR_WS_INCLUDES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 26

 

Notice: Constant DIR_WS_TEMPLATES already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 34

 

Notice: Constant DIR_WS_CONTENT already defined in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/configure.php on line 35

 

Warning: require() [function.require]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) is not within the allowed path(s): (/var/www/vhosts/mydomain.co.uk/httpdocs:/tmp) in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Warning: require(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) [function.require]: failed to open stream: Operation not permitted in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Fatal error: require() [function.require]: Failed opening required '/var/www/vhosts/lond-moda.co.uk/httpdocs/../includes/database_tables.php' (include_path='.:') in /var/www/vhosts/lond-moda.co.uk/httpdocs/includes/application_top.php on line 52

 

 

I tried the fix with the domxml-php4-to-php5.php but no luck... Please help..I really like this contribution

 

Hi

 

these are the errors

Warning: require() [function.require]: open_basedir restriction in effect. File(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) is not within the allowed path(s): (/var/www/vhosts/mydomain.co.uk/httpdocs:/tmp) in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Warning: require(/var/www/vhosts/mydomain.co.uk/httpdocs/../includes/database_tables.php) [function.require]: failed to open stream: Operation not permitted in /var/www/vhosts/mydomain.co.uk/httpdocs/includes/application_top.php on line 52

 

Fatal error: require() [function.require]: Failed opening required '/var/www/vhosts/lond-moda.co.uk/httpdocs/../includes/database_tables.php' (include_path='.:') in /var/www/vhosts/lond-moda.co.uk/httpdocs/includes/application_top.php on line 52

 

make sure you can read on that directory var/www/vhosts/mydomain.co.uk/httpdocs/../includes/ also ask host why they cant be opened by php, they might have safe mode on to stop it

 

Steve

Share this post


Link to post
Share on other sites

I love the idea of this contribution but I can't seem to get it to work.

 

My store is a domain so I do not have the typical var/www/domain.com/catalog directory tree. As the root system it is var/www/domain.com

 

Per the instructions I:

 

Uploaded the mobile directory as is to the root of my site

Uploaded the .php files also into the root of my site.

 

So my tree is:

 

var/www/domain.com/mobile

var/www/domain.com/mobile_index.php

etc

etc

etc

 

I then added the line to my includes/application_top.php per the instructions.

 

After reading the forum, I do have:

SEO urls enabled from the admin configuaration area

 

 

The issues:

 

I am not being redirected on my iphone to mobile_index.php or mobile directory

 

If I navigate to the page http://www.shopsaveshipit.com/mobile_index.php, I see the new mobile format but when I click on a category, I am returned to the normal site.

 

What have I done wrong?

 

Thank you all on a great contribution and as far as I can see, nicely moderated by the authors and other experts!

 

I look forward to getting this working.

 

Thanks in advance!

Joshua

 

Hi Joshua,

 

in a few pages back, i posted how to solve that problem, so it wont goto main store, except you still have to type in mobile_index.php rest will work fine

 

Steve

Share this post


Link to post
Share on other sites

I FOUND THE HEADER IMAGE ONLY APPEARS WHEN I LOG IN WITH AN ACCOUNT, HTTPS://. CAN WE FIX THIS?

Hi

 

here is the code for the logo

<td id="headerLogo"><?php echo '<a href="' . tep_mobile_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME, 0,30) . '</a>'; ?></td>

 

it should pull it from catalog/images/ folder

 

Steve

Share this post


Link to post
Share on other sites

Great Contribution. I am having an issue viewing my products. I am able to view my categories but when i click on them the main product screen goes blank. I am able to see products if i search for them. I have been racking my brain with no luck. Please any ideas would be appreciated. http://www.arizonacowboy.net/oscommerce/mobile_index.php

Hi

 

its working for me ok using firefox as i dont have a mobile connected to wifi to use my phone

 

Steve

Share this post


Link to post
Share on other sites

Hi,

I have installed this Add-On but seem to be having an issue with links on the site.

 

I have added the changes that Steve has suggested Here.

 

Here is a link to the Mobile_index.php - My link

 

Once you reach the index page and you click on any category then it switches to the PC Site rather than the mobile site. Pls Help!!!

 

How can I get this issue resolved.

 

Thanks!

Share this post


Link to post
Share on other sites

Hi,

Forgot to mention my configure file is:

 

<?php
define('DIR_MOBILE_IMAGES', 'mobile/images/');
define('DIR_MOBILE_INCLUDES', 'mobile/includes/');
define('DIR_MOBILE_MODULES', DIR_MOBILE_INCLUDES . 'modules/');
define('DIR_MOBILE_CLASSES', DIR_MOBILE_INCLUDES . 'classes/');
define('DIR_MOBILE_HEADERS', DIR_MOBILE_INCLUDES . 'headers/');
define('DIR_MOBILE_LANGUAGES', DIR_MOBILE_INCLUDES . 'languages/');

define ('MOBILE_IMAGE_WIDTH', '80px');
define ('MOBILE_IMAGE_HEIGHT', '80px');

define ('FILENAME_DEFAULT', 'mobile_index.php');
define ('FILENAME_ADVANCED_SEARCH_RESULT', 'mobile_advanced_search_result.php');
define ('FILENAME_PRODUCTS', 'mobile_products.php');
define ('FILENAME_ABOUT', 'mobile_about.php');
define ('FILENAME_SEARCH', 'mobile_search.php');
define ('FILENAME_LANGUAGES', 'mobile_languages.php');
define ('FILENAME_LOGIN', 'mobile_login.php');
define ('FILENAME_MOBILE_LOGOFF', 'mobile_logoff.php');
define ('FILENAME_MOBILE_ACCOUNT', 'mobile_account.php');

define ('FILENAME_MOBILE_CONDITIONS', 'mobile_conditions.php');
define ('FILENAME_MOBILE_SHIPPING', 'mobile_shipping.php');
define ('FILENAME_MOBILE_PRIVACY', 'mobile_privacy.php');
define ('FILENAME_MOBILE_CONTACT_US', 'mobile_contact_us.php');

define('FILENAME_MOBILE_ACCOUNT_EDIT', 'mobile_account_edit.php');
define('FILENAME_MOBILE_ACCOUNT_HISTORY', 'mobile_account_history.php');
define('FILENAME_MOBILE_ACCOUNT_HISTORY_INFO', 'mobile_account_history_info.php');
define('FILENAME_MOBILE_ACCOUNT_NEWSLETTERS', 'mobile_account_newsletters.php');
define('FILENAME_MOBILE_ACCOUNT_NOTIFICATIONS', 'mobile_account_notifications.php');
define('FILENAME_MOBILE_ACCOUNT_PASSWORD', 'mobile_account_password.php');
define('FILENAME_MOBILE_ADDRESS_BOOK', 'mobile_address_book.php');

define('FILENAME_MOBILE_CHECKOUT_CONFIRMATION', 'mobile_checkout_confirmation.php');
define('FILENAME_MOBILE_CHECKOUT_PAYMENT', 'mobile_checkout_payment.php');
define('FILENAME_MOBILE_CHECKOUT_PAYMENT_ADDRESS', 'mobile_checkout_payment_address.php');
define('FILENAME_MOBILE_CHECKOUT_SHIPPING', 'mobile_checkout_shipping.php');
define('FILENAME_MOBILE_CHECKOUT_SHIPPING_ADDRESS', 'mobile_checkout_shipping_address.php');
define('FILENAME_MOBILE_CHECKOUT_SUCCESS', 'mobile_checkout_success.php');

define ('SEO_ENABLED', 'false');
define ('MOBILE_DEBUG', false);
define ('AJAX_ENABLED', false);
?>

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

×