Jump to content
Dr. Rolex

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

Recommended Posts

I have sorted the location problem. The only thing left is to capitalize the postcode and to bring the address up from postcode, this would be the final thing I am looking for and I must say a really big thank you for the help so far :)

Share this post


Link to post
Share on other sites

if you check the testing place you will see what a mean by the location. I had followed all the instructions as above. http://cotton-nappyservice.org.uk/ajax_checkout.php

For me it worked great, I could create an account and go all the way to confirming the order. I also tested the guest checkout and that worked as well.

 

However, this error came up when I visited your site:

GET http://cotton-nappyservice.org.uk/ext/jquery/jquery-1.8.6.min.js 404 (Not Found)

 

You have probably not done the steps for ./includes/template_top.php properly.

Change the line that looks something like this:

<script type="text/javascript" src="ext/jquery/jquery-1.8.6.min.js"></script>

To this:

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

You should also change the line that look something like this:

<script type="text/javascript" src="ext/jquery/ui/jquery-ui-1.8.22.min.js"></script>

To this:

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

 

Download Google Chrome if you don't already have it and then go to the menu: View => Developer => Javascript console

Reload your page and you will see these errors, that is always the first to check when something goes wrong. After that you should look in you Apache log for errors.

 

If it's not your server, you can sometimes do this by changing this line in ./includes/application_top.php:

error_reporting(E_ALL & ~E_NOTICE);

To this:

error_reporting(E_ALL);
ini_set('display_errors', '1');

 

Do not do this on a production server.

 

 

Edit: You can also try changing this text boxcart_quantity in ./ajax/ajaxManager.js to cart_quantity .

Edited by Dr. Rolex

Share this post


Link to post
Share on other sites

I have sorted the location problem. The only thing left is to capitalize the postcode and to bring the address up from postcode, this would be the final thing I am looking for and I must say a really big thank you for the help so far :)

 

No problem! :thumbsup:

 

You mean, that when you have entered a postcode, then the city/suburb will appear automatically?

If so, I already have that on my shop. The thing is that you need a list or something similar with all the postcodes and matching cities which you can upload to your database.

 

Then it's not that hard to implement javascript code that selects the city from the list and adds it to the field. I was able to "borrow" mine from the national statistics institution, which I convereted to a SQL file and uploaded.

 

Perhaps I misunderstood you and it was something else you meant but otherwise, but if you or somebody else want this then start with creating a new table by running the following SQL code on your database:

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `postcode` (
`postal_code` mediumint(5) unsigned NOT NULL,
`locality` varchar(19) NOT NULL,
PRIMARY KEY (`postal_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

Then you need to fill it with postal codes and a matching City/Suburb/Area.

Share this post


Link to post
Share on other sites

no its the UK Postcode Lookup Address Completion where you put in a postcode it lists all the address at that postcode and you select the correct one, it then fills in the relevant fields :)

Oh, OK. I think I tried that Add-On but didn't that cost money?

 

I'm sure it's great and all but aren't the British addresses free for anyone to obtain? If you can get a PDF, Document or similar with the British addresses, then perhaps I can help you with it.

Sometimes you can buy these from the national postal office (which should be Royal Mail for the UK) or maybe the "Yellow Pages" type of company.

Edited by Dr. Rolex

Share this post


Link to post
Share on other sites

Yes it does cost money but you get so many addresses free, this is the addon I am looking for. To obtain millions of address the file will be very large. So linking into the postcode system will be much easier.

Share this post


Link to post
Share on other sites

On the http://cotton-nappyservice.org.uk/ajax_checkout.php (Firefox), I had to re do the site and I cant seem to get the captcha to work even though I totally followed your instructions as before??

Di you get this error after modifying the code?:

Warning: Cannot modify header information - headers already sent by (output started at /home/cottonna/public_html/includes/application_top.php:525) in /home/cottonna/public_html/includes/functions/general.php on line 49

 

If so, can you tell me what kind of function/code you have at those lines?

./includes/application_top.php, line 525

- AND -

./includes/functions/general.php on line 49

Share this post


Link to post
Share on other sites

./includes/application_top.php, line 525 = ?> and ./includes/functions/general.php, line 49 = header('Location: ' . $url);

 

If you don't already use it, then you should download a file diff program like WinMerge (if you're using Windows) or use FileMerge/Kaleidoscope (If you're using Mac)

It's free: http://sourceforge.net/projects/winmerge/

 

After you have downloaded and started WinMerge, put the original file (start with ajaxManagerTest.class.php) in one field and then you're modified file in the other.

WinMerge will find all modifications you have done, so from there it should be easy to find what the error is.

 

If you have done modifications to ./includes/functions/general.php and ./includes/application_top.php, then check them first. This might be an error from that you have ended the PHP with an erroneous ?>. But it can also be a lot of other things.

Edited by Dr. Rolex

Share this post


Link to post
Share on other sites

Why am I getting this error when I try to do guest checkout

 

Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in/home/content/includes/functions/sessions.phpon line 181

 

Everything else seems to work but that error is there and there is no confirm button

Share this post


Link to post
Share on other sites

Should I not have just copied all the files over and done the edits instead? If so why are the files included?

 

Might be something wrong with your server, a setting that isn't enabled or something similar.

 

Go to settings i the admin panel, then Sessions and try to set Recreate Session to off and see if that helps.

 

Otherwise, in ajaxManagerTestClas.php around line 3177, find and comment this line:

tep_session_recreate();

You might also need to uncomment the two lines below that one.

 

Try one step at a time and you'll solve it.

Share this post


Link to post
Share on other sites

I have just installed this great add-on, but I am encountering a problem:

 

When I try to click on the plus/minus buttons on the checkout page, the quantity is not changed. Instead my whole page gets loaded again just beneath the article list. I guess the response to the ajax request is the whole page instead of just the cart list with the updated quantity?

 

Has anybody else encountered this problem?

 

I am running with the latest jquery and jqueryui versions and have tried to solve it on my own. Just cannot seem to find the solution...

 

Many thanks for your answers :)

 

Below a screenshot where you can see, how the page is loading (there are no product images because it is on a development server...):

 

http://i41.tinypic.com/30t6wpk.jpg

Edited by rafhun

Share this post


Link to post
Share on other sites

Just tried it on a newer install with a few modifications.

Here is the error I receve

PHP Parse error:  syntax error, unexpected '}' in /ajax/classes/ajaxManagerTest.class.php on line 1551, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

You can see the error here: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

Not sure what is going on.

 

The Fast Checkout screen shows

[color=#000000][font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2]javascript_validation(); ?>[/size][/font][/color]

Share this post


Link to post
Share on other sites

I have just installed this great add-on, but I am encountering a problem:

 

When I try to click on the plus/minus buttons on the checkout page, the quantity is not changed. Instead my whole page gets loaded again just beneath the article list. I guess the response to the ajax request is the whole page instead of just the cart list with the updated quantity?

 

Has anybody else encountered this problem?

 

I am running with the latest jquery and jqueryui versions and have tried to solve it on my own. Just cannot seem to find the solution...

 

Many thanks for your answers :)

 

Below a screenshot where you can see, how the page is loading (there are no product images because it is on a development server...):

 

http://i41.tinypic.com/30t6wpk.jpg

 

Hello Newburns,

 

Sorry for the late reply, I have been away for a couple of weeks.

 

Does line 1551 of ajaxManagerTest.php look something like this:

}
}
}
}

 

If so, try to remove one of them or try to add one to see if you get things working. You could also try comparing the original file with the one you use with a program like Winmerge or Filemerge to see what you have changed.

 

Best regards,

Jonas

Share this post


Link to post
Share on other sites

I have just installed this great add-on, but I am encountering a problem:

 

When I try to click on the plus/minus buttons on the checkout page, the quantity is not changed. Instead my whole page gets loaded again just beneath the article list. I guess the response to the ajax request is the whole page instead of just the cart list with the updated quantity?

 

Has anybody else encountered this problem?

 

I am running with the latest jquery and jqueryui versions and have tried to solve it on my own. Just cannot seem to find the solution...

 

Many thanks for your answers :)

 

Below a screenshot where you can see, how the page is loading (there are no product images because it is on a development server...):

 

http://i41.tinypic.com/30t6wpk.jpg

 

Hello Rafun,

 

Open the page in Google Chrome. Activate the Developers toolbar and go to the tab "Console". Right click and select "Preserve log.." and then press "Clear Console" and finally reload the page to see what kind of errors you're getting. This sounds like a Javascript error.

 

Best regards,

Jonas

Share this post


Link to post
Share on other sites

@@Dr. Rolex

This is the original file from the latest download. I did not make any changes to the original.

Is your standard one different from this?

Again, this is the latest download from addons.oscommerce

ajaxManagerTest.class.php

Edited by newburns

Share this post


Link to post
Share on other sites

@@Dr. Rolex

I have reestablished my installation with the addon so that you can see what I mean. Add something to the cart and try to do a fast checkout.

Share this post


Link to post
Share on other sites

@@Dr. Rolex

I have reestablished my installation with the addon so that you can see what I mean. Add something to the cart and try to do a fast checkout.

 

No problem Newburns, we'll figure this one out.

 

You can start with fixing these errors:

 

GET http://mtrosemedia.org/store_staging/images/20131110%20You%20can%20do%20it,%20it%20takes%20Discipline.jpg 404 (Not Found) ajax_checkout.php:391
GET http://mtrosemedia.org/store_staging/images/20130512-The%20faith%20of...jpg 404 (Not Found) ajax_checkout.php:392
GET http://mtrosemedia.org/store_staging/images/20131110%20You%20can%20do%20it,%20it%20takes%20Discipline.jpg 404 (Not Found) ajax_checkout.php:391
GET http://mtrosemedia.org/store_staging/ajax/ajaxManager.php?osCsid=r0rhou90j756u13dmh9ss115g2 500 (Internal Server Error) requester.js?1308:74
Requester.loadURL requester.js?1308:74
ajaxSendRequest ajaxManager.js?1308:100
ajaxRefresh ajaxManager.js?1308:114
ajaxManagerInit ajaxManager.js?1308:17
goonload ajax_checkout.php:76
onload

 

Also, if you can't access your apache error log easily you could do this in ./includes/application_top.php and then report back the errors you're getting. (NEVER DO THIS ON A LIVE SHOP!)

 

Find this code:

error_reporting(E_ALL & ~E_NOTICE);

Change to:

// error_reporting(E_ALL & ~E_NOTICE);
error_reporting(E_ALL);
ini_set('display_errors', '1');

Share this post


Link to post
Share on other sites

@@Dr. Rolex

I can get to the error_logs without any problems.

I fixed the images. I didn't tackle the images just yet because the live site loads fine. I am still receiving this error with your add-on.

PHP Parse error:  syntax error, unexpected '}' in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1551, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

Are you sure that the ajaxManagerTest.class.php is the exact one you are using in production?

Could this be related to jQuery version? I don't see how, but...

Share this post


Link to post
Share on other sites

@@Dr. Rolex

I can get to the error_logs without any problems.

I fixed the images. I didn't tackle the images just yet because the live site loads fine. I am still receiving this error with your add-on.

PHP Parse error: syntax error, unexpected '}' in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1551, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

Are you sure that the ajaxManagerTest.class.php is the exact one you are using in production?

Could this be related to jQuery version? I don't see how, but...

 

Try changing this in ajaxManagerTest.class.php, beginning around line 1548:

}
}
}

To this:

}
}
}
}

 

And no, this has nothing to do with the jQuery/jQuery UI versions. And no, unfortunately our files don't match since I have done a lot of Specific-For-My-Site-Changes to them.

It's really all a mess in my head right now since I haven't coded much the last weeks, more like drinking and so on... BUT don't you despair, this is a easy fix (eventually), so just keep me posted on what happens! (w00t)

 

If you want to do something a bit crazy (which i bet you're eager to do since you have worked on this evil computer error for what you (probably) think is way too long now..):

Remove or comment out the entire function showPlaceOrder($get) and see if this fixes the problem. If it does, then you just have to play around with the brackets (= } ) until you get it to work.

Edited by Dr. Rolex

Share this post


Link to post
Share on other sites

The addition of "}" results in

<!--msg box Spinning confirmation -->
    <div id="order_submitted" class="modal2">
		    <div class="modal3 ui-corner-all"><p><strong><?php echo ORDER_LO$
    </div>
    <div class="ui-widget infoBoxContainer">
		    <span class="ui-widget-content ui-corner-all" id="TheSubmitButto$
		    <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'primary', 'o$

		    <span class="ui-widget-content ui-corner-all" id="TheDisabledBut$
				    <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'seco$
    </div>
    <div style="clear: both;"></div>
    <?php
						    }
				    }
		    }
    }
}
}

With error

PHP Parse error:  syntax error, unexpected '}' in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1551, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

The removal of "}" results in code

<!--msg box Spinning confirmation -->
    <div id="order_submitted" class="modal2">
		    <div class="modal3 ui-corner-all"><p><strong><?php echo ORDER_LO$
    </div>
    <div class="ui-widget infoBoxContainer">
		    <span class="ui-widget-content ui-corner-all" id="TheSubmitButto$
		    <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'primary', 'o$

		    <span class="ui-widget-content ui-corner-all" id="TheDisabledBut$
				    <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'seco$
    </div>
    <div style="clear: both;"></div>
    <?php
						    }
				    }
		    }

with an error

PHP Parse error:  syntax error, unexpected T_ELSE in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1752, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

Share this post


Link to post
Share on other sites

@@Dr. Rolex

And you can confirm that the php I loaded is the same as your production. I did a compare in Notepad++ and it shows no differences. Wondering if what you are using is different from the addons.oscommerce repository.

 

Also, could it be a different setting? Like I've said before.

[color=#000000][font='Lucida Grande', 'Lucida Sans', Verdana, Arial, sans-serif][size=2]javascript_validation(); ?>[/size][/font][/color]

sits at the top of the browser as if a php tag is missing. Did you use short tags? I don't believe I have that enabled.

Edited by newburns

Share this post


Link to post
Share on other sites

The addition of "}" results in

<!--msg box Spinning confirmation -->
 <div id="order_submitted" class="modal2">
		 <div class="modal3 ui-corner-all"><p><strong><?php echo ORDER_LO$
 </div>
 <div class="ui-widget infoBoxContainer">
		 <span class="ui-widget-content ui-corner-all" id="TheSubmitButto$
		 <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'primary', 'o$

		 <span class="ui-widget-content ui-corner-all" id="TheDisabledBut$
				 <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'seco$
 </div>
 <div style="clear: both;"></div>
 <?php
						 }
				 }
		 }
 }
}
}

With error

PHP Parse error: syntax error, unexpected '}' in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1551, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

 

The removal of "}" results in code

<!--msg box Spinning confirmation -->
 <div id="order_submitted" class="modal2">
		 <div class="modal3 ui-corner-all"><p><strong><?php echo ORDER_LO$
 </div>
 <div class="ui-widget infoBoxContainer">
		 <span class="ui-widget-content ui-corner-all" id="TheSubmitButto$
		 <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'primary', 'o$

		 <span class="ui-widget-content ui-corner-all" id="TheDisabledBut$
				 <?php echo draw_button(IMAGE_BUTTON_CONFIRM_ORDER, 'seco$
 </div>
 <div style="clear: both;"></div>
 <?php
						 }
				 }
		 }

with an error

PHP Parse error: syntax error, unexpected T_ELSE in /var/www/store_staging/ajax/classes/ajaxManagerTest.class.php on line 1752, referer: http://mtrosemedia.org/store_staging/ajax_checkout.php

Try to remove the entire goddamn function then to if it works then. If so we will concentrate on the damn brackets...

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

×