Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Viewing/Editing a customer's product notification selections

    It's possible I'm missing this in documentation somewhere, but I haven't been able to find the answer.

    How can I change or at least view which products a customer has requested notifications for?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Viewing/Editing a customer's product notification selections

    Quote Originally Posted by herg View Post
    It's possible I'm missing this in documentation somewhere, but I haven't been able to find the answer.

    How can I change or at least view which products a customer has requested notifications for?
    I don't recall there being an "admin" panel option to see what for products/customers have selected notification; however, the data is maintained in the database and can be reviewed there in the (DB_PREFIX)products_notifications table. Where (DB_PREFIX) is replaced with the database prefix for your installation.

    The FAQ section of this site has a brief discussion about product notifications: http://www.zen-cart.com/content.php?...on-system-work

    There are some "ways" around the system, for example there is at least one plugin that allows logging into the store side as a specific user using an admin assigned password, this would allow entering a user's account and reviewing the options selected. Otherwise, the expectation is that you make the notifications that you make for the product(s) and those that have selected to receive them will, and those that have not will not. Of course this means perhaps no one has requested notification and the effort is for nothing, but the thought is it is something you will do anyways so just do it... :)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Mar 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Re: Viewing/Editing a customer's product notification selections

    Quote Originally Posted by mc12345678 View Post
    I don't recall there being an "admin" panel option to see what for products/customers have selected notification; however, the data is maintained in the database and can be reviewed there in the (DB_PREFIX)products_notifications table. Where (DB_PREFIX) is replaced with the database prefix for your installation.
    Thanks. I ended up writing a bit of code to add the queries and display them in admin for each customer's page. What I did was very brute force and is too inefficient to use if you have a lot of customers or products. It works well for my needs, though.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Viewing/Editing a customer's product notification selections

    Quote Originally Posted by herg View Post
    Thanks. I ended up writing a bit of code to add the queries and display them in admin for each customer's page. What I did was very brute force and is too inefficient to use if you have a lot of customers or products. It works well for my needs, though.
    Glad that a solution was obtained. To further discuss the topic, it would be wrong for me not to express a concern that has yet to be identified in this thread. The issue of "modifying" a customer's notification, hopefully here we are primarily discussing the removal of a notification in order to comply with a customer's emailed/notified request to be removed from a distribution list. (Emails sent out indicate to notify the store to remove a customer from the list(s), but as identified there does not appear to be a method to do so from the admin panel of a clean install without the writing of SQL code to remove a specific individual.) :/ of course the customer can return to the site and modify the settings for their own account, but it is not possible to do so "easily" by the admin.

    Now I can also see a need to add a customer to a distribution/notification list if the initial approval was to be notified about certain things that became other notification lists and each of the other things' notification list was independently maintained.

    But to blindly add a notification to a customer without the customer's acceptance seems wrong. I don't know if or what is violated, but doesn't seem like good business. And I am not stating that this is what is being done, it hasn't been discussed and the above is my own view point/opinion.

    That all said, maybe with the code shared a less brute force method could be developed and possibly incorporated into something more.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Mar 2014
    Location
    United States
    Posts
    9
    Plugin Contributions
    0

    Default Re: Viewing/Editing a customer's product notification selections

    I would agree that an admin should not manually add anyone to a list unless specifically requested. My changes only enable removing notifications.

    In my case, I have a few products that are often out of stock. Customers often want to know when they are back in stock, so that's when I send the notifications. I occasionally have customers ask why they didn't receive the notification, and I had no way to know if they had requested it. I think my lists are timing out before all the emails are sent, but that's for another thread. I have not yet had a request to be removed from a list, but if I did, I could not have done so.

    Sorry if this is bad form, but since the changes were limited to one file (customers.php), I'll post the changes here. Also, sorry for the hacked up formatting:

    Code:
    9/22/2014 9:13:52 AM
    Mode:  Differences with Context
    
    -----------------------------------------------------
    L262=R262	
    	        if (ACCOUNT_GENDER == 'true') $sql_data_array['customers_gender'] = $customers_gender;
    	        if (ACCOUNT_DOB == 'true') $sql_data_array['customers_dob'] = ($customers_dob == '0001-01-01 00:00:00' ? '0001-01-01 00:00:00' : zen_date_raw($customers_dob));
    	
    	        zen_db_perform(TABLE_CUSTOMERS, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "'");
    	
    -----------------------------------------------------
    L268	        //TODO: HLT - figure out which pn's to delete
    	        for($i=0; $i<=1000; $i++)
    	        {
    	                if(!isset($_POST['notify-' . $i]))
    	                {
    	                        $db->Execute("delete from " . TABLE_PRODUCTS_NOTIFICATIONS . "
    	                                        where customers_id = '" . (int)$customers_id . "' and products_id = '" . $i . "'");
    	                }
    	        }
    	                        
    -----------------------------------------------------
    L278=R268	        $db->Execute("update " . TABLE_CUSTOMERS_INFO . "
    	                      set customers_info_date_account_last_modified = now()
    	                      where customers_info_id = '" . (int)$customers_id . "'");
    	
    	        if ($entry_zone_id > 0) $entry_state = '';
    	
    	        $sql_data_array = array('entry_firstname' => $customers_firstname,
    -----------------------------------------------------
    L875=R865	    echo zen_draw_hidden_field('customers_newsletter');
    	  } else {
    	    echo zen_draw_pull_down_menu('customers_newsletter', $newsletter_array, (($cInfo->customers_newsletter == '1') ? '1' : '0'));
    	  }
    	?></td>
    	          </tr>
    -----------------------------------------------------
    L881	
    	
    	
    	
    	          <tr>
    	            <td class="main"><?php echo "Product Notifications"; ?></td>
    	
    	        <?php
    	                                $products = $db->Execute("select pd.products_id, pd.products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_NOTIFICATIONS . " pn where pn.customers_id = '" . $customers_id . "' and pn.products_id = pd.products_id order by pd.products_name");
    	                                ?>
    	                                <?php   
    	        while (!$products->EOF) {
    	        ?>
    	          <td class="main">
    	          <?php echo zen_draw_checkbox_field('notify-' . $products->fields['products_id'], '1', true, 'id="notify-' . $products->fields['products_id'] . '"'); ?>
    	                                        <label class="checkboxLabel" for="<?php echo 'notify-' . $products->fields['products_id']; ?>"><?php echo $products->fields['products_name']; ?></label>
    	          <?php
    	          $products->MoveNext();
    	          ?>
    	                </td>
    	          </tr>
    	          <tr>
    	          <td class="main"></td>
    	        <?php
    	        }
    	        ?>
    	
    	                        </tr>
    	
    	
    	
    	
    	
    
    -----------------------------------------------------
    L914=R871	          <tr>
    	            <td class="main"><?php echo ENTRY_PRICING_GROUP; ?></td>
    	            <td class="main">
    	<?php
    	  if ($processed == true) {
    	    if ($cInfo->customers_group_pricing) {
    	      $group_query = $db->Execute("select group_name, group_percentage from " . TABLE_GROUP_PRICING . " where group_id = '" . (int)$cInfo->customers_group_pricing . "'");
    Last edited by herg; 22 Sep 2014 at 02:34 PM.

 

 

Similar Threads

  1. Replies: 0
    Last Post: 21 Mar 2012, 09:20 PM
  2. How do I get customer attribute selections in order confirmation emails and admin?
    By zahid in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 24 Aug 2009, 11:51 AM
  3. Changing default setting on Customer Product Notification
    By ingoito in forum Customization from the Admin
    Replies: 4
    Last Post: 10 Feb 2009, 01:18 AM
  4. Viewing a customer's saved basket
    By hookah in forum General Questions
    Replies: 2
    Last Post: 3 Nov 2008, 10:11 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