Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2010
    Posts
    28
    Plugin Contributions
    0

    Default v156a Customers function trouble, and mysql_demo.sql has wrong data

    It seems that Admin->Customers functions has some bugs.
    I'm a php newbie, so I can't find them...

    I checked admin\customers.php, it seems that if I delete the customer who wrote reviews, the page will ask me how to treat the reviews(delete or not) and show the number of reviews.
    I tested many times but I never get the choice and information.

    admin\customers.php
    Line 1366-1367
    if (isset($cInfo->number_of_reviews) && ($cInfo->number_of_reviews) > 0)
    $contents[] = array('text' => '<br>' . zen_draw_checkbox_field('delete_reviews', 'on', true) . ' ' . sprintf(TEXT_DELETE_REVIEWS, $cInfo->number_of_reviews));


    I also checked the database during this test, and it seems that the demo data is not correct.

    zen-cart-v1.5.6a-01042019\zc_install\sql\demo\mysql_demo.sql

    Line 1504
    INSERT INTO reviews (reviews_id, products_id, customers_id, customers_name, reviews_rating, date_added, last_modified, reviews_read, status) VALUES (1, 19, 0, 'Bill Smith', 5, '2003-12-23 03:18:19', '0001-01-01 00:00:00', 11, 1);

    should be

    INSERT INTO reviews (reviews_id, products_id, customers_id, customers_name, reviews_rating, date_added, last_modified, reviews_read, status) VALUES (1, 19, 1, 'Bill Smith', 5, '2003-12-23 03:18:19', '0001-01-01 00:00:00', 11, 1);

  2. #2
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: v156a Customers function trouble, and mysql_demo.sql has wrong data

    You are right, something is missing.

    the reviews are missing form the $cInfo array, in the delete switch.

    The install sql should indeed be updatet to contain the corrcct customer_id

    I'll make a fix on github and let you know.

  3. #3
    Join Date
    Dec 2009
    Location
    Amersfoort, The Netherlands
    Posts
    2,846
    Plugin Contributions
    25

    Default Re: v156a Customers function trouble, and mysql_demo.sql has wrong data


  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,586
    Plugin Contributions
    30

    Default Re: v156a Customers function trouble, and mysql_demo.sql has wrong data

    Related:
    https://www.zen-cart.com/showthread....iews-correctly

    I decided that deleting a customer (and maybe leaving a gap in the database for related things to not point to anymore), was not a good idea.
    So I modified my shop to only replace the identifiable details of the customer and their orders with a "deleted..." note, and not delete the customer/order records, and also leave the reviews intact since they only have a forename shown with them.
    Steve
    github.com/torvista: Spanish Language Pack, Google reCaptcha, Structured Data, Multiple Copy-Move-Delete, Image Checker, BackupMySQL Admin/Auto...

 

 

Similar Threads

  1. v156 Why has my v156a started making sale items
    By bscho in forum General Questions
    Replies: 8
    Last Post: 20 Jan 2019, 05:14 AM
  2. Replies: 0
    Last Post: 15 Dec 2018, 02:31 PM
  3. Data Migration Nightmare/ SQL and Easy Populate
    By buddhaflow in forum General Questions
    Replies: 2
    Last Post: 13 Jan 2010, 03:24 PM
  4. Customers seeing wrong data in all sorts or places after restore
    By aeisecurity in forum General Questions
    Replies: 1
    Last Post: 2 Jun 2008, 05:48 PM
  5. What is quick way to delete customers and orders data?
    By doubletiger in forum General Questions
    Replies: 4
    Last Post: 8 Oct 2006, 05:10 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