Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2015
    Posts
    165
    Plugin Contributions
    0

    Default Allow customers to leave review without logging in or being an existing customer

    How can we allow people to leave product reviews withour logging in or being annactual customer. Of course to fight spam, the approval setting would be on. Thank you.

  2. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Allow customers to leave review without logging in or being an existing customer

    Quote Originally Posted by travbacon View Post
    How can we allow people to leave product reviews withour logging in or being annactual customer. Of course to fight spam, the approval setting would be on. Thank you.
    If you insist:

    Load the file
    /includes/modules/pages/product_reviews_write/header.php into a text editor

    Find this code:
    Code:
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
     zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    Comment it out, like so:
    Code:
    // if (!$_SESSION['customer_id']) {
    //  $_SESSION['navigation']->set_snapshot();
    // zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    // }
    Save the file.

    Don't blame me if this comes back to bite you. With this code commented out, anyone can post anything. The zencart code *should* sanitize any 'dangerous' inputs, thus offering some degree of protection, and I suspect your biggest problem is going to be due to hackers and scammers hammering the server looking for a weakness that they can exploit.

    Cheers
    RodG

  3. #3
    Join Date
    Dec 2011
    Location
    Wisconsin, USA
    Posts
    674
    Plugin Contributions
    21

    Default Re: Allow customers to leave review without logging in or being an existing customer

    Quote Originally Posted by RodG View Post
    If you insist:

    Load the file
    /includes/modules/pages/product_reviews_write/header.php into a text editor

    Find this code:
    Code:
    if (!$_SESSION['customer_id']) {
      $_SESSION['navigation']->set_snapshot();
     zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    }
    Comment it out, like so:
    Code:
    // if (!$_SESSION['customer_id']) {
    //  $_SESSION['navigation']->set_snapshot();
    // zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
    // }
    Save the file.

    Don't blame me if this comes back to bite you. With this code commented out, anyone can post anything. The zencart code *should* sanitize any 'dangerous' inputs, thus offering some degree of protection, and I suspect your biggest problem is going to be due to hackers and scammers hammering the server looking for a weakness that they can exploit.

    Cheers
    RodG
    I'v seen this done where the merchant sends out an email 2 weeks after the order to get a review and then they are directed to place a review. The customer email is in the return URL, and then ZenCart looks up the customer number and the saves it in the $_SESSION['customer_id'] variable.

    You would need to make sure your coding is SUPER SUPER sound, and can't be injected with this type of thing.

    I'm not sure on the PCI implications of this...

  4. #4
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Allow customers to leave review without logging in or being an existing customer

    Just wondering, Why would someone want to come to your site and leave a review of something they didnt purchase?
    Zen cart PCI compliant Hosting

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,472
    Plugin Contributions
    88

    Default Re: Allow customers to leave review without logging in or being an existing customer

    Quote Originally Posted by Merlinpa1969 View Post
    Just wondering, Why would someone want to come to your site and leave a review of something they didnt purchase?
    Perhaps because they used either COWOA (check out without an account) or PayPal Express Checkout to place the order? In either case, the customer will have made a purchase but won't have a "proper" account as required to create a review.

  6. #6
    Join Date
    Nov 2006
    Location
    Sydney, Australia
    Posts
    458
    Plugin Contributions
    1

    Default Re: Allow customers to leave review without logging in or being an existing customer

    I followed the suggestion in this thread and I am now getting an Error Log every time someone goes the a product_review_write page, even if they don't write a review!!

    Code:
    [16-Aug-2021 16:55:19 Australia/Sydney] Request URI: /index.php?main_page=product_reviews_write&cPath=1&products_id=20, IP address: 60.
    #1  require(/includes/modules/pages/product_reviews_write/header_php.php) called at [/index.php:35]
    --> PHP Notice: Undefined index: customer_id in /includes/modules/pages/product_reviews_write/header_php.php on line 40.
    
    [16-Aug-2021 16:55:20 Australia/Sydney] Request URI: /index.php?main_page=product_reviews_write&cPath=1&products_id=20, IP address: 60.
    #1  require(/includes/templates/responsive_classic/templates/tpl_product_reviews_write_default.php) called at [/includes/templates/responsive_classic/common/tpl_main_page.php:178]
    #2  require(/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/index.php:94]
    --> PHP Notice: Undefined index: customers_firstname in /includes/templates/responsive_classic/templates/tpl_product_reviews_write_default.php on line 43.
    
    [16-Aug-2021 16:55:20 Australia/Sydney] Request URI: /index.php?main_page=product_reviews_write&cPath=1&products_id=20, IP address: 60.
    #1  require(/includes/templates/responsive_classic/templates/tpl_product_reviews_write_default.php) called at [/includes/templates/responsive_classic/common/tpl_main_page.php:178]
    #2  require(/includes/templates/responsive_classic/common/tpl_main_page.php) called at [/index.php:94]
    --> PHP Notice: Undefined index: customers_lastname in /includes/templates/responsive_classic/templates/tpl_product_reviews_write_default.php on line 43.
    I know it's because I commented out the above so guest can write a review, but is there a way to stop that error log from being generated?!

    Thanking you in advance.
    *Zen Cart eCommerce Solution - Putting the Dream of Owning an Online Business within reach of anyone!

  7. #7
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,133
    Plugin Contributions
    11

    Default Re: Allow customers to leave review without logging in or being an existing customer

    Doing six year old code changes is hardly ever a good idea.

 

 

Similar Threads

  1. Leave Product Review without Login in?
    By rlexyd in forum General Questions
    Replies: 24
    Last Post: 22 Aug 2021, 11:28 PM
  2. Replies: 2
    Last Post: 14 Nov 2013, 05:30 AM
  3. Replies: 2
    Last Post: 22 Aug 2011, 09:20 PM
  4. Replies: 0
    Last Post: 24 Jul 2008, 06:53 AM

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