Wrox Programmer Forums
|
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 5th, 2008, 02:19 PM
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default Shopping cart doesn't update

When I change the counts in shopping cart and then hit update, it "updates" to the previous values and there is no status message as well.
I suppose the ajax_cart function doesn't load:
Code:
  var ajax = new Ajax.Updater(
    'ajax_msg','/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );
maybe because of the path? ajax_cart() is part of /controllers/welcome.php
Dunno what to do...
Any suggestions? Thanks!

 
Old September 5th, 2008, 02:43 PM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have exactly the same problem, only I don't think it's the Ajax call that's the problem. According to my FireFox error console I have an "empty string being passed to getElementById()" which is weird as there is no call to that function?!?!?

In addition when I click the update button on the shopping cart form I get a very brief 404 error message saying that the target page is not recognised on this server.

I have triple checked all the code against the download code and can't see what is wrong!!

If you come up with anything please let me know! (If I work it out I'll be sure to post here)

Regards,

Gordon
 
Old September 7th, 2008, 11:53 AM
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Got it! ...added "http://127.0.0.1/ClaudiasKids" (apply your folder name):

Code:
  var ajax = new Ajax.Updater(
    'ajax_msg','http://127.0.0.1/ClaudiasKids/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );

Or even better:
Code:
var ajax = new Ajax.Updater(
    'ajax_msg', base_url + '/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );


The same for "delete" etc.
The Following User Says Thank You to repero For This Useful Post:
bell1945 (March 18th, 2009)
 
Old March 16th, 2009, 10:33 AM
Wrox Author
 
Join Date: May 2008
Posts: 53
Thanks: 0
Thanked 5 Times in 5 Posts
Default

the base_url addition is a weird one. on my dev, test, and production servers, I don't need it at all. however, this easy fix has worked for various folks I've been emailing with. I'm not really sure what's happening here, maybe it has something to do with the way the different apache installs produce paths....?
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
 
Old June 2nd, 2009, 01:21 PM
Registered User
 
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by repero View Post
Got it! ...added "http://127.0.0.1/ClaudiasKids" (apply your folder name):

Code:
  var ajax = new Ajax.Updater(
    'ajax_msg','http://127.0.0.1/ClaudiasKids/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );
Or even better:
Code:
var ajax = new Ajax.Updater(
    'ajax_msg', base_url + '/welcome/ajax_cart', {method:'post',parameters:params,onComplete:showMessage}
    );
The same for "delete" etc.
i've tried it. It doesn't work for me.? Is there another suggestion??
 
Old June 3rd, 2009, 06:56 AM
Wrox Author
 
Join Date: May 2008
Posts: 53
Thanks: 0
Thanked 5 Times in 5 Posts
Default how is your environment set up?

Can you tell us more about your environment? I've found that depending on the paths I've had to fiddle with the Ajax paths.
__________________
Thomas Myer
Author, Professional CodeIgniter
http://www.tripledogs.com
 
Old June 3rd, 2009, 08:27 AM
Registered User
 
Join Date: May 2009
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this is my enviroment, mate :

Quote:
$config['base_url'] = "http://localhost/shopping";
 
Old November 1st, 2009, 06:10 AM
Authorized User
 
Join Date: Nov 2009
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Default Sometimes I have to click delete twice

Sometimes I have to click delete twice in order to delete an item.

Sometimes just once.

Could anyone tell me how to fix the problem?

Thanks in advance.
 
Old November 3rd, 2009, 12:36 PM
Authorized User
 
Join Date: Nov 2009
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Unhappy update and delete not working with CI 1.7.2

I just updated all the libraries, plugin etc to CI 1.7.2

And I found that updating and deleting shopping cart does not work.

Does anyone have any idea how to solve it?

 
Old November 3rd, 2009, 01:19 PM
Authorized User
 
Join Date: Nov 2009
Posts: 26
Thanks: 3
Thanked 0 Times in 0 Posts
Default I found the solution for updating to 1.7.2

I need to add the full path to welcome/ajax_cart.

Like this.
PHP Code:
var ajax = new Ajax.Updater(
    
'ajax_msg',
'http://127.0.0.1/codeigniter_shopping_copy2/index.php/welcome/ajax_cart',

{
method:'post',parameters:params,onComplete:showMessage
I tried using base_url but it did not work for me.

Is it because javascript?

Last edited by phpcoder101; November 4th, 2009 at 04:59 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Shopping Cart seannie ASP.NET 2.0 Basics 0 December 12th, 2006 10:28 AM
Shopping Cart quantity update problem j2 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 August 21st, 2006 02:39 PM
Shopping Cart inkrajesh ASP.NET 1.0 and 1.1 Basics 2 February 28th, 2006 03:08 AM
shopping cart isheikh BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 October 8th, 2004 04:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.