Rebuild the verification page in opencart when sending a registered email as a verification request / basket

I have a requirement to rebuild the checkout page containing the most recently abandoned products.

If you have already entered the opencart consumer’s website and click this URL - http://www.example.com/index.php?route=checkout/cart , it will list all products in the basket (which have not been purchased yet)).

Without entering the consumer’s website, if someone directly hits this URL - http://www.example.com/index.php?route=checkout/cart& email=someone@example.com - he will list all the products that someone@example.com (also known as abandoned products/cart ) has not yet been purchased if someone@example.com is a registered user of the opencart website.

I want to transfer this email address from the URL as a query string to the checkout / cart page and use this to return the abandoned products for this client's email.

How can I take this email on the checkout / basket page and show the abandoned carts to the user?

I have a lot of new opencart for opencart , I know little about the functionality of the kernel, so I searched for how to do this, but landed with extensions (such as THIS ), my requirement is for it to build in the URL that I explained above .

Provided : opencart installation is a stock version, other add-ons / plugins are not installed.

EDIT

I have tried the following.

 if(isset($this->request->get['email'])) { $email = $this->request->get['email']; $cart_details = $this->db->query("SELECT cart FROM " . DB_PREFIX . "customer c where c.email = '" . $email . "'"); // just for tesing, i will fix this to prevent SQL injection. $this->session->data['cart']= $cart_details->row['cart']; } 

when I echo with "$cart_details->row['cart']" , it got the required value, but even after setting this value to session check page does not rebuild the list of products left.

+7
php opencart
source share
1 answer

I changed the checkout / controller / checkout / cart.php index method and added a check to find out if the user url contains "cmail". Then I check the email address provided in the url. At this point, I query the DB to get the "cart" column (note that I used escape to prevent SQL injection), which is then decoded and put into the session. If you are taken to a site with the URL "localhost / index.php? Route = checkout / cart & cmail=some@domain.com ", you will receive a cart rebuilt on the page. I used the following code.

 if(isset($this->request->get['cmail'])) { $email = $this->request->get['cmail']; if(filter_var($email, FILTER_VALIDATE_EMAIL)) { $cart_details = $this->db->query("SELECT cart,customer_id FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "'"); if($cart_details->num_rows > 0) { $cart_data = $cart_details->row['cart']; if ($cart_data && is_string($cart_data)) { $cart = unserialize($cart_data); foreach ($cart as $key => $value) { $this->session->data['cart'][$key] = $value; } } } } } 
+14
source share

All Articles