Jump to content
Dr. Rolex

jQuery/Ajax Dynamic Checkout for osCommerce 2.3.3

Recommended Posts

Hi Dr. Rolex

 

I'm almost ready to promote the Dynamic Checkout changes to my live store but IE8 doesn't work correctly; Other "style" changes I've applied don't work in IE8 so it's not your code

 

Any suggestions how to make older browsers more compatible?

 

Thanks so much

 

I don't spend much time to get the code working on older IE versions, I don't understand why someone use IE8 in the year 2013? I don't understand why someone is using IE at all after all the warnings that have come out from various places..

 

There are plenty of webpages with hacks and help to get things working (somewhat properly) on IE. Look in the IE console and google the errors.

 

As for me, I simply do this:

<?php
$u_agent = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/(?i)msie [2-8]/',$u_agent)) {
// put your code here for Internet Explorer Version 2-8
} else {
// put your code here for modern browsers
}
?>

 

As a suggestion, you can try this in checkout_shipping.php:

<?php
$u_agent = $_SERVER['HTTP_USER_AGENT'];
if(!preg_match('/(?i)msie [2-8]/',$u_agent)) { ?>
<script type="text/javascript" src="js/jquery.easing.min.js"></script>
<script type="text/javascript" src="js/jquery.checkout.engine.js?0912"></script>
<?php
}
?>

 

This code check which browser version the customer use and if it's not IE version 2-8 then it will load the javascript.

 

This Add-On should be safe for people without Javascript, but I haven't tested it.

Edited by Dr. Rolex

Share this post


Link to post
Share on other sites

I need some help.

 

I have a template, and some part of the code is giving me problems.

 

This is the code in the template file "html_output.php":

 

 

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {

static $button_counter = 1;

 

$types = array('submit', 'button', 'reset');

 

if ( !isset($params['type']) ) {

$params['type'] = 'submit';

}

 

if ( !in_array($params['type'], $types) ) {

$params['type'] = 'submit';

}

 

if ( ($params['type'] == 'submit') && isset($link) ) {

$params['type'] = 'button';

}

 

if (!isset($priority)) {

$priority = 'secondary';

}

 

$button = '';

 

if ( ($params['type'] == 'button') && isset($link) ) {

$button .= '<a class="unishop_submit" href="' . $link . '"';

 

if ( isset($params['newwindow']) ) {

$button .= ' target="_blank"';

}

} else {

$button .= '<button class="unishop_button" type="' . tep_output_string($params['type']) . '"';

}

 

if ( isset($params['params']) ) {

$button .= ' ' . $params['params'];

}

 

$button .= '>' . $title;

 

if ( ($params['type'] == 'button') && isset($link) ) {

$button .= '</a>';

} else {

$button .= '</button>';

}

 

$button .= '';

 

 

$button_counter++;

 

return $button;

}

?>

 

 

 

And i need to replace to your code:

 

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {

global $button_counter;

 

if (!tep_session_is_registered('button_counter')) {

tep_session_register('button_counter');

$button_counter = 1;

}

 

if ($button_counter >= 1000 ) $button_counter = 1;

 

$types = array('submit', 'button', 'reset');

 

if ( !isset($params['type']) ) {

$params['type'] = 'submit';

}

 

if ( !in_array($params['type'], $types) ) {

$params['type'] = 'submit';

}

 

if ( ($params['type'] == 'submit') && isset($link) ) {

$params['type'] = 'button';

}

 

if (!isset($priority)) {

$priority = 'secondary';

}

 

$button = '<span class="tdbLink">';

 

if ( ($params['type'] == 'button') && isset($link) ) {

$button .= '<a id="tdb' . $button_counter . '" href="' . $link . '"';

 

if ( isset($params['newwindow']) ) {

$button .= ' target="_blank"';

}

} else {

$button .= '<button id="tdb' . $button_counter . '" type="' . tep_output_string($params['type']) . '"';

}

 

if ( isset($params['params']) ) {

$button .= ' ' . $params['params'];

}

 

$button .= '>' . $title;

 

if ( ($params['type'] == 'button') && isset($link) ) {

$button .= '</a>';

} else {

$button .= '</button>';

}

 

$button .= '</span><script type="text/javascript">$("#tdb' . $button_counter . '").button(';

 

$args = array();

 

if ( isset($icon) ) {

if ( !isset($params['iconpos']) ) {

$params['iconpos'] = 'left';

}

 

if ( $params['iconpos'] == 'left' ) {

$args[] = 'icons:{primary:"ui-icon-' . $icon . '"}';

} else {

$args[] = 'icons:{secondary:"ui-icon-' . $icon . '"}';

}

}

 

if (empty($title)) {

$args[] = 'text:false';

}

 

if (!empty($args)) {

$button .= '{' . implode(',', $args) . '}';

}

 

$button .= ').addClass("ui-priority-' . $priority . '").parent().removeClass("tdbLink");</script>';

 

$button_counter++;

 

return $button;

}

?>

 

 

When i change the code, the templante design dont work very well.

 

Can you help me?

Share this post


Link to post
Share on other sites

No one can help me?

 

Hello Fagulhas,

 

I've been away for a couple of weeks so I haven't been able to check the forum.

 

Have you tried using your old code? It will take a while for me to "learn the code" again. Could you PM your shop address?

 

You could always try using my current code, if you're lucky it might work better but I don't know if I have changed anything.

 

function tep_draw_button($title = null, $icon = null, $link = null, $priority = null, $params = null) {
global $button_counter;
if (!tep_session_is_registered('button_counter')) {
tep_session_register('button_counter');
$button_counter = 1;
}

if ($button_counter >= 1000 ) $button_counter = 1;
$types = array('submit', 'button', 'reset');
if ( !isset($params['type']) ) {
 $params['type'] = 'submit';
}
if ( !in_array($params['type'], $types) ) {
 $params['type'] = 'submit';
}
if ( ($params['type'] == 'submit') && isset($link) ) {
 $params['type'] = 'button';
}
if ( !isset($params['id']) ) {
$params['id'] = 'tdb' . $button_counter;
}
if (!isset($priority)) {
 $priority = 'secondary';
}
$button = '<span class="tdbLink">';
if ( ($params['type'] == 'button') && isset($link) ) {
 $button .= '<a id="' . $params['id'] . '" href="' . $link . '"';
 if ( isset($params['newwindow']) ) {
 $button .= ' target="_blank"';
 }
} else {
 $button .= '<button id="' . $params['id'] . '" type="' . tep_output_string($params['type']) . '"';
}
if ( isset($params['params']) ) {
 $button .= ' ' . $params['params'];
}
$button .= '>' . $title;
if ( ($params['type'] == 'button') && isset($link) ) {
 $button .= '</a>';
} else {
 $button .= '</button>';
}
$button .= '</span><script type="text/javascript">$("#' . $params['id'] . '").button(';
$args = array();
if ( isset($icon) ) {
 if ( !isset($params['iconpos']) ) {
 $params['iconpos'] = 'left';
 }
 if ( $params['iconpos'] == 'left' ) {
 $args[] = 'icons:{primary:"ui-icon-' . $icon . '"}';
 } else {
 $args[] = 'icons:{secondary:"ui-icon-' . $icon . '"}';
 }
}
if (empty($title)) {
 $args[] = 'text:false';
}
if (!empty($args)) {
 $button .= '{' . implode(',', $args) . '}';
}
$button .= ').addClass("ui-priority-' . $priority . '").parent().removeClass("tdbLink");$("#' . $params['id'] . '").button({label: "' . $title . '"});</script>';
$button_counter++;
return $button;
}

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

×