When account is not activated automatically...

This area is devoted to Multiple Wishlists. Please ask questions, report bugs and share ideas here.

When account is not activated automatically...

Postby tester123 » Wed Apr 06, 2016 6:30 am

I am using another extension that prevents customer accounts from being activated automatically (Amasty). The extension works fine but if I set the extension to "not activate customer after registration" the MultipleWIshlist extension throws an error which prevents the user from logging in. After a bit of digging I found that MW is trying to insert a "Main" wishlist for the new customer id. But before the customer is activated the customer id is not being returned. I was able to solve this problem by changing the following function located at Model/Mwishlistnames.php

Original:
Code: Select all
   public function checkMainWishlist($customerId) {
      $mainWishlist = $this->db->fetchOne("SELECT multiwishlist_id  FROM {$this->table} WHERE `multiwishlist_customer_id` = {$customerId}  and multiwishlist_is_main = 1");
      if (empty($mainWishlist)) {
         $editable = Itoris_MWishlist_Model_Mwishlistnames::WISHLIST_EDITABLE;
         $this->db->query("INSERT INTO {$this->table} (`multiwishlist_name`, `multiwishlist_customer_id`, `multiwishlist_editable`, `multiwishlist_is_main`) VALUES ('Main', $customerId, {$editable}, 1)");
         $mainWishlist = $this->db->lastInsertId();
      }
      return $mainWishlist;
   }


Modified:
Code: Select all
   public function checkMainWishlist($customerId) {
      $mainWishlist = $this->db->fetchOne("SELECT multiwishlist_id  FROM {$this->table} WHERE `multiwishlist_customer_id` = {$customerId}  and multiwishlist_is_main = 1");
      /*
         added check for customerId ==0 because of customer activation plugin
      */
      if (empty($mainWishlist) and $customerId!=0) {
         $editable = Itoris_MWishlist_Model_Mwishlistnames::WISHLIST_EDITABLE;
         $this->db->query("INSERT INTO {$this->table} (`multiwishlist_name`, `multiwishlist_customer_id`, `multiwishlist_editable`, `multiwishlist_is_main`) VALUES ('Main', $customerId, {$editable}, 1)");
         $mainWishlist = $this->db->lastInsertId();
      }
      return $mainWishlist;
   }



I wonder if this is something that should be incorporated into the code - else I just don't know how to do it properly within magento.

thanks.
tester123
 
Posts: 2
Joined: Wed Apr 06, 2016 6:24 am

Re: When account is not activated automatically...

Postby IToris team » Wed Apr 06, 2016 4:38 pm

Hi tester123,

We can't assist with Amasty's extension. But you can use our extension to prevent customer accounts from being activated automatically - Pending Registration.
https://www.itoris.com/magento-pending- ... ation.html

We guarantee compatibility between our extensions.

Best regards,
ITORIS Team
IToris team
Site Admin
 
Posts: 1686
Joined: Mon Jan 19, 2009 12:33 pm

Re: When account is not activated automatically...

Postby tester123 » Wed Apr 06, 2016 6:38 pm

I think you missed my point entirely. But that's okay.
tester123
 
Posts: 2
Joined: Wed Apr 06, 2016 6:24 am


Return to Multiple Wishlists

Who is online

Users browsing this forum: No registered users and 0 guests

cron