Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jQuery/Ajax Fast checkout/Login/Create account/Shopping Cart/Bootstrap MATC 2.3.3


Recommended Posts

btw. that code should work by default with mysqli, but also with old mysql. Database.php file from oscommerce is doing fallback to old functions.

 

So your are using MySQLi but still, it doesn't work?

 

osCommerce 2.3.3 official instructions on how to upgrade the two database.php files didn't work for me at all. I had to include this to both database.php:

 

Find this code in ./includes/functions/database.php

$$link = mysqli_connect($server, $username, $password, $database);

Change to:

$$link = mysqli_connect($server, $username, $password, $database);
/* change character set to utf8 */
$$link->set_charset("utf8"); // Change it to whatever Encoding you're using on your database.

 

I think i made changes to the tep_db_query function as well.

 

But I don't understand why you're making changes to application_top.php?

Link to comment
Share on other sites

Hi

 

let me explain it:

 

original autocomplete.php starts with "require('includes/application_top.php')". Because of this autocomplete was not showing data (it was indeed executing query on background, but results of that query were not showed). I didn't change application_top.php. I just removed it from autocomplete.php and put there just some includes which you can see in my last post. This way everything worked.

 

regarding mysqli in latest oscommerce 2.3.3.4 you can find this in database.php

 

   $$link = mysqli_connect($server, $username, $password, $database);
   if ( !mysqli_connect_errno() ) {
  mysqli_set_charset($$link, 'utf8');
   }

 

and in same file from line 160 to the end you can see this:

 if ( !function_exists('mysqli_connect') ) {

 

so this is fallback to old mysql code. So I was not changing anything from oscommerce source. I just changed autocomplete.php to not include application_top but rather few specific includes. This worked for me.

 

I'm doing now upgrade from 2.2rc2a to 2.3.3.4 and this is huge step. A lot of work but at last I have my shop running at least from technical point of view. I like 960 grid system introduced in new oscommerce but have to drill down to understand how to move my old design to new oscommerce. I was using in old shop STS which is not working in new oscommerce so I have to deal somehow with 960grid. But actually I like it. I installed few addons to control layout and JQuery versions from admin and also templates, so changing layout and design is quite quick now. But still I have to do some changes or study how to do them with JQuery :)

 

At the end new oscommerce with you AJAX addons is really great mix :) thank you

Link to comment
Share on other sites

Hi

 

let me explain it:

 

(...)

 

At the end new oscommerce with you AJAX addons is really great mix :) thank you

 

Great that you solved it and now I think I understand what you meant! :)

 

If it's that much code to change don't you think you're better of first installing a clean 2.3.3.4 install, check around a bit so you understand the basics of the code and then implement one Add-On modification at at time and when that one is working, then do the next one.

Link to comment
Share on other sites

yeah I thought about this also, maybe that would have been better option :). I installed quite a lot of addons in old system and did some customizations there therefore I decided to do it as I described. I was avoiding it many months but my server admin wants to do switch from PHP 5.3 to 5.4 so I was forced to do something with it :)

 

Anyhow it took me maybe 1 week so it was not so bad. I used araxis merge tool - without it it would be much more painful. Thanks to araxis a lot of merges where done automatically. Afterwards I did once again compare with original 2.3.3.4 to understand differences

 

The benefit now is I don't need to do many DB changes - just 2.3.3.4 relevant which I found on the web.

 

After playing around with new 2.3.3.4 I like it became more modular. A lot of addons can be installed as modules. Knowing this before maybe I would have done it your way :)

Link to comment
Share on other sites

yeah I thought about this also, maybe that would have been better option :). I installed quite a lot of addons in old system and did some customizations there therefore I decided to do it as I described. I

( ... )

After playing around with new 2.3.3.4 I like it became more modular. A lot of addons can be installed as modules. Knowing this before maybe I would have done it your way :)

 

Good work! I think more store owners would find it not that hard to convert their old 2.2 osC to a new version of osCommerce and well worth it! Above the store improvements available, perhaps one could learn some PHP and how osC 2.3 works while doing it. Just to know the basics really help a lot in future Add-On installations or just modifying the code to have it your own way.

 

btw. the code regarding drag&drop works great :) . I did already few tests. I see in the code it should somehow show also drop down with attributes. Any idea how to see it?

Which way did you install both this Add-On (Fast Checkout) and jQuery Shopping cart?

 

If you used code from the file I uploaded a couple of Post's ago, then the code is a bit outdated, I just made it to make it function and left you to do the rest. You should download the latest version of jQuery Shopping Cart and look for changes and try to reapply them so the animations flow flawlessly and Attributes work properly. Do you have problems just with the Drag & Drop or both that and adding a product with a Buy Now button?

 

A tip is to look for errors in the Chrome Console and then go to the sources tab and find the culprit file (which should be displayed in the console by expanding the error).

Then open that file and with your mouse press on the line number that is producing the error (or maybe also place some breakpoints some more lines both above and below where the error is produced) so you can step line-by-line and try to see where the problem is, when it comes to attributes it usually is something that prevents the javascript to find the id of the products.

 

Press F10 to jump to next line and hold the mouse pointer over variables to see if the correct data is there or if it just says "undefined".

 

I have been thinking of adding some kind of counter just to see how often products are added by customers with the D & D technique. It's kind of hard to know that the function exists without some kind of Tooltip. But I found it hard to get it right, it just looks annoying.

Link to comment
Share on other sites

Can anyone help, I've read all the posts but can not get Fast checout working. On the Fast Checkout page (ajax_checkout.php) after updating the shipping and billing information the confirm T&C box pops up. I tick this but then nothing happens. There is no continue button. Any suggestions what is causing this?

 

I'm aslo having issues with the remove item button and the change quantity buttons. If I increase / decrease the quantity then value in the qty box changes but then chages back, the total cost remains the same. The quantity displayed in the cart button in the header does change though. If I click on the cart button the cart reverts to the original quantity.

 

I'm working from 'Ajax Fast checkout 2.3.3 Rev2'. Any assistance would be appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

Which way did you install both this Add-On (Fast Checkout) and jQuery Shopping cart?

 

If you used code from the file I uploaded a couple of Post's ago, then the code is a bit outdated, I just made it to make it function and left you to do the rest. You should download the latest version of jQuery Shopping Cart and look for changes and try to reapply them so the animations flow flawlessly and Attributes work properly. Do you have problems just with the Drag & Drop or both that and adding a product with a Buy Now button?

 

well actually I'm using code from Ajax Fast checkout 2.3.3 Rev2 from folder: catalog_for_jQuery_Shopping_Cart and I have just merged some changes from your last post of whole shop. I didn't know how to use drag and drop, but I saw your last post where changes into these files were done:

 

bm_best_sellers.php

bm_cycle_whats_new

bm_order_history

bm_reviews

bm_specials

bm_whats_new

also_purchased_products

new_products

product_listing

 

so basically in all files where products are shown were done changes to add class="draggable" and other attributes (rel, data-id, id). I was not aware how to use dragging (I never find guide for it, just found it in your sources). So after merging changes from your post I was able to use drag&drop from mentioned files. So drag and drop is now working fine.

 

However in each of those file you had section about 30 lines long starting with " // Comment the code below if you don't use attributes". So it seems to be related for attributes and this is not working. I don't see anywhere attributes shown when doing dragging.

Link to comment
Share on other sites

I have submitted new version of ajaxManagerTest.class.php to http://addons.oscommerce.com/info/8852

 

few corrections to ajaxManagerTest.class.php. Just replace original file.

- fixed design of shipping box (it looks now same as payment box)
- fixed handling of shipping zone (if shipping method had defined shipping zone, ajax_checkout was not working correctly)

Link to comment
Share on other sites

I found another problem but I cannot find place to fix it :). Could you please help? Problem is with default selected shipping and payment methods. Even though default is selected correctly (it means DIV is created correctly with id="defaultSelected" class="moduleRowSelected" ) however when using "update" button (don't change radio selection, just click update), it uses variables from javascript: selected_payment and selected_shipping which are not set correctly and have default 0.

 

These javascript values are set only after calling "selectRowEffect" funtion. I don't know how to call this function automatically after first start. I tried

 

$(document).ready(function(){

 

but it seems this function is called before AJAX requests. So it doesn't work. I think update should be somehow called through AJAX but I don't know how?

Link to comment
Share on other sites

  • 3 weeks later...

Can anyone help, I've read all the posts but can not get Fast checout working. On the Fast Checkout page (ajax_checkout.php) after updating the shipping and billing information the confirm T&C box pops up. I tick this but then nothing happens. There is no continue button. Any suggestions what is causing this?

 

I'm working from 'Ajax Fast checkout 2.3.3 Rev2'. Any assistance would be appreciated.

Hello Neil,

 

Which browser are you using? Have you tried with more than one browser to see if the error persists?

Perhaps you already have solved the problem?

 

Just to make sure, if you in the admin panel have set the option that customers can't checkout if a product is out of stock, then the Confirm button won't be displayed if a product is out of stock.

If you're having this issue in all browsers and can't solve it, then you could always change the CSS to always display the confirm button.

 

To do this, look for the code below in ajaxManager.css and move the display: none; from TheSubmitButton to TheDisabledButton.

#TheDisabledButton {
padding: 1em; margin-left: 5px; float:left;
}
#TheSubmitButton {
display: none; padding: 1em; margin-left: 5px; float:left;
}

 

Then comment this code in ajaxManagerHeader.inc.php

$('body').on('click', '#TermsAgreeCreateAcc', function(){
if($("#TermsAgreeCreateAcc").prop("checked")){
$("#TheDisabledButtonCreateAcc").fadeOut(300).hide();
$("#TheDisabledButtonCreateAcc2").fadeOut(300).hide();
$("#TheSubmitButtonCreateAcc").fadeIn(600);
$("#TheSubmitButtonCreateAcc2").fadeIn(600);
} else {
$("#TheSubmitButtonCreateAcc").fadeOut(300).hide();
$("#TheSubmitButtonCreateAcc2").fadeOut(300).hide();
$("#TheDisabledButtonCreateAcc").fadeIn(600);
$("#TheDisabledButtonCreateAcc2").fadeIn(600);
}
});

$('body').on('click', '#TermsAgree', function(){
if($("#TermsAgree").prop("checked")){
$("#TheDisabledButton").fadeOut(300).hide();
$("#TheSubmitButton").fadeIn(600);
} else {
$("#TheSubmitButton").fadeOut(300).hide();
$("#TheDisabledButton").fadeIn(600);
}
});

 

I'm aslo having issues with the remove item button and the change quantity buttons. If I increase / decrease the quantity then value in the qty box changes but then chages back, the total cost remains the same. The quantity displayed in the cart button in the header does change though. If I click on the cart button the cart reverts to the original quantity.

This means that your code is not sending the required requests to the server. The changes that you see is only javascript (it only happens on your computer and not on the server). Open the Network tab in Google Chrome's Developer tools, press the "clear" button and then try to change the quantity of any product by adding 1 unit. Then look at the results.

 

You should get 3-4 different requests of which the one to look for is the one that uses POST as method and the name should be shopping_cart.php?show_total=1.

You're probably getting an error there. Check this and write back what it says and also check the Console tab and write down any errors that might be displayed there.

Link to comment
Share on other sites

I have just posted this elsewhere and figured out I should really have posted here, my apologies.

 

I have just installed the above contribution but as usual have run into a problem. After carefully installing (3 times) I have the following problem and am completley lost as to how to fix. I probably

havent followed instructions to the letter.

Any help would be appreciated as this appears to be a great contribution.

 

Many thanks

 

Grandpa

post-276414-0-16704900-1390467727_thumb.png

Link to comment
Share on other sites

I found another problem but I cannot find place to fix it :). Could you please help? Problem is with default selected shipping and payment methods. Even though default is selected correctly (it means DIV is created correctly with id="defaultSelected" class="moduleRowSelected" ) however when using "update" button (don't change radio selection, just click update), it uses variables from javascript: selected_payment and selected_shipping which are not set correctly and have default 0.

 

These javascript values are set only after calling "selectRowEffect" funtion. I don't know how to call this function automatically after first start. I tried

 

$(document).ready(function(){

 

but it seems this function is called before AJAX requests. So it doesn't work. I think update should be somehow called through AJAX but I don't know how?

You can try to change to my current version which uses jQuery, I don't remember why I changed from the original javascript to jQuery but maybe it was because I had the same issues as you have.

 

In ./ajax/javascript/form_check.js.php, comment this code:

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
var shipping = document.getElementById('shipping');
if (shipping)
{
shipping.checked=true;
}
var selectable = document.getElementById('shipping_'+buttonselect);
if (selectable)
{
selectable.checked=true;
selected_shipping = buttonselect;
}
var selectable_address = document.getElementById('address_'+buttonselect);
if (selectable_address)
{
selectable_address.checked=true;
selected_address = buttonselect;
}
}
function selectRowEffectPayment(object, buttonselect) {
if (!selected) {
if (document.getElementById) {
 selected = document.getElementById('defaultSelectedPayment');
} else {
 selected = document.all['defaultSelectedPayment'];
}
}
if (selected) selected.className = 'moduleRow';
object.className = 'moduleRowSelected';
selected = object;
// one button is not an array
var selectable_payment = document.getElementById('payment_'+buttonselect);
if (selectable_payment)
{
selectable_payment.checked=true;
selected_payment = buttonselect;
}
}
function selectRowEffectPaymentAddress(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;
var selectable_payment_address = document.getElementById('payment_address_'+buttonselect);
if (selectable_payment_address)
{
selectable_payment_address.checked=true;
selected_payment_address = buttonselect;
}
}
function rowOverEffect(object) {
if (object.className == 'moduleRow') object.className = 'moduleRowOver';
}
function rowOutEffect(object) {
if (object.className == 'moduleRowOver') object.className = 'moduleRow';
}

 

Just below the original code, the one you have commented or removed, add this:

$(function() {
$('body').on('mouseenter', '.moduleRow', function(){
$(this).addClass('moduleRowOver');
});
$('body').on('mouseleave', '.moduleRow', function(){
$(this).removeClass('moduleRowOver');
});
$('body').on('click', '.moduleRow', function(event){
$(this).closest('div').find('tr').removeClass('moduleRowSelected');
$(this).closest('div').find('input[type=radio]').attr('checked',false);
$(this).addClass('moduleRowSelected');
$(this).find('input[type=radio]').prop('checked',true);

buttonselect = $(this).attr('value');

if (selected) selected.className = 'moduleRow';

// one button is not an array
var shipping = document.getElementById('shipping');
if (shipping)
{
 shipping.checked=true;
}
var selectable = document.getElementById('shipping_'+buttonselect);
if (selectable)
{
 selectable.checked=true;
 selected_shipping = buttonselect;
}
var selectable_address = document.getElementById('address_'+buttonselect);
if (selectable_address)
{
 selectable_address.checked=true;
 selected_address = buttonselect;
}

var selectable_payment = document.getElementById('payment_'+buttonselect);
if (selectable_payment)
{
 selectable_payment.checked=true;
 selected_payment = buttonselect;
}

var selectable_payment_address = document.getElementById('payment_address_'+buttonselect);
if (selectable_payment_address)
{
 selectable_payment_address.checked=true;
 selected_payment_address = buttonselect;
}
});
});

 

Now, try if this work, if it doesn't work and you're getting error(s) in the javascript console, then it's probably because you have changed the html layout. So just to make sure that this fix actually works for you, you could first try to replace the code in ajaxManagerTest.class.php to the code I'm using. Comment your own code or remove it and make a backup of it.

 

Beginning around line 2635, find this code:

<div class="ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading ui-corner-top"><strong><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></strong></div>
<div class="ui-widget-content infoBoxContents ui-corner-bottom" style="float:right;">
 <?php
$selection = $payment_modules->selection();
if (sizeof($selection) > 1) {
 ?>
 <p style="float: left; width: 70%;"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></p>
 <p style="float: right; width: 29%;"><strong><?php echo TITLE_PLEASE_SELECT; ?></strong><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif', null, null, null, 'style="float:right;"'); ?></p>
 <div style="clear: both;"></div>
 <div class="selectChoices">
 <?php
} else {
 ?>
 <div style="float: right; width: 100%;"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></div>
 <?php
}
$radio_buttons = 0;
$n = 0;
for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
 if (in_array($selection[$i]['id'],$this->arrAllowedPaymentModules))
 {
 ?>
 <?php
 // set the radio button to be checked if it is the method chosen
 $checked = (($selection[$i]['id'] == (isset($payment) ? $payment : '')) ? true : false);
 if ($payment == null && $i == 2) $checked = true;
 if (!isset($payment) && $i == 0) $checked = true;
 if ( ($checked == true) || $n == 1 ) {
 echo '				 <div id="defaultSelectedPayment" class="moduleRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffectPayment(this, ' . $radio_buttons . ')">' . "\n";
 } else {
 echo '				 <div class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="selectRowEffectPayment(this, ' . $radio_buttons . ')">' . "\n";
 }
 ?>
 <span><strong><?php echo $selection[$i]['module']; ?></strong></span>
 <span>
 <?php
 if (sizeof($selection) > 1) {
 echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked, 'align="right" id="payment_'.$radio_buttons.'"');
 } else {
 echo tep_draw_hidden_field('payment', $selection[$i]['id'],'id="payment_'.$radio_buttons.'"');
 }
 ?></span>
 </div>

 <?php
 if (isset($selection[$i]['error'])) {
 ?>
 <p class="contentText"><?php echo $selection[$i]['error']; ?></p>
 <?php
 } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
 ?>
 <?php
 for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
 ?>
 <p class="contentText"><?php echo $selection[$i]['fields'][$j]['title']; ?></p>
 <p class="contentText"><?php echo $selection[$i]['fields'][$j]['field']; ?></p>
 <?php
 }
 ?>
 <?php
 }
 ?>
 <?php
 $radio_buttons++;
}
}
?>
</div>
</div>

<div style="float: right; margin-top: 10px;">
<?php echo draw_button(IMAGE_BUTTON_UPDATE, 'primary', 'id="buttonselectPayment" onclick="ajaxPerformPaymentSelection();return false;"', 'ui-icon-refresh'); ?>
</div>
</div>

 

Replace with:

<table class="ui-widget ajaxContainer" border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
 <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
 <tr>
 <div class="ui-widget-header infoBoxHeading ui-corner-top ui-corner-top"><strong><?php echo TABLE_HEADING_PAYMENT_METHOD; ?></strong></div>
 </tr>
 </table></td>
</tr>
<tr>
 <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="ui-widget-content ui-corner-bottom">
 <tr>
 <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="contentText">
 <?php
 $selection = $payment_modules->selection();
 if (sizeof($selection) > 1) {
 ?>
 <tr>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td style="float: left; width: 84%;"><?php echo TEXT_SELECT_PAYMENT_METHOD; ?></td>
	 <td style="float: right; text-align: left; width: 9%;" valign="top" align="right"><strong><?php echo TITLE_PLEASE_SELECT; ?></strong><br><?php echo tep_image(DIR_WS_IMAGES . 'arrow_east_south.gif'); ?></td>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 </tr>
 <?php
 } else {
 ?>
 <tr>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td class="contentText" width="100%" colspan="2"><?php echo TEXT_ENTER_PAYMENT_INFORMATION; ?></td>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 </tr>
 <?php
 }
 $radio_buttons = 0;
 for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
 if (in_array($selection[$i]['id'],$this->arrAllowedPaymentModules))
 {
	 ?>
	 <tr>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2" id="paymentSelection">
	 <?php
	 // set the radio button to be checked if it is the method chosen
	 $checked = false;
	 $checked = (($selection[$i]['id'] == (isset($payment) ? $payment : '')) ? true : false);
	 if ($payment == null && $i == 0) $checked = true;
	 if (!isset($payment) && $i == 0) $checked = true;
	 if ( ($checked == true) || ($n == 1) ) {
	 echo '				 <tr class="moduleRow moduleRowSelected" value="' . $radio_buttons . '">' . "\n";
	 } else {
	 echo '				 <tr class="moduleRow" value="' . $radio_buttons . '">' . "\n";
	 }
	 ?>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td class="contentText" colspan="3"><strong><?php echo $selection[$i]['module']; ?></strong></td>
	 <td class="contentText" align="right">
	 <?php
	 if (sizeof($selection) > 1) {
	 echo tep_draw_radio_field('payment', $selection[$i]['id'], $checked, 'id="payment_'.$radio_buttons.'"');
	 } else {
	 echo tep_draw_hidden_field('payment', $selection[$i]['id'],'id="payment_'.$radio_buttons.'"');
	 }
	 ?>
	 </td>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 </tr>
 <?php
 if (isset($selection[$i]['error'])) {
	 ?>
	 <tr>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td class="contentText" colspan="4"><?php echo $selection[$i]['error']; ?></td>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 </tr>
	 <?php
 } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
	 ?>
	 <tr>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td colspan="4"><table border="0" cellspacing="0" cellpadding="2">
	 <?php
	 for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
	 ?>
	 <tr>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td class="contentText"><?php echo $selection[$i]['fields'][$j]['title']; ?></td>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 <td class="contentText"><?php echo $selection[$i]['fields'][$j]['field']; ?></td>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
	 </tr>
	 <?php
	 }
	 ?>
	 </table></td>
	 <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 </tr>
 <?php
 }
 ?>
 </table></td>
 <td><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
 </tr>
 <?php
 $radio_buttons++;
}
}
?>
</table></td>
</tr>
</table></td>
</tr>
</table>
<div style="float: right; margin-top: 10px;">
<?php echo draw_button(IMAGE_BUTTON_UPDATE, 'primary', 'id="buttonselectPayment" onclick="ajaxPerformPaymentSelection();return false;"', 'ui-icon-refresh'); ?>
</div>

 

If it works, then you can switch back to your own code and make the necessary changes to the javascript in form_check.php.js so it can find the correct value of the selected payment. As the code is now, the value should be placed on the same html tag as the one with the class moduleRow on it.

 

Anther tip I can give you is to place a icon/image next to each payment selection. You can do this by modifying the payment classes that you use. Find them in ./includes/modules/payment/ and look in the selection & confirmation functions.

 

E.g, in the cash on delivery module that came with osCommerce, you could change it to something like this and add a definition in the language file for the path to the image that you want to use.

 

Find in .includes/modules/payment/cod.php:

$this->title = MODULE_PAYMENT_COD_TEXT_TITLE;

Add this below:

$this->icon = MODULE_PAYMENT_COD_ICON;

Find:

function selection() {
 return array('id' => $this->code,
			 'module' => $this->title);
}

Replace with:

function selection() {
 return array('id' => $this->code,
		 'module' => (($this->icon != '') ? '<span style="float: left; margin-right: 10px;">' . tep_image($this->icon, $this->title) : $this->title) . '</span>' . '<span style="float: top;">' . $this->title . (($this->description != '') ? '<br /><span style="font-weight: normal; float: left;">'. $this->description . '</span>' : false)
 );
}

 

Find:

function confirmation() {
 return false;
}

Replace with:

function confirmation() {
 return array(
'title' => '',
	 'module' => (($this->icon != '') ? '<span style="float: left; margin-right: 10px;">' . tep_image($this->icon, $this->title) : $this->title) . '</span>' . '<span style="float: top;">' . $this->title
 );
}

 

Hopefully this helps, if it does then you probably need to change your other tables as well (shipping, addresses).

Link to comment
Share on other sites

I have just posted this elsewhere and figured out I should really have posted here, my apologies.

 

I have just installed the above contribution but as usual have run into a problem. After carefully installing (3 times) I have the following problem and am completley lost as to how to fix. I probably

havent followed instructions to the letter.

Any help would be appreciated as this appears to be a great contribution.

 

Many thanks

 

Grandpa

Hello Grandpa,

 

It looks like your code for some reason isn't loading configure.php. Look in your ./includes/application_top.php for changes that you have made.

 

Do you get the same error if you manually type another page in your browser? Try to load http://[your_site]/login.php instead and see if you get the same error. This error is probably because of a typo or something in your code, perhaps you forgot the ";" at end of line somewhere in application_top.php or index.php where it loads application_top.php

 

If you can't find it, backup your current application_top.php and replace it with your old one that works and then see if the page loads.

Link to comment
Share on other sites

Hello Grandpa,

 

It looks like your code for some reason isn't loading configure.php. Look in your ./includes/application_top.php for changes that you have made.

 

Do you get the same error if you manually type another page in your browser? Try to load http://[your_site]/login.php instead and see if you get the same error. This error is probably because of a typo or something in your code, perhaps you forgot the ";" at end of line somewhere in application_top.php or index.php where it loads application_top.php

 

If you can't find it, backup your current application_top.php and replace it with your old one that works and then see if the page loads.

 

hi

 

Many thanks for your reply.

 

Something strange is happening. If I upload the incl>applicaton_top.php which is included with in Ajax Fast checkout 2.3.3 Rev2\catalog then I get the above problem, if however I replace it with the application_top.php as included in the 2.3.3 the problem dissapears and all seems to operate correctly (I think)

 

Any thoughts .

 

Many thanks

Grandpa

Link to comment
Share on other sites

hi

 

Many thanks for your reply.

 

Something strange is happening. If I upload the incl>applicaton_top.php which is included with in Ajax Fast checkout 2.3.3 Rev2\catalog then I get the above problem, if however I replace it with the application_top.php as included in the 2.3.3 the problem dissapears and all seems to operate correctly (I think)

 

Any thoughts .

 

Many thanks

Grandpa

First, check if you have a file in ./includes/local/configure.php, if you do, then rename it to configure.php.bak or similar.

 

If that doesn't work, run a file diff program and check what's different between the two application_top.php files that you have used.You should only get one diff.

If you're using Windows then you can download a free open source program called Winmerge to do this:

http://sourceforge.net/projects/winmerge/

 

Or, if you just want to get it working, then use the application_top.php that worked and in it find the following code around line 232:

// verify the IP address if the feature is enabled
 if (SESSION_CHECK_IP_ADDRESS == 'True') {
   $ip_address = tep_get_ip_address();
   if (!tep_session_is_registered('SESSION_IP_ADDRESS')) {
  $SESSION_IP_ADDRESS = $ip_address;
  tep_session_register('SESSION_IP_ADDRESS');
   }
   if ($SESSION_IP_ADDRESS != $ip_address) {
  tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_LOGIN));
   }
 }

Now, add the following code below:

/* Ajax Fast Guest Checkout */
if ((isset($_SESSION['customer_id']) && $_SESSION['customer_id'] == '0' || isset($_SESSION['guest']) && $_SESSION['guest'] == 1) && $PHP_SELF != 'ajaxManager.php' && $PHP_SELF != FILENAME_AJAX_CHECKOUT) {
 if (($PHP_SELF == FILENAME_SHOPPING_CART && !(int)($_GET['show_total']) && !(int)$_GET['ajax'] && $_SERVER['HTTP_X_REQUESTED_WITH'] != 'XMLHttpRequest') || $PHP_SELF != FILENAME_SHOPPING_CART) {
  // unregister session variables used during checkout if customer used Guest Checkout
  if (tep_session_is_registered('sendto')) tep_session_unregister('sendto');
  if (tep_session_is_registered('billto')) tep_session_unregister('billto');
  if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
  if (tep_session_is_registered('payment')) tep_session_unregister('payment');
  if (tep_session_is_registered('comments')) tep_session_unregister('comments');
  if (tep_session_is_registered('customer_id')) tep_session_unregister('customer_id');
  if (tep_session_is_registered('customer_default_address_id')) tep_session_unregister('customer_default_address_id');
  if (tep_session_is_registered('customer_first_name')) tep_session_unregister('customer_first_name');
  if (tep_session_is_registered('customer_country_id')) tep_session_unregister('customer_country_id');
  if (tep_session_is_registered('customer_zone_id')) tep_session_unregister('customer_zone_id');
  if (tep_session_is_registered('firstname')) tep_session_unregister('firstname');
  if (tep_session_is_registered('lastname')) tep_session_unregister('lastname');
  if (tep_session_is_registered('email_address')) tep_session_unregister('email_address');
  if (tep_session_is_registered('company')) tep_session_unregister('company');
  if (tep_session_is_registered('street_address')) tep_session_unregister('street_address');
  if (tep_session_is_registered('postcode')) tep_session_unregister('postcode');
  if (tep_session_is_registered('suburb')) tep_session_unregister('suburb');
  if (tep_session_is_registered('city')) tep_session_unregister('city');
  if (tep_session_is_registered('state')) tep_session_unregister('state');
  if (tep_session_is_registered('country')) tep_session_unregister('country');
  if (tep_session_is_registered('telephone')) tep_session_unregister('telephone');
  if (tep_session_is_registered('fax')) tep_session_unregister('fax');
  if (tep_session_is_registered('am_session_var')) tep_session_unregister('am_session_var');
  if (tep_session_is_registered('am_valid_include')) tep_session_unregister('am_valid_include');
  if (tep_session_is_registered('new_products_id_in_cart')) tep_session_unregister('new_products_id_in_cart');
  if (tep_session_is_registered('payment_error')) tep_session_unregister('payment_error');
  if (tep_session_is_registered('cod_vars')) tep_session_unregister('cod_vars');
  if (tep_session_is_registered('guest')) tep_session_unregister('guest');
 }
}
/* Ajax Fast Guest Checkout */

This should solve your problem, report back if it didn't.

Link to comment
Share on other sites

Hi Jonas

 

Many thanks for your prompt help and such a great add on.

 

I checked as suggested and had to resort to copy and paste the new code in the appropriate place of the original application_top.php. I then did a file compare using Winmerge and there was no apparent difference. So I uploaded the application_top which came with addon.The previous problem reappeared, so I changed back to the ammended application-top.php and again all was well. So I have no idea why the packaged application-top didn't work work for me.

 

Again many thanks for your wonderful hlp and the addon.

 

Kind regards

Grandpa

Edited by grandpaj
Link to comment
Share on other sites

Hi Jonas

 

Many thanks for your prompt help and such a great add on.

 

I checked as suggested and had to resort to copy and paste the new code in the appropriate place of the original application_top.php. I then did a file compare using Winmerge and there was no apparent difference. So I uploaded the application_top which came with addon.The previous problem reappeared, so I changed back to the ammended application-top.php and again all was well. So I have no idea why the packaged application-top didn't work work for me.

 

Again many thanks for your wonderful hlp and the addon.

 

Kind regards

Grandpa

 

No problem Grandpa, glad I could help! :thumbsup:

Link to comment
Share on other sites

hi Jonas

 

Just a quick question.(probably silly) But will jQuery/Ajax Fast checkout/Shopping Cart/Login/Create Account 2.3.3 and

jQuery/Ajax Dynamic Checkout 2.3.3 run together.

 

I have installed Ajax Dynamic Checkout and I like the way it makes the checkout pages a lottle more interesting. And would like to install the one Fast Checkout part of jquery/Ajax Fast checkout/Shopping Cart . . ., But not sure if they will run together

 

Many thanks

Grandpa

Link to comment
Share on other sites

hi Jonas

 

Just a quick question.(probably silly) But will jQuery/Ajax Fast checkout/Shopping Cart/Login/Create Account 2.3.3 and

jQuery/Ajax Dynamic Checkout 2.3.3 run together.

 

I have installed Ajax Dynamic Checkout and I like the way it makes the checkout pages a lottle more interesting. And would like to install the one Fast Checkout part of jquery/Ajax Fast checkout/Shopping Cart . . ., But not sure if they will run together

 

Many thanks

Grandpa

 

Hi Grandpa,

 

I'm pretty sure that they will not interfere with each other, so I would say go ahead and try.

Otherwise, if something goes wrong, you can always post here. ;)

 

Best regards,

Jonas

Link to comment
Share on other sites

Thank you all for your great contribution. I'm planning to implement it to my webshop but before I do I would like to know some little details.

 

On my webshop I now have a discount option which works great. Is it possible that this one still works after implementation of this addon?

 

It is this one: http://addons.oscommerce.com/info/7644

 

Thanks for all the replies

Link to comment
Share on other sites

Thank you all for your great contribution. I'm planning to implement it to my webshop but before I do I would like to know some little details.

 

On my webshop I now have a discount option which works great. Is it possible that this one still works after implementation of this addon?

 

It is this one: http://addons.oscommerce.com/info/7644

 

Thanks for all the replies

 

Hello Pascal H.,

 

I don't use the "Discount Coupon Codes" Add-On myself but after a quick glance at the installations instructions my best guess is that in best case scenario, installing this Add-On above a shop with the Discount Add-On might work as in not producing errors and the customer can maybe successfully complete an order with the Fast Checkout page.

 

However, in order to make the Fast Checkout Add-On compatible with discount coupons, you need to make modifications to the code.

 

I don't think that the required changes are that difficult to make, so if you have the time & will, then make a backup of your system before you proceed and then try to install this Add-On on your current code. When you're done; try to place an order with both the normal checkout process and then with the fast checkout process. If that worked without errors then you should take a look at the installation instructions again for the Discount Coupon Codes Add-On that you have already made.

 

In the instructions look for the changes made to the following files:

catalog/checkout_confirmation.php

catalog/checkout_process.php

catalog/checkout_payment.php

 

Now, open ./ajax/classes/ajaxManagerTest.class.php

In this file you need to redo the same modifications that you made to all those three files. The code in ajaxManagerTest.class.php are in many places similar or more or less identical to the code you found in the three checkout_*.php files. Look at the name of the functions in ajaxManagerTest.class.php, they will give a clue on where in the file you should look.

 

If you have a demo site with the discount Add-On installed, you could PM me the address if you want. Then I can take a look on what exactly the checkout process look like. But by the look of it, all you need is a textfield where the customer enters a discount code and then add code that validates it with the database? If it's not valid, an error message is displayed otherwise the discount will be visible in the "Order total" area and when the customer confirms the order the discount code will be marked as consumed/used in the database?

 

If you decide to try to install both Add-Ons and run into problems, just post them here and I will do my best to help you get it working.

 

Also, to make it a bit easier on yourself, make sure that Guest Checkout in the Fast checkout Admin menu is set to false to begin with and skip the "Step #9 - in ./includes/classes/order.php" in the installation instructions. If you need the Guest Checkout option it's probably easier to fix this after you get the Add-On running without it.

 

There's probably a lot of other people that would want the Fast Checkout & Discount Coupon Codes Add-On:s to be compatible so you would do them a favor as well. ;)

 

// Jonas

Link to comment
Share on other sites

hi Jonas

 

Just a quick question.(probably silly) But will jQuery/Ajax Fast checkout/Shopping Cart/Login/Create Account 2.3.3 and

jQuery/Ajax Dynamic Checkout 2.3.3 run together.

 

I have installed Ajax Dynamic Checkout and I like the way it makes the checkout pages a lottle more interesting. And would like to install the one Fast Checkout part of jquery/Ajax Fast checkout/Shopping Cart . . ., But not sure if they will run together

 

Many thanks

Grandpa

Hi Jonas

 

It seems that the AjaxDynamic checkout seems to cause problems when clicking on a product in the Product info page as when the pic is clicked to enlarge, a new window is opened showing the larger image on a black background.

What I found was if I deleted

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

from template top the images when clicked on the product info page rendered correctly.

 

Any thougts on how I could correct this.

 

Many thanks

Grandpa

Link to comment
Share on other sites

Hi Jonas

 

It seems that the AjaxDynamic checkout seems to cause problems when clicking on a product in the Product info page as when the pic is clicked to enlarge, a new window is opened showing the larger image on a black background.

What I found was if I deleted

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

from template top the images when clicked on the product info page rendered correctly.

 

Any thougts on how I could correct this.

 

Many thanks

Grandpa

 

Hello Grandpa J.,

 

Nice little store you have by the way, I wish I was not so old anymore anymore so I could play with some of your toys. :P

 

What I found was if I deleted

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

from template top the images when clicked on the product info page rendered correctly.

If this is the case, are your sure that you replaced the code mentioned in step #11, and not just added the new code while letting the old code remain?

 

Also, did you copy the new fancybox files from the package and replaced the code mentioned last in step #11?

 

You probably did something wrong with the template_top.php file, which is easy to fix.

Look at the template_top.php provided in the package and then compare it to the one you have.

 

jQuery should be loaded first, then jQuery-Ui and after that the fancybox-plugin.

 

I see now in the installation instructions that I forgot to mention to change the version of the fancybox CSS file as as well.

 

So in the ./includes/template_top.php, change the code that probably look like this:

<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-1.3.4.css" />
<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>

To this:

<link rel="stylesheet" type="text/css" href="ext/jquery/fancybox/jquery.fancybox-2.1.4.css" />
<script type="text/javascript" src="ext/jquery/fancybox/jquery.fancybox-2.1.4.pack.js?1100"></script>

 

If you have a link to your demo site, you could PM it to me so I can see what the error is. The easiest way for you to debug this yourself is by using the built in Developer Javascript Toolbar in Google Chrome Browser.

Open it by pressing "View" => "Developer" => "Javascript Toolbar". Then reload your page and look for errors. You can also press the "Sources" tab and then press on the little arrow to the left so you can see which files are loaded under the new "Sources-" tab.

Link to comment
Share on other sites

Hi

 

Have completely started all over again, Will the above be fully compatible with V2.3.3.4 in other words straight over write of files.

 

Chaares

Grandpa

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