Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 5th, 2008, 02:19 PM
Registered User
 
Join Date: Sep 2008
Location: , , .
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!

Reply With Quote
  #2 (permalink)  
Old September 5th, 2008, 02:43 PM
Registered User
 
Join Date: Sep 2008
Location: Lossiemouth, , United Kingdom.
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
Reply With Quote
  #3 (permalink)  
Old September 7th, 2008, 11:53 AM
Registered User
 
Join Date: Sep 2008
Location: , , .
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.
Reply With Quote
The Following User Says Thank You to repero For This Useful Post:
bell1945 (March 18th, 2009)
  #4 (permalink)  
Old March 16th, 2009, 10:33 AM
Wrox Author
 
Join Date: May 2008
Location: Austin, TX, USA.
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
Reply With Quote
  #5 (permalink)  
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??
Reply With Quote
  #6 (permalink)  
Old June 3rd, 2009, 06:56 AM
Wrox Author
 
Join Date: May 2008
Location: Austin, TX, USA.
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
Reply With Quote
  #7 (permalink)  
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";
Reply With Quote
  #8 (permalink)  
Old November 1st, 2009, 05: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.
Reply With Quote
  #9 (permalink)  
Old November 3rd, 2009, 11:36 AM
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?

Reply With Quote
  #10 (permalink)  
Old November 3rd, 2009, 12: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 03:59 PM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shopping Cart seannie ASP.NET 2.0 Basics 0 December 12th, 2006 09: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 02: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



All times are GMT -4. The time now is 01:55 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.