Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


bumbarash

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! :-) )

Link to comment
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
Link to comment
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
Link to comment
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');

Link to comment
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

Link to comment
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.

Link to comment
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

Link to comment
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

Link to comment
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;
}

Link to comment
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.

Link to comment
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
Link to comment
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.

Link to comment
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.

 

;)

Link to comment
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.

Link to comment
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

Link to comment
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!

Link to comment
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!

Link to comment
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!

Link to comment
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

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