Jump to content
bumbarash

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

Recommended Posts

Hello!

I have a problem with this contib..

I installed it but i have always a blank

my main url is www.sitename/catalog

and my configure.php is :

<?php
define('DIR_MAIN_HTTP_CATALOG', '/');
define('DIR_WS_HTTP_CATALOG', '/catalog/mobile/');
/*define('DIR_WS_HTTPS_CATALOG', '/catalog/mobile/');*/
define('DIR_WS_IMAGES', '../images/');
define('DIR_WS_INCLUDES', '../includes/');

define('DIR_MOBILE_IMAGES', 'images/');
define('DIR_MOBILE_INCLUDES', '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', 'includes/languages/');

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

define ('FILENAME_MOBILE', 'mobile.php');
define ('FILENAME_PRODUCTS', 'products.php');
define ('FILENAME_ABOUT', 'about.php');
define ('FILENAME_SEARCH', 'search.php');
define ('FILENAME_LANGUAGES', 'languages.php');

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

 

anyone can help me please!!

(soory for my poor english! :-) )

Share this post


Link to post
Share on other sites

Hey all

 

I've installed my mobile site correctly, though I the start page (Store) is empty. Why is this? The search page, language and account page do seem to work normal..

 

Btw,

 

I've also put ini_set('display_errors', 1); on in index.php, but no errors dissappear.

Edited by Tranquility

Share this post


Link to post
Share on other sites

On my main store i use Paypal IPN as a payment method, is there anyway to block this from being used on the mobile site, like googlecheckout currently is using

 

for($i=0, $n=sizeof($selection); $i<$n; $i++) {
if($selection[$i]['id'] == 'googlecheckout') {
  array_splice($selection, $i, 1);	
  break;   
}}

 

I have tried all sort of method replacing the googlecheckout above with

 

paypal, ipn, paypal_ipn and neither of them work.

Edited by Jonojamesmac

Share this post


Link to post
Share on other sites
I installed it but i have always a blank

my main url is www.sitename/catalog

 

Try to change your mobile/includes/configuration.php

define('DIR_MAIN_HTTP_CATALOG', '/catalog/');

Share this post


Link to post
Share on other sites
I've installed my mobile site correctly, though I the start page (Store) is empty. Why is this? The search page, language and account page do seem to work normal..

Try to turn off AJAX and let me know if it helps.

Comment out line 52 in mobile/index.php

//include(DIR_MOBILE_CLASSES . 'categories_js.php');

Share this post


Link to post
Share on other sites
paypal, ipn, paypal_ipn and neither of them work.

Currently it should be working with default OSC modules (CC, Authorize, Cash) and Paypal Express.

I just don't have time right now to make it work with all possible billing systems.

 

I will try different approach to mix regular and mobile files in same directory, but it could take awhile

Share this post


Link to post
Share on other sites

Yep i understand that however, because my shop has Nochex, Googlecheckout, Paypal IPN and Cheque as its payment methods, i'd like to turn Paypal IPN off on the mobile site because as you say, they do not work yet.

 

What i'm asking is if there is any method of turning them off on the mobile site only.

Share this post


Link to post
Share on other sites
Try to turn off AJAX and let me know if it helps.

Comment out line 52 in mobile/index.php

//include(DIR_MOBILE_CLASSES . 'categories_js.php');

Although it was a different line (i think 36), this worked like a charm! Thanks :lol:

Share this post


Link to post
Share on other sites

I cannot get the company logo image to show up.

 

our logo was copied to

www.mydomain.com/images/

and

www.mydomain.com/mobile/images/

 

the following files were modified

 

www.mydomain.com/mobile/includes/header.php

and

www.mydomain.com/mobile/includes/iheader.php

 

the default image was changed to ourlogo.jpg in place of what you had there but it still does not show


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
What i'm asking is if there is any method of turning them off on the mobile site only.

 

You could try this :

in mobile/checkout_payment.php

right after

$payment_modules = new payment;

insert this

 

  for($i = 0, $n < sizeof($payment_modules->modules); $i < $n; $i++){
if($payment_modules->modules[$i] == "googlecheckout.php") 
	unset($payment_modules->modules[$i]);
 }

 

change "googlecheckout.php" to the name of the module you want to remove.

Name of the module you could find on your backend , when you select this module, query string in your URL will be

......&module=module_name

Share this post


Link to post
Share on other sites
I cannot get the company logo image to show up.

 

I hide it because it's taking too much "real estate". Mobile screen is small and every pixel counts.

Go to mobile/includes/iphone.css and remove this

table.logo{
display: none;
}

Share this post


Link to post
Share on other sites

Hi bumbarash, thank you, it's working, I can navigate thru the categories, but when I click on a product to see its description I get:

 

1054 - Unknown column 'popt.language_id' in 'where clause'

 

select count(*) as total from products_options popt, products_attributes patrib where patrib.products_id='211' and patrib.options_id = popt.products_options_id and popt.language_id = '2'

 

[TEP STOP]

 

The site is in Spanish. Any ideas? I wonder if the tables are the same in OSC and CREloaded.

Share this post


Link to post
Share on other sites

I installed the iosc 1.3 . I am getting the following error message

 

Fatal error: Call to a member function add_current_page() on a non-object in /home/comebarg/public_html/includes/application_top.php on line 312

Share this post


Link to post
Share on other sites

Hi,

I have a shop running with STS installed and i get this error at the heading of the page.

 

Template file does not exist: [includes/sts_templates/full/sts_template.html]

 

and also on the main page it does not display the shop categories and products though other links seem to work well.. Please HELP.

 

Guru

 

disabling ajax helped but i am still geting this error on all pages headers

Template file does not exist: [includes/sts_templates/full/sts_template.html]

 

and this error on MYACCOUNT page

 

Warning: Cannot modify header information - headers already sent by (output started at /home/nilamk/public_html/bulkgain.com/shop/includes/classes/sts.php:156) in /home/nilamk/public_html/bulkgain.com/shop/includes/functions/general.php on line 33

Edited by cyberguru

Share this post


Link to post
Share on other sites
Is there anyway you could include "upgrade instructions" to the package ? I have added so many addons to your wonderful iOSC contribution that I do not want to start from "scratch" again.

Any separate instructions on how to add your Ajax support for categories would be greatly appreciated.

To upgrade from v1.2

To add AJAX support for categories:

1. Starting those lines

[code]
require(DIR_MOBILE_INCLUDES . 'header.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

till the end of the file replace with

require(DIR_MOBILE_INCLUDES . 'header.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

include(DIR_MOBILE_CLASSES . 'categories_js.php');

$headerTitle->write($headerTitleText);
?>
<!-- categories //-->
<div id="iphone_content_body">
<div id="iphone_content" style="position: absolute; width: 100%">
<table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
<?php
foreach ($list as $item ) {
	$path = tep_mobile_link(FILENAME_DEFAULT, 'cPath=' . $item['categories_id']);
	$img = strlen($item['categories_image']) > 0 ? tep_image(DIR_WS_IMAGES . $item['categories_image'], $item['categories_name'], 30,30) : ' ';
	print tep_mobile_selection($path, array($img, $item['categories_name']));

}
?>
</table>
</div>
</div>
<!-- categories_eof //-->

 

2. Copy categories_js.php from v1.3 zip file to your mobile/include/classes

 

This is beta functionality and some people reported it's not working off-the-shelf.

Share this post


Link to post
Share on other sites
Template file does not exist: [includes/sts_templates/full/sts_template.html]

 

Try to copy includes/sts_templates to mobile/includes

Share this post


Link to post
Share on other sites
Fatal error: Call to a member function add_current_page() on a non-object in /home/comebarg/public_html/includes/application_top.php on line 312

please follow this thread

Share this post


Link to post
Share on other sites

Cool Contrib, Everything works.

I have SEO URLs installed and I made the automatic redirect for mobile devices work by replacing in mobile/includes/classes/ mobile_redirect.php

 

find the last function:

 

function redirect() {

$path = split("/" , $_SERVER['SCRIPT_NAME']);

$filename = $path[sizeof($path)-1];

$file = $this->mobileDir . $filename;

$qstring = $_SERVER['QUERY_STRING'];

$SSL = ($_SERVER['HTTPS']) ? "SSL" : "NONSSL";

tep_redirect(tep_href_link($file, $qstring, $SSL, false, false));

}

 

replace with:

 

function redirect() {

Header("Location: http://www.yoursite.com/mobile/");

exit();

}

 

 

 

That worked for me. Some minor adjustments for google analytics and language files were necceccary.

Plz let me know if this worked for You.

 

;)

Share this post


Link to post
Share on other sites
To upgrade from v1.2

To add AJAX support for categories:

1. Starting those lines

[code]
require(DIR_MOBILE_INCLUDES . 'header.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

till the end of the file replace with

require(DIR_MOBILE_INCLUDES . 'header.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

include(DIR_MOBILE_CLASSES . 'categories_js.php');

$headerTitle->write($headerTitleText);
?>
<!-- categories //-->
<div id="iphone_content_body">
<div id="iphone_content" style="position: absolute; width: 100%">
<table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
<?php
foreach ($list as $item ) {
	$path = tep_mobile_link(FILENAME_DEFAULT, 'cPath=' . $item['categories_id']);
	$img = strlen($item['categories_image']) > 0 ? tep_image(DIR_WS_IMAGES . $item['categories_image'], $item['categories_name'], 30,30) : ' ';
	print tep_mobile_selection($path, array($img, $item['categories_name']));

}
?>
</table>
</div>
</div>
<!-- categories_eof //-->

 

2. Copy categories_js.php from v1.3 zip file to your mobile/include/classes

 

This is beta functionality and some people reported it's not working off-the-shelf.

 

Hello,

 

I've the version 1.2 already installed and working fine for me as well. Just to get the checkout continue after confirmation order checkout, Could you please just indicate what code to add and change to get the payment done via paypal express and standard?

Thanks very much for your help.

 

Regards.

Share this post


Link to post
Share on other sites
function redirect() {

Header("Location: http://www.yoursite.com/mobile/");

exit();

}

Hi

Original redirect() function suppose to redirect you to corresponding mobile page.

For example:

http://www.site.com/My-Great-Product => http://www.site.com/mobile/products.php?id=1234

or

https://www.site.com/account.php => https://www.site.com/mobile/account.php

 

Let me know why it didn't work for you

Thanks

Share this post


Link to post
Share on other sites

Anybody successfully installed the MOD with imagemagic running on the main site?

I tried to install IM on the mobile directory but no luck.

 

so I would like to know either:

 

- install IM in the mobile directory

- pervent the mobile directory to use IM from the main catalog

 

Thanks!

Share this post


Link to post
Share on other sites

Installed the latest version, and my ajax categories are not working (no iphone sliding effect)

 

the changes I had to make: change all references to a directory called "newimages" instead of images (this is where all my initial osc images are). Of courdse I renamed the mobile directory newimages

 

create a tep_mobile_image function (which is the default Osc one, while I'm working on implementing imagemagic for mobile)

 

besides that, everything works pretty smoothly

 

Thanks for your help!

Share this post


Link to post
Share on other sites
Installed the latest version, and my ajax categories are not working (no iphone sliding effect)

 

the changes I had to make: change all references to a directory called "newimages" instead of images (this is where all my initial osc images are). Of courdse I renamed the mobile directory newimages

 

create a tep_mobile_image function (which is the default Osc one, while I'm working on implementing imagemagic for mobile)

 

besides that, everything works pretty smoothly

 

Thanks for your help!

 

bumbarash, could you please do me a favor and to change a couple of your demo store ROOT category name so one has a space in it and another one an apostrophe so I can see if this is an XML not properly escaped issue.

 

Thanks!

Share this post


Link to post
Share on other sites
bumbarash, could you please do me a favor and to change a couple of your demo store ROOT category name so one has a space in it and another one an apostrophe so I can see if this is an XML not properly escaped issue.

 

Thanks!

 

After doing some tests, it effectively appears that parent categories which names contain spaces prevent the ajax to work properly

 

the fix is:

 

in mobile/includes/classes/categories_js.php

 

find:

 

$cat->set_attribute("name", $categories['categories_name']);

 

replace by:

 

$cat->set_attribute("name", addslashes($categories['categories_name']));

 

feel free to upload an updated version

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

×