Results 1 to 5 of 5
  1. #1

    How can I get a confirm message after adding to cart?

    Hi everybody!
    I set the "Display Cart After Adding Product" to false in Admin->My Store section,
    but I would like the client could see a message (with javascript for example) that confirms the product was successfull added to his shopping cart.
    Do someone have an idea how could I do that, for example using the same layer that appears to advise a form check failure while adding a product?
    If you could tell me at least which files to check I would appreciate very much
    Thank you

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I get a confirm message after adding to cart?

    You would need to add a message to the: init_cart_handler.php

    I would place it at the bottom of this IF statement:
    PHP Code:
      if (DISPLAY_CART == 'true') {
        
    $goto =  FILENAME_SHOPPING_CART;
        
    $parameters = array('action''cPath''products_id''pid''main_page');
      } else {
        
    $goto $_GET['main_page'];
        if (
    $_GET['action'] == 'buy_now') {
          
    $parameters = array('action''products_id');
        } else {
          
    $parameters = array('action''pid''main_page');
        }
        
    $messageStack->add_session('header'SUCCESS_PRODUCTS_ADDED_TO_CART'success');
      } 
    Then define the message: SUCCESS_PRODUCTS_ADDED_TO_CART

    Note: if time, I will play a bit with this for v1.3.6 as it would be helpful to have a meaning full message ... but I need to test based on errors and such what more may be needed under a baziilion conditions ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I get a confirm message after adding to cart?

    Note: test 1 item is not added due to error on required info ... you get the error message and the success message ...

    Best to manage this with a paramater deeper in the code ...

    Sorry to dash your hopes to heck ...

    But, I will look into this further ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4

    Default Re: How can I get a confirm message after adding to cart?

    Thank you for your attempt and test...you helped me to understand how a message is dispatched and where to start looking at.
    I changed the classes/shopping_cart.php file, adding the line of code with the message dispatch at the end of the "actionAddProduct" fuction, in case of no errors:

    Code:
    if ($the_list == '') {
    	  $messageStack->add_session('product_info', SUCCESS_PRODUCTS_ADDED_TO_CART, 'success');
    ...
    And it works

  5. #5
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How can I get a confirm message after adding to cart?

    Actually, to avoid the message showing when there are errors for various issues this had to be added to the shopping_cart class ...

    This has been added to the upcoming v1.3.6 to display a message when a product or products are added to the cart and the Display Shopping Cart is turned off ...

    NOTE: The message displayed can also be disabled just by setting the defines for the two messages to '' in the language file ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

 

 

Similar Threads

  1. v150 How can I stop page from going to header after adding to cart?
    By Newbie76 in forum General Questions
    Replies: 6
    Last Post: 3 Oct 2012, 07:08 PM
  2. Customer Login time out error after adding confirm email address addon
    By abs007 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Jan 2010, 08:02 PM
  3. How I can get rid or this warning message?
    By alhakeem2001 in forum General Questions
    Replies: 5
    Last Post: 13 Oct 2008, 09:43 AM
  4. How can I get people to confirm their email address?
    By sfklaas in forum General Questions
    Replies: 0
    Last Post: 1 May 2008, 01:37 AM
  5. How to get a JS message after adding to cart?
    By m_and_s in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Oct 2006, 12:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR