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
    64,886
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  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
    64,886
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 

Similar Threads

  1. Adding product options in the cart?
    By dianna11 in forum General Questions
    Replies: 6
    Last Post: 14 Sep 2006, 09:34 PM
  2. Adding attributes to add to cart
    By lucianman in forum General Questions
    Replies: 4
    Last Post: 16 Aug 2006, 04:51 PM
  3. take out weight when adding to shopping cart
    By magicfun in forum Customization from the Admin
    Replies: 4
    Last Post: 30 Jun 2006, 01:36 PM
  4. Replies: 7
    Last Post: 24 Jun 2006, 06:06 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
  •