Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


bumbarash

Recommended Posts

Raiwa,

Just starting updating 5.1rev3 to 5.3 on 2.2rc2a

 

/catalog//mobile_create_account.php

The resulting code using manual instructions differs from the actual file compare... Could you clarify which is correct please.

-Dave

Link to comment
Share on other sites

Hi....

 

Thanks for the great contribution.....

 

I have an issue with the mobile_checkout_shipping.php. When I enable free shipping $75 through admin. I cannot pass the mobile_checkout_shipping.php screen... When I click continue, it brings me back to mobile_checkout_shipping.php and cannot move forward. When I remove the free shipping $75 thru admin. Everything works really well.

 

Please assist...

 

Kee

 

 

Hello,

 

I just checked this on my test stores with the shipping module called "freeamount" and it works.

Please send me your shipping module and your mobile_checkout files to: [email protected] and I will search for the fault.

 

regards

Rainer

Link to comment
Share on other sites

Raiwa,

Just starting updating 5.1rev3 to 5.3 on 2.2rc2a

 

/catalog//mobile_create_account.php

The resulting code using manual instructions differs from the actual file compare... Could you clarify which is correct please.

 

Hello,

 

I just checked and both versions work correct.

Allthough the version with the "<?php echo tep_draw_form('create_account',..........." line just below the <div id="iphone_content"> tag seems more correct to me.

 

Thanks for the report, this will be corrected in the next update.

 

regards and a happy new year

rainer

Link to comment
Share on other sites

Hello,

 

I just checked this on my test stores with the shipping module called "freeamount" and it works.

Please send me your shipping module and your mobile_checkout files to: [email protected] and I will search for the fault.

 

regards

Rainer

 

 

My appologies,,, I should be more specific.. The module is Total Order and comes with oscommerce 2.3.3...

 

Happy New Year...

Thanks..

Link to comment
Share on other sites

My appologies,,, I should be more specific.. The module is Total Order and comes with oscommerce 2.3.3...

 

Happy New Year...

Thanks..

 

Hello again,

 

I'm confused now.

 

I downloaded again the last version of OSC 2.3.3. and there are 5 shipping modules included:

 

flat.php => Flat Rate

item.php => Per Item

table.php => Table Rate

usps.php => United States Postal Service

zones.php => Zone Rates

 

None of them can be used for free shipping.

 

Please post the exact name of the file and the code or send me by e-mail, otherwise I can't help.

 

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hello again,

 

I'm confused now.

 

I downloaded again the last version of OSC 2.3.3. and there are 5 shipping modules included:

 

flat.php => Flat Rate

item.php => Per Item

table.php => Table Rate

usps.php => United States Postal Service

zones.php => Zone Rates

 

None of them can be used for free shipping.

 

Please post the exact name of the file and the code or send me by e-mail, otherwise I can't help.

 

Rainer

 

 

Hi.. Rainer

 

Thanks for the quick reply...

 

I might be wrong.. The module I was referring to is under the module Total Order....

 

There is a Shipping section that allows me to set $ amount to include free shipping..

 

Thanks again for your help..

Link to comment
Share on other sites

just fyi, in 5.1rev3 to 5.3 upgrade instructions

 

12. catalog/includes/iphone.css

should be

12. catalog/mobile/includes/iphone.css

 

same for

12. In: catalog/includes/iphone.css

should be

12. In: catalog/mobile/includes/iphone.css

-Dave

Link to comment
Share on other sites

Hello again,

 

I'm confused now.

 

I downloaded again the last version of OSC 2.3.3. and there are 5 shipping modules included:

 

flat.php => Flat Rate

item.php => Per Item

table.php => Table Rate

usps.php => United States Postal Service

zones.php => Zone Rates

 

None of them can be used for free shipping.

 

Please post the exact name of the file and the code or send me by e-mail, otherwise I can't help.

 

Rainer

 

 

I think this module comes with oscommerce 2.3.3.. but I might be wrong..

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

class ot_shipping {

var $title, $output;

 

function ot_shipping() {

$this->code = 'ot_shipping';

$this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;

$this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;

$this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false);

$this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;

 

$this->output = array();

}

 

function process() {

global $order, $currencies;

 

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {

switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

case 'national':

if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;

case 'international':

if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;

case 'both':

$pass = true; break;

default:

$pass = false; break;

}

 

if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$order->info['shipping_method'] = FREE_SHIPPING_TITLE;

$order->info['total'] -= $order->info['shipping_cost'];

$order->info['shipping_cost'] = 0;

}

}

 

$module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));

 

if (tep_not_null($order->info['shipping_method'])) {

if ($GLOBALS[$module]->tax_class > 0) {

$shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

$shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

 

$order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

 

if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

}

 

$this->output[] = array('title' => $order->info['shipping_method'] . ':',

'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),

'value' => $order->info['shipping_cost']);

}

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

 

return $this->_check;

}

 

function keys() {

return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

}

?>

Link to comment
Share on other sites

Raiwa,

This just might be me, or my version of dreamweaver, but when I look at mobile_shopping_cart.php, the line

<div id="iphone_content">

and the closing </div> are flagged as overlapping or unclosed tag, which doesnt make sense.

 

is it dreamweaver being stupid, or is something not right?

-Dave

Link to comment
Share on other sites

I think this module comes with oscommerce 2.3.3.. but I might be wrong..

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

class ot_shipping {

var $title, $output;

 

function ot_shipping() {

$this->code = 'ot_shipping';

$this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;

$this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;

$this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false);

$this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;

 

$this->output = array();

}

 

function process() {

global $order, $currencies;

 

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {

switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

case 'national':

if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;

case 'international':

if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;

case 'both':

$pass = true; break;

default:

$pass = false; break;

}

 

if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$order->info['shipping_method'] = FREE_SHIPPING_TITLE;

$order->info['total'] -= $order->info['shipping_cost'];

$order->info['shipping_cost'] = 0;

}

}

 

$module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));

 

if (tep_not_null($order->info['shipping_method'])) {

if ($GLOBALS[$module]->tax_class > 0) {

$shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

$shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

 

$order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

 

if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

}

 

$this->output[] = array('title' => $order->info['shipping_method'] . ':',

'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),

'value' => $order->info['shipping_cost']);

}

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

 

return $this->_check;

}

 

function keys() {

return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

}

?>

 

Hello,

 

What you posted is the code of the order total module for shipping costs, not the shipping module.

 

Please open the folder: catalog/includes/modules/shipping/

 

and find the module you use for the free shipping.

 

If you don't know which one, post me the list of all files which you find there I'll try to find out which one.

Then post the code of this file, or please send me by e-mail all your shipping modules attached, it would be the fastest and easiest way.

Don't worry I will nor use your e-mail address for other purposes.

 

regards

Rainer

Link to comment
Share on other sites

I think this module comes with oscommerce 2.3.3.. but I might be wrong..

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2007 osCommerce

 

Released under the GNU General Public License

*/

 

class ot_shipping {

var $title, $output;

 

function ot_shipping() {

$this->code = 'ot_shipping';

$this->title = MODULE_ORDER_TOTAL_SHIPPING_TITLE;

$this->description = MODULE_ORDER_TOTAL_SHIPPING_DESCRIPTION;

$this->enabled = ((MODULE_ORDER_TOTAL_SHIPPING_STATUS == 'true') ? true : false);

$this->sort_order = MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER;

 

$this->output = array();

}

 

function process() {

global $order, $currencies;

 

if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') {

switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {

case 'national':

if ($order->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;

case 'international':

if ($order->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;

case 'both':

$pass = true; break;

default:

$pass = false; break;

}

 

if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$order->info['shipping_method'] = FREE_SHIPPING_TITLE;

$order->info['total'] -= $order->info['shipping_cost'];

$order->info['shipping_cost'] = 0;

}

}

 

$module = substr($GLOBALS['shipping']['id'], 0, strpos($GLOBALS['shipping']['id'], '_'));

 

if (tep_not_null($order->info['shipping_method'])) {

if ($GLOBALS[$module]->tax_class > 0) {

$shipping_tax = tep_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

$shipping_tax_description = tep_get_tax_description($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

 

$order->info['tax'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['tax_groups']["$shipping_tax_description"] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

$order->info['total'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

 

if (DISPLAY_PRICE_WITH_TAX == 'true') $order->info['shipping_cost'] += tep_calculate_tax($order->info['shipping_cost'], $shipping_tax);

}

 

$this->output[] = array('title' => $order->info['shipping_method'] . ':',

'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),

'value' => $order->info['shipping_cost']);

}

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_SHIPPING_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

 

return $this->_check;

}

 

function keys() {

return array('MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION');

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_STATUS', 'true', 'Do you want to display the order shipping cost?', '6', '1','tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_SHIPPING_SORT_ORDER', '2', 'Sort order of display.', '6', '2', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Allow Free Shipping', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING', 'false', 'Do you want to allow free shipping?', '6', '3', 'tep_cfg_select_option(array(\'true\', \'false\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, date_added) values ('Free Shipping For Orders Over', 'MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER', '50', 'Provide free shipping for orders over the set amount.', '6', '4', 'currencies->format', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Provide Free Shipping For Orders Made', 'MODULE_ORDER_TOTAL_SHIPPING_DESTINATION', 'national', 'Provide free shipping for orders sent to the set destination.', '6', '5', 'tep_cfg_select_option(array(\'national\', \'international\', \'both\'), ', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

}

?>

 

Hello,

 

forget the last post, yes it is the order total module, I didn't realize until now that it is possible to define free shipping there too.

 

i'll check this as soon as possible.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Thanks again...

 

Hello,

 

I just checked the free shipping option in the order total module and found that it works in my test shops, both versions osc 2.2rc2a and 2.3.3.

The only issue I found is that the layout is not too good but it is functional I can go ahead to checkout confirmation without any problem.

 

So I'm sorry but in order to see what happens in your store I need your files.

 

Please send or post your mobile_checkout_shipping.php and mobile_checkout_payment.php files.

 

regards

Rainer

Edited by raiwa
Link to comment
Share on other sites

Raiwa, after completing the entire 5.3 update

 

catalog/mobile_checkout_payment.php

and

catalog/mobile_checkout_shipping.php

 

are broken for me.

The ship page gets the quotes but the layout is a jumbled mess of overlapping fields

The payment page is very broken, displaying trailings of php code and a mess

 

I've reverted these two files to the previous version and all is ok for now.

-Dave

Link to comment
Share on other sites

Raiwa, after completing the entire 5.3 update

 

catalog/mobile_checkout_payment.php

and

catalog/mobile_checkout_shipping.php

 

are broken for me.

The ship page gets the quotes but the layout is a jumbled mess of overlapping fields

The payment page is very broken, displaying trailings of php code and a mess

 

I've reverted these two files to the previous version and all is ok for now.

 

Hi....

 

I reverted back to the earlier files and it works.. Thanks again for the great contribution... How can I add the 2 buttons to catalog/mobile_checkout_payment.php and catalog/mobile_checkout_shipping.php page.

 

Thanks..

Link to comment
Share on other sites

Hi....

 

I reverted back to the earlier files and it works.. Thanks again for the great contribution... How can I add the 2 buttons to catalog/mobile_checkout_payment.php and catalog/mobile_checkout_shipping.php page.

 

Thanks..

 

Hello,

 

If you mean the "back" and "continue" button at the bottom, there are instructions for this mod included in the support package:

http://addons.oscommerce.com/info/8578

 

download the version: Contribution support V. 1.4 for iOSC 5.x

 

in the last version it removed.

 

It's called: Back buttons in checkout

 

For the problems with mobile_checkout_shipping.php and mobile_checkout payment.php:

 

I found that the problems are with Internet Explorer and/or when the module title is more than 1 line long.

I'll try to resolve this the next days and upload an update with this fixes and fixes for the other bugs discovered by roaddoctor and other users.

The changes there are very heavy and it's difficult to test all possible combinations. Sorry for the inconvenient.

In any case it dosn`t explain the dificulties for the free shipping option, in my test shops it works.

So I really would apreciate if you could send or post your files to find out what happens and if there is a bug which doesn't appear in my installations.

 

All other files of version 5.3 should work independent of the checkout files.

 

regards

Rainer

Link to comment
Share on other sites

Raiwa, after completing the entire 5.3 update

 

catalog/mobile_checkout_payment.php

and

catalog/mobile_checkout_shipping.php

 

are broken for me.

The ship page gets the quotes but the layout is a jumbled mess of overlapping fields

The payment page is very broken, displaying trailings of php code and a mess

 

I've reverted these two files to the previous version and all is ok for now.

 

 

Hello,

 

for the shipping page I know the problems for IE and when there are module titles more than one line long.

For the payment page it sounds strange to me.

Did you try for testing purpose to use the included mobile_checkout_payment.php file instead to update your file with the update instructions?

 

regards

Rainer

Link to comment
Share on other sites

Hello,

 

for the shipping page I know the problems for IE and when there are module titles more than one line long.

For the payment page it sounds strange to me.

Did you try for testing purpose to use the included mobile_checkout_payment.php file instead to update your file with the update instructions?

 

regards

Rainer

 

Definitely no need to apologize - your efforts are appreciated and thats why its called development :) I've been testing using chrome, firefox and

IE.

 

Yes - on the shipping page , just needs a line break or some space between each ship type... otherwise it seemed ok.

 

On the payment page, when you have a moment, I can put back your file (unmodified) so that you can see the result... Yes I tested with your untouched file and with the updated/modified for my use version. Neither way was good. i sent you a message with my email.

 

Thanks!

-Dave

Link to comment
Share on other sites

Hello,

 

There is a bug in mobile_contact_us.

 

Part a is for OSC 2.3.

Part b is for OSC 2.2rc2a and OSC 2.3

 

Here the correction:

 

1. In: catalog/mobile_contact_us.php

 

a. ***FIND (this arranges the non working of the form):

 

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {

 

***REPLACE WITH:

 

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {

 

b. ***FIND (this arranges the success message and continue button):

 

<!--  ajax_part_begining -->
<?php echo tep_draw_form('contact_us', tep_mobile_link(FILENAME_MOBILE_CONTACT_US, 'action=send')); ?>
<div id="messageStack">
<?php
 if ($messageStack->size('contact') > 0) {
?>
    <?php echo $messageStack->output('contact'); ?>
<?php
 }
?>
</div>
<div id="contactForm">
<?php
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
  <?php echo '<a href="' . tep_mobile_link(FILENAME_DEFAULT) . '">' . tep_mobile_button(IMAGE_BUTTON_CONTINUE) . '</a>'; ?>
<?php
 } else {
?>
  <label for="name" class="float"><?php echo ENTRY_NAME; ?></label>

 

***REPLACE WITH:

 

<!--  ajax_part_begining -->
<div id="messageStack">
<?php
 if ($messageStack->size('contact') > 0) {
?>
    <?php echo $messageStack->output('contact'); ?>
<?php
 }
?>
</div>
<div id="contactForm">
<?php
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) { ?>
 <?php echo TEXT_SUCCESS; ?>
 <?php echo '<a href="' . tep_mobile_link(FILENAME_DEFAULT) . '">' . tep_mobile_button(IMAGE_BUTTON_CONTINUE) . '</a>';
 } else {
 echo tep_draw_form('contact_us', tep_mobile_link(FILENAME_MOBILE_CONTACT_US, 'action=send')); ?>
 <label for="name" class="float"><?php echo ENTRY_NAME; ?></label>

 

I'll include this fix in the next update.

 

Thanks

Rainer

Link to comment
Share on other sites

Hello,

 

If you mean the "back" and "continue" button at the bottom, there are instructions for this mod included in the support package:

http://addons.oscommerce.com/info/8578

 

download the version: Contribution support V. 1.4 for iOSC 5.x

 

in the last version it removed.

 

It's called: Back buttons in checkout

 

For the problems with mobile_checkout_shipping.php and mobile_checkout payment.php:

 

I found that the problems are with Internet Explorer and/or when the module title is more than 1 line long.

I'll try to resolve this the next days and upload an update with this fixes and fixes for the other bugs discovered by roaddoctor and other users.

The changes there are very heavy and it's difficult to test all possible combinations. Sorry for the inconvenient.

In any case it dosn`t explain the dificulties for the free shipping option, in my test shops it works.

So I really would apreciate if you could send or post your files to find out what happens and if there is a bug which doesn't appear in my installations.

 

All other files of version 5.3 should work independent of the checkout files.

 

regards

Rainer

Hi Rainer

 

I reverted the changes back to iOSC3_5.3_for_oscommerce-2.2rc2a so you can look at it.. I email you more details of my site.

 

Thanks again..

Link to comment
Share on other sites

On the subject of payment page -- I am battling this one now.

There is a problem as I see it.

If payment method has multiple fields, those are not displayed correctly. In fact, each field in "$selection" is treated as a "sub-payment" method. I may be wrong, but those fields are normally just additional fields like input field for credit card number. They should be displayed "as is", not an attempt to make each one a radio button. I fixed this one for site I am working on and can supply changes if anyone is interested.

 

On the subject of payment, is there a support for CCGV add-on? (Discount coupons and gift vouchers module)

 

Thanks,

Rudolf

Link to comment
Share on other sites

On the subject of payment page -- I am battling this one now.

There is a problem as I see it.

If payment method has multiple fields, those are not displayed correctly. In fact, each field in "$selection" is treated as a "sub-payment" method. I may be wrong, but those fields are normally just additional fields like input field for credit card number. They should be displayed "as is", not an attempt to make each one a radio button. I fixed this one for site I am working on and can supply changes if anyone is interested.

 

On the subject of payment, is there a support for CCGV add-on? (Discount coupons and gift vouchers module)

 

Thanks,

Rudolf

 

Hello Rudolf,

 

Yes the mobile_checkout_shipping and payment of iosc 5.3 are not correct working.

I corrected this and post the new code here.

The new files will be uploaded as soon as I finished the update files.

 

For OSCommerce 2.2.:

 

mobile_checkout_shipping.php

<?php
require_once('mobile/includes/application_top.php');
require(DIR_WS_CLASSES.'http_client.php');
// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_mobile_link(FILENAME_LOGIN, '', 'SSL'));
 }
// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
 }
// if no shipping destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('sendto')) {
   tep_session_register('sendto');
   $sendto = $customer_default_address_id;
 } else {
// verify the selected shipping address
   if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) {
  $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
  $check_address = tep_db_fetch_array($check_address_query);
  if ($check_address['total'] != '1') {
    $sendto = $customer_default_address_id;
    if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
  }
   }
 }
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
 if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
 $cartID = $cart->cartID;
// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
 if ($order->content_type == 'virtual') {
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   $shipping = false;
   $sendto = false;
   tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
// load all enabled shipping modules
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping;
 if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
   $pass = false;
   switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
  case 'national':
    if ($order->delivery['country_id'] == STORE_COUNTRY) {
	  $pass = true;
    }
    break;
  case 'international':
    if ($order->delivery['country_id'] != STORE_COUNTRY) {
	  $pass = true;
    }
    break;
  case 'both':
    $pass = true;
    break;
   }
   $free_shipping = false;
   if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
  $free_shipping = true;
  include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
   }
 } else {
   $free_shipping = false;
 }
 // process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
  $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
  if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
    $shipping = $HTTP_POST_VARS['shipping'];
    list($module, $method) = explode('_', $shipping);
    if ( is_object($$module) || ($shipping == 'free_free') ) {
	  if ($shipping == 'free_free') {
	    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
	    $quote[0]['methods'][0]['cost'] = '0';
	  } else {
	    $quote = $shipping_modules->quote($method, $module);
	  }
	  if (isset($quote['error'])) {
	    tep_session_unregister('shipping');
	  } else {
	    if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
		  $shipping = array('id' => $shipping,
						    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
						    'cost' => $quote[0]['methods'][0]['cost']);
		  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
	    }
	  }
    } else {
	  tep_session_unregister('shipping');
    }
  }
   } else {
  $shipping = false;

  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }   
 }
// get all available shipping quotes
 $quotes = $shipping_modules->quote();
// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
 if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();
 require(DIR_WS_LANGUAGES . $language . '/checkout_shipping.php');
 $breadcrumb->add(NAVBAR_TITLE_1, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
require(DIR_MOBILE_INCLUDES . 'header.php');
$headerTitle->write();
?>
<script type="text/javascript"><!--
var selected;
function selectRowEffect(object, buttonselect) {
 if (!selected) {
   if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
   } else {
  selected = document.all['defaultSelected'];
   }
 }
 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;
// one button is not an array
 if (document.checkout_address.shipping[0]) {
   document.checkout_address.shipping[buttonselect].checked=true;
 } else {
   document.checkout_address.shipping.checked=true;
 }
}
function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>
<div id="iphone_content">
<?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>
<div id="checkout_shipping">
<?php
 if (tep_count_shipping_modules() > 0) {
?>
 <h1><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></h1>
</br>
<?php
   if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1 && $free_shipping == false) {
?>
 <div id="ship_add">
   <?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?>
<?php
   } elseif ($free_shipping == false) {
?>
 <div id="ship_add">
   <?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?>
<?php
   }
   if ($free_shipping == true) {
?>
 <div id="ship_add">
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td><strong><?php echo FREE_SHIPPING_TITLE; ?></strong></br> <?php echo $quotes[$i]['icon']; ?></td>
  </tr>
  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
    <td style="padding-left: 15px; padding-top: 12px; padding-bottom: 12px;"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
  </tr>
   </div>
<?php
   } else {
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <?php
  $radio_buttons = 0;
  for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
?>
</br>
  <tr>
    <td colspan="3"><strong><?php echo $quotes[$i]['module']; ?></strong> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
  </tr>
<?php
    if (isset($quotes[$i]['error'])) {
?>
  <tr>
    <td colspan="3"><?php echo $quotes[$i]['error']; ?></td>
  </tr>
<?php
    } else {
	  for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
	    $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
	    if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
		  echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
	    } else {
		  echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
	    }
?>
    <td style="padding-left: 10px;"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
    <td width="89%" style="padding-top: 13px; padding-bottom: 11px;"> <?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
<?php
	    if ( ($n > 1) || ($n2 > 1) ) {
?>
    <td><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
<?php
	    } else {
?>
    <td align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
<?php
	    }
?>
  </tr>
<?php
	    $radio_buttons++;
	  }
    }
  }
   }
?>
   </table>
 </div>
<?php
 }
?>
 <hr />
  <h1><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></h1>
  <div id="ship_add">
  <?php echo tep_address_label($customer_id, $sendto, true, ' ', '</br>'); ?>
 <table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
  <?php echo tep_mobile_selection(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS), array(IMAGE_BUTTON_CHANGE_ADDRESS)).'<div class="fleche" style="position:relative; top:3px;"><img src="' . DIR_MOBILE_IMAGES . 'arrow_select.png" /></div>'; ?>
 </table>
 </div>
<?php echo tep_draw_form('checkout_address', tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>
<hr />
  <h1><?php echo TABLE_HEADING_COMMENTS; ?></h1>
  <div id="ship_add">
  <?php echo tep_draw_textarea_field('comments', 'soft', '40', '6'); ?>
  </div>
  <div id="bouton" style="height:24px;">
  <?php echo '<span style="float:right;"><input type="submit" value="' . IMAGE_BUTTON_CONTINUE . '"></form></span>' .
	 '<span style="float:left;">' . tep_draw_form('back', tep_mobile_link(FILENAME_SHOPPING_CART, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_BACK) . '</form></span>'; ?> 
  </div>
</div>
<?php require(DIR_MOBILE_INCLUDES . 'footer.php'); ?>
</div>

 

mobile_checkout_payment.php

<?php
require_once('mobile/includes/application_top.php');
// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_mobile_link(FILENAME_LOGIN, '', 'SSL'));
 }
// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
 }
// if no shipping method has been selected, redirect the customer to the shipping method selection page
 if (!tep_session_is_registered('shipping')) {
   tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 }
// avoid hack attempts during the checkout procedure by checking the internal cartID
 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
   if ($cart->cartID != $cartID) {
  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
   }
 }
// Stock Check
 if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
    tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
    break;
  }
   }
 }
// if no billing destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('billto')) {
   tep_session_register('billto');
   $billto = $customer_default_address_id;
 } else {
// verify the selected billing address
   if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) {
  $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
  $check_address = tep_db_fetch_array($check_address_query);
  if ($check_address['total'] != '1') {
    $billto = $customer_default_address_id;
    if (tep_session_is_registered('payment')) tep_session_unregister('payment');
  }
   }
 }
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
 if (!tep_session_is_registered('comments')) tep_session_register('comments');
 if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
   $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
 }
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
// load all enabled payment modules
 require(DIR_MOBILE_CLASSES . 'payment.php');
 $payment_modules = new payment;
 require(DIR_WS_LANGUAGES . $language . '/checkout_payment.php');
 $breadcrumb->add(NAVBAR_TITLE_1, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
require(DIR_MOBILE_INCLUDES . 'header.php');
$headerTitle->write();
?>
<script type="text/javascript"><!--
var selected;
function selectRowEffect(object, buttonselect) {
 if (!selected) {
   if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
   } else {
  selected = document.all['defaultSelected'];
   }
 }
 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;
// one button is not an array
 if (document.checkout_payment.payment[0]) {
   document.checkout_payment.payment[buttonselect].checked=true;
 } else {
   document.checkout_payment.payment.checked=true;
 }
}
function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>
<?php echo $payment_modules->javascript_validation(); ?>
<div id="iphone_content">
<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); ?>
<div id="checkout_payment">
<?php
 if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
<div id="messageStack">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>
<?php
 }
?>
<h1><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></h1>
</br>
<?php
 $selection = $payment_modules->selection();
 if (sizeof($selection) > 1) {
?>
 <div id="bill_add">
   <?php echo TEXT_SELECT_PAYMENT_METHOD; ?>
 </br>
 </br>
<?php
   } elseif ($free_shipping == false) {
?>
 <div id="bill_add">
   <?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?>
 </br>
 </br>
<?php
   }
?>
<?php
 $radio_buttons = 0;
 for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
   if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
  echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
   } else {
  echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
   }
?>
<td style="padding-left: 10px;">
<?php
if (sizeof($selection) > 0) {
  echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));
   } else {
  echo tep_draw_hidden_field('payment', $selection[$i]['id']);
   }
?>
    <td width="100%" style="padding-top: 13px; padding-bottom: 11px;">  <strong><?php echo $selection[$i]['module']; ?></strong></td>
    </td>
  </tr>
<?php
   if (isset($selection[$i]['error'])) {
?>
  <tr>
    <td colspan="2"><?php echo $selection[$i]['error']; ?></td>
  </tr>
<?php
   } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
?>
  <tr>
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
<?php
  for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
	  <tr>
	    <td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
	    <td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
	  </tr>
<?php
  }
?>
    </table></td>
  </tr>
<?php
   }
?>
   </table>
<?php
   $radio_buttons++;
 }
?>
 </div>
  <hr />
 <h1><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h1>
  <div id="bill_add">
  <?php echo tep_address_label($customer_id, $billto, true, ' ', '</br>'); ?>
 <table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
  <?php echo tep_mobile_selection(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS), array(IMAGE_BUTTON_CHANGE_ADDRESS)).'<div class="fleche" style="position:relative; top:1px;"><img src="' . DIR_MOBILE_IMAGES . 'arrow_select.png" /></div>'; ?>
 </table>
 </div>
<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();" ', true);
?>
  <hr />
  <h1><?php echo TABLE_HEADING_COMMENTS; ?></h1>
  <div id="bill_add">
  <?php echo tep_draw_textarea_field('comments', 'soft', '40', '6', $comments); ?>
  </div>
  <div id="bouton" style="height:24px;">
  <?php echo '<span style="float:right;"><input type="submit" value="' . IMAGE_BUTTON_CONTINUE . '"></form></span>' .
	 '<span style="float:left;">' . tep_draw_form('back', tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_BACK) . '</form></span>'; ?> 
  </div>
</div>
<?php require(DIR_MOBILE_INCLUDES . 'footer.php'); ?>
</div>

 

for OSCommerce version 2.3.x.:

mobile_checkout_shipping.php

<?php
require_once('mobile/includes/application_top.php');
require(DIR_WS_CLASSES.'http_client.php');
// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_mobile_link(FILENAME_LOGIN, '', 'SSL'));
 }
// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
 }
// if no shipping destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('sendto')) {
   tep_session_register('sendto');
   $sendto = $customer_default_address_id;
 } else {
// verify the selected shipping address
   if ( (is_array($sendto) && empty($sendto)) || is_numeric($sendto) ) {
  $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
  $check_address = tep_db_fetch_array($check_address_query);
  if ($check_address['total'] != '1') {
    $sendto = $customer_default_address_id;
    if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
  }
   }
 }
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
 if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
 $cartID = $cart->cartID;
// if the order contains only virtual products, forward the customer to the billing page as
// a shipping address is not needed
 if ($order->content_type == 'virtual') {
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   $shipping = false;
   $sendto = false;
   tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
// load all enabled shipping modules
 require(DIR_WS_CLASSES . 'shipping.php');
 $shipping_modules = new shipping;
 if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
   $pass = false;
   switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
  case 'national':
    if ($order->delivery['country_id'] == STORE_COUNTRY) {
	  $pass = true;
    }
    break;
  case 'international':
    if ($order->delivery['country_id'] != STORE_COUNTRY) {
	  $pass = true;
    }
    break;
  case 'both':
    $pass = true;
    break;
   }
   $free_shipping = false;
   if ( ($pass == true) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
  $free_shipping = true;
  include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
   }
 } else {
   $free_shipping = false;
 }
 // process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
  $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
  if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
    $shipping = $HTTP_POST_VARS['shipping'];
    list($module, $method) = explode('_', $shipping);
    if ( is_object($$module) || ($shipping == 'free_free') ) {
	  if ($shipping == 'free_free') {
	    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
	    $quote[0]['methods'][0]['cost'] = '0';
	  } else {
	    $quote = $shipping_modules->quote($method, $module);
	  }
	  if (isset($quote['error'])) {
	    tep_session_unregister('shipping');
	  } else {
	    if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
		  $shipping = array('id' => $shipping,
						    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
						    'cost' => $quote[0]['methods'][0]['cost']);
		  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
	    }
	  }
    } else {
	  tep_session_unregister('shipping');
    }
  }
   } else {
  $shipping = false;

  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }   
 }
// get all available shipping quotes
 $quotes = $shipping_modules->quote();
// if no shipping method has been selected, automatically select the cheapest method.
// if the modules status was changed when none were available, to save on implementing
// a javascript force-selection method, also automatically select the cheapest shipping
// method if more than one module is now enabled
 if ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();
 require(DIR_WS_LANGUAGES . $language . '/checkout_shipping.php');
 $breadcrumb->add(NAVBAR_TITLE_1, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
require(DIR_MOBILE_INCLUDES . 'header.php');
$headerTitle->write();
?>
<script type="text/javascript"><!--
var selected;
function selectRowEffect(object, buttonselect) {
 if (!selected) {
   if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
   } else {
  selected = document.all['defaultSelected'];
   }
 }
 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;
// one button is not an array
 if (document.checkout_address.shipping[0]) {
   document.checkout_address.shipping[buttonselect].checked=true;
 } else {
   document.checkout_address.shipping.checked=true;
 }
}
function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>
<div id="iphone_content">
<?php echo tep_draw_form('checkout_address', tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>
<div id="checkout_shipping">
<?php
 if (tep_count_shipping_modules() > 0) {
?>
 <h1><?php echo TABLE_HEADING_SHIPPING_METHOD; ?></h1>
</br>
<?php
   if (sizeof($quotes) > 1 && sizeof($quotes[0]) > 1 && $free_shipping == false) {
?>
 <div id="ship_add">
   <?php echo TEXT_CHOOSE_SHIPPING_METHOD; ?>
<?php
   } elseif ($free_shipping == false) {
?>
 <div id="ship_add">
   <?php echo TEXT_ENTER_SHIPPING_INFORMATION; ?>
<?php
   }
   if ($free_shipping == true) {
?>
 <div id="ship_add">
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td><strong><?php echo FREE_SHIPPING_TITLE; ?></strong></br> <?php echo $quotes[$i]['icon']; ?></td>
  </tr>
  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, 0)">
    <td style="padding-left: 15px; padding-top: 12px; padding-bottom: 12px;"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION, $currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . tep_draw_hidden_field('shipping', 'free_free'); ?></td>
  </tr>
   </div>
<?php
   } else {
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
   <?php
  $radio_buttons = 0;
  for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
?>
</br>
  <tr>
    <td colspan="3"><strong><?php echo $quotes[$i]['module']; ?></strong> <?php if (isset($quotes[$i]['icon']) && tep_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></td>
  </tr>
<?php
    if (isset($quotes[$i]['error'])) {
?>
  <tr>
    <td colspan="3"><?php echo $quotes[$i]['error']; ?></td>
  </tr>
<?php
    } else {
	  for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
// set the radio button to be checked if it is the method chosen
	    $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $shipping['id']) ? true : false);
	    if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
		  echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
	    } else {
		  echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
	    }
?>
    <td style="padding-left: 10px;"><?php echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked); ?></td>
    <td width="89%" style="padding-top: 13px; padding-bottom: 11px;"> <?php echo $quotes[$i]['methods'][$j]['title']; ?></td>
<?php
	    if ( ($n > 1) || ($n2 > 1) ) {
?>
    <td><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
<?php
	    } else {
?>
    <td align="right" colspan="2"><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']); ?></td>
<?php
	    }
?>
  </tr>
<?php
	    $radio_buttons++;
	  }
    }
  }
   }
?>
   </table>
 </div>
<?php
 }
?>
 <hr />
  <h1><?php echo TABLE_HEADING_SHIPPING_ADDRESS; ?></h1>
  <div id="ship_add">
  <?php echo tep_address_label($customer_id, $sendto, true, ' ', '</br>'); ?>
 <table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
  <?php echo tep_mobile_selection(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS), array(IMAGE_BUTTON_CHANGE_ADDRESS)).'<div class="fleche" style="position:relative; top:3px;"><img src="' . DIR_MOBILE_IMAGES . 'arrow_select.png" /></div>'; ?>
 </table>
 </div>
<?php echo tep_draw_form('checkout_address', tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'), 'post', '', true) . tep_draw_hidden_field('action', 'process'); ?>
<hr />
  <h1><?php echo TABLE_HEADING_COMMENTS; ?></h1>
  <div id="ship_add">
  <?php echo tep_draw_textarea_field('comments', 'soft', '40', '6'); ?>
  </div>
  <div id="bouton" style="height:24px;">
  <?php echo '<span style="float:right;"><input type="submit" value="' . IMAGE_BUTTON_CONTINUE . '"></form></span>' .
	 '<span style="float:left;">' . tep_draw_form('back', tep_mobile_link(FILENAME_SHOPPING_CART, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_BACK) . '</form></span>'; ?> 
  </div>
</div>
<?php require(DIR_MOBILE_INCLUDES . 'footer.php'); ?>
</div>

 

mobile_checkout_payment.php

<?php
require_once('mobile/includes/application_top.php');
// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_mobile_link(FILENAME_LOGIN, '', 'SSL'));
 }
// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
 }
// if no shipping method has been selected, redirect the customer to the shipping method selection page
 if (!tep_session_is_registered('shipping')) {
   tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 }
// avoid hack attempts during the checkout procedure by checking the internal cartID
 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
   if ($cart->cartID != $cartID) {
  tep_redirect(tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
   }
 }
// Stock Check
 if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
   $products = $cart->get_products();
   for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  if (tep_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
    tep_redirect(tep_mobile_link(FILENAME_SHOPPING_CART));
    break;
  }
   }
 }
// if no billing destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('billto')) {
   tep_session_register('billto');
   $billto = $customer_default_address_id;
 } else {
// verify the selected billing address
   if ( (is_array($billto) && empty($billto)) || is_numeric($billto) ) {
  $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$billto . "'");
  $check_address = tep_db_fetch_array($check_address_query);
  if ($check_address['total'] != '1') {
    $billto = $customer_default_address_id;
    if (tep_session_is_registered('payment')) tep_session_unregister('payment');
  }
   }
 }
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order;
 if (!tep_session_is_registered('comments')) tep_session_register('comments');
 if (isset($HTTP_POST_VARS['comments']) && tep_not_null($HTTP_POST_VARS['comments'])) {
   $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
 }
 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();
// load all enabled payment modules
 require(DIR_MOBILE_CLASSES . 'payment.php');
 $payment_modules = new payment;
 require(DIR_WS_LANGUAGES . $language . '/checkout_payment.php');
 $breadcrumb->add(NAVBAR_TITLE_1, tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_mobile_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
require(DIR_MOBILE_INCLUDES . 'header.php');
$headerTitle->write();
?>
<script type="text/javascript"><!--
var selected;
function selectRowEffect(object, buttonselect) {
 if (!selected) {
   if (document.getElementById) {
  selected = document.getElementById('defaultSelected');
   } else {
  selected = document.all['defaultSelected'];
   }
 }
 if (selected) selected.className = 'moduleRow';
 object.className = 'moduleRowSelected';
 selected = object;
// one button is not an array
 if (document.checkout_payment.payment[0]) {
   document.checkout_payment.payment[buttonselect].checked=true;
 } else {
   document.checkout_payment.payment.checked=true;
 }
}
function rowOverEffect(object) {
 if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
 if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}
//--></script>
<?php echo $payment_modules->javascript_validation(); ?>
<div id="iphone_content">
<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();"', true); ?>
<div id="checkout_payment">
<?php
 if (isset($HTTP_GET_VARS['payment_error']) && is_object(${$HTTP_GET_VARS['payment_error']}) && ($error = ${$HTTP_GET_VARS['payment_error']}->get_error())) {
?>
<div id="messageStack">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>
<?php
 }
?>
<h1><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></h1>
</br>
<?php
 $selection = $payment_modules->selection();
 if (sizeof($selection) > 1) {
?>
 <div id="bill_add">
   <?php echo TEXT_SELECT_PAYMENT_METHOD; ?>
 </br>
 </br>
<?php
   } elseif ($free_shipping == false) {
?>
 <div id="bill_add">
   <?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?>
 </br>
 </br>
<?php
   }
?>
<?php
 $radio_buttons = 0;
 for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
?>
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
   if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {
  echo '	  <tr id="defaultSelected" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
   } else {
  echo '	  <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffect(this, ' . $radio_buttons . ')">' . "\n";
   }
?>
<td style="padding-left: 10px;">
<?php
if (sizeof($selection) > 0) {
  echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));
   } else {
  echo tep_draw_hidden_field('payment', $selection[$i]['id']);
   }
?>
    <td width="100%" style="padding-top: 13px; padding-bottom: 11px;">  <strong><?php echo $selection[$i]['module']; ?></strong></td>
    </td>
  </tr>
<?php
   if (isset($selection[$i]['error'])) {
?>
  <tr>
    <td colspan="2"><?php echo $selection[$i]['error']; ?></td>
  </tr>
<?php
   } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
?>
  <tr>
    <td colspan="2"><table border="0" cellspacing="0" cellpadding="2">
<?php
  for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
?>
	  <tr>
	    <td><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
	    <td><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
	  </tr>
<?php
  }
?>
    </table></td>
  </tr>
<?php
   }
?>
   </table>
<?php
   $radio_buttons++;
 }
?>
 </div>
  <hr />
 <h1><?php echo TABLE_HEADING_BILLING_ADDRESS; ?></h1>
  <div id="bill_add">
  <?php echo tep_address_label($customer_id, $billto, true, ' ', '</br>'); ?>
 <table id="categoriesTable" class="categories" width="100%" cellpadding="0" cellspacing="0">
  <?php echo tep_mobile_selection(tep_mobile_link(FILENAME_CHECKOUT_PAYMENT_ADDRESS), array(IMAGE_BUTTON_CHANGE_ADDRESS)).'<div class="fleche" style="position:relative; top:1px;"><img src="' . DIR_MOBILE_IMAGES . 'arrow_select.png" /></div>'; ?>
 </table>
 </div>
<?php echo tep_draw_form('checkout_payment', tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'), 'post', 'onsubmit="return check_form();" ', true);
?>
  <hr />
  <h1><?php echo TABLE_HEADING_COMMENTS; ?></h1>
  <div id="bill_add">
  <?php echo tep_draw_textarea_field('comments', 'soft', '40', '6', $comments); ?>
  </div>
  <div id="bouton" style="height:24px;">
  <?php echo '<span style="float:right;"><input type="submit" value="' . IMAGE_BUTTON_CONTINUE . '"></form></span>' .
	 '<span style="float:left;">' . tep_draw_form('back', tep_mobile_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) . tep_mobile_button(IMAGE_BUTTON_BACK) . '</form></span>'; ?> 
  </div>
</div>
<?php require(DIR_MOBILE_INCLUDES . 'footer.php'); ?>
</div>

 

For both OSCommerce versions:

 

in: mobile/includes/iphone.css

 

replace all from line 1022 ( below: ul li { display: inline; }) until the end with this:

/* selection area shipping and payment modules in checkout pages */
.moduleRow { background-color: #dec2ee; }
.moduleRowOver { background-color: #ede6f0; cursor: pointer; cursor: hand;}
.moduleRowSelected { background-color: #ffffff; }

 

For the Discount Code until now there is only support for this contribution included in the support pacckage:

Discount Code

http://addons.oscommerce.com/info/7397

 

But I think if you use the instructions for that contribution and the code you have installed in your desktop shop, it shouldn't be too difficult to install on the mobile pages.

 

regards

Rainer

Link to comment
Share on other sites

Raiwa,

Just FYI, in the 2.2rc2a, 5.3 to 5.3rev1 upgrade instructions:

 

9.  catalog/mobile_checkout_shopping_cart.php

should be

9.  catalog/mobile_shopping_cart.php

 

You also made modifications to /catalog/mobile/includes/header.php and /catalog/mobile/includes/languages/...

 

Everythings working well - great work.

-Dave

Link to comment
Share on other sites

Thank you, Rainer.

 

Your changes work.

 

There is just one minor problem -- mobile_checkout_payment.php

 

<div id="messageStack">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>

 

Should be:

<div id="messageStackError">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>

 

Otherwise white writing on white background is not very readable :-)

 

Also, may I make a suggestion? First payment method should always be selected. Existing code loads the page, but none of the radio buttons are selected. Ideally, first one should be selected if no selection is made by the user and then user selection should be retained, but this is a lot of hassle for small gain. I would just set first one to be selected when page is loading. BTW, same issue exists in normal osc shop.

 

Rudolf

Link to comment
Share on other sites

Thank you, Rainer.

 

Your changes work.

 

There is just one minor problem -- mobile_checkout_payment.php

 

<div id="messageStack">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>

 

Should be:

<div id="messageStackError">
<?php echo tep_output_string_protected($error['title']); ?>
<?php echo tep_output_string_protected($error['error']); ?>
</div>

 

Otherwise white writing on white background is not very readable :-)

 

Also, may I make a suggestion? First payment method should always be selected. Existing code loads the page, but none of the radio buttons are selected. Ideally, first one should be selected if no selection is made by the user and then user selection should be retained, but this is a lot of hassle for small gain. I would just set first one to be selected when page is loading. BTW, same issue exists in normal osc shop.

 

Rudolf

 

Hello Rudolf

 

First thanks for the report, I'll correct this in the next update.

 

For the default payment selection roaddoctor proposed this too, but I have to say that in my opinion it should be like it is because it's like you say: in the desktop page there is no default payment selection used and so it should be the same in the standard iOSC version for coherency.

In the shipping selection it is different, there exists a general criteria which module to select as default: the cheapest. Not so for the payment.

What you ask for should be made as a customisation.

 

I found the code snippet to do it here:

http://www.oscommerce.com/forums/topic/354691-default-payment-automatically-selected/#entry1488696

 

Allthough it needs a little update to work on iOSC 5.3 (and also on the desktop page of OSC2.3.):

 

In mobile_checkout_payment.php

 

1.:

find:

if ( ($selection[$i]['id'] == $payment) || ($n == 1) ) {

change to:

if ( ($selection[$i]['id'] == $payment) || ($n == 1) || ($i == 0) ) { //modified for default payment selection

 

2.:

find:

if (sizeof($selection) > 0) {
 echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));
} else {
 echo tep_draw_hidden_field('payment', $selection[$i]['id']);
}

 

change to:

// BEGIN modified for default payment selection
if (sizeof($selection) > 1) {
if ($i == 0) {
$checked = true;
} else {
$checked = false;
}
echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked);
} else {
echo tep_draw_hidden_field('payment', $selection[$i]['id']);
}

/* commented out for default payment selection
if (sizeof($selection) > 0) {
 echo tep_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $payment));
} else {
 echo tep_draw_hidden_field('payment', $selection[$i]['id']);
}
END modified for default payment selection */

 

The same change can be done in the desktop checkout_payment.php page.

The only difference you'll find is that in this line:

if (sizeof($selection) > 0) {

it will be set to :

if (sizeof($selection) > 1) {

 

The difference is just that the radiobutton will not show if only one payment method is available if set to "1".

If set to "0" the radiobutton will show even only one method is available.

I found this more clear for the mobile page.

 

Hope this helps

 

Regards

Rainer

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