Post by nightwing » Fri Jul 31, 2020 9:17 am

Hi Team,
I would like to add a preview of the current wishlist below shopping cart in /index.php?route=checkout/cart
From there, customers can remove the item or add to cart then checkout immediately.
This should be positioned below the checkout button. I am using 3.0.3.2 Default theme.
Any ideas?
Thank you.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by letxobnav » Fri Jul 31, 2020 1:45 pm

just make copies of the wishlist controller and view, adapt them both to function as modules and not whole page controller and view.
Call the wishlist module controller in the cart controller, pass it to the cart view and display it there.
Not too difficult, mostly stripping of what is not needed.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by nightwing » Fri Jul 31, 2020 8:50 pm

Hey letxobnav, thanks, I knew can be done that way, thanks for the reassurance, I will try to create an ocmod and share on my store when I am done.
letxobnav wrote:
Fri Jul 31, 2020 1:45 pm
just make copies of the wishlist controller and view, adapt them both to function as modules and not whole page controller and view.
Call the wishlist module controller in the cart controller, pass it to the cart view and display it there.
Not too difficult, mostly stripping of what is not needed.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Fri Jul 31, 2020 9:04 pm

Question, seeing that wishlist is protected by account login, wouldn't this be an issue some how? Even though its a preview - I would have to still throw the message that they have to be logged in to save to wish list, however, this would have to be hidden for customers who are not logged in, probably replaced by a message under the cart that says you must be logged in to create or maintain a shopping list..
nightwing wrote:
Fri Jul 31, 2020 8:50 pm
Hey letxobnav, thanks, I knew can be done that way, thanks for the reassurance, I will try to create an ocmod and share on my store when I am done.
letxobnav wrote:
Fri Jul 31, 2020 1:45 pm
just make copies of the wishlist controller and view, adapt them both to function as modules and not whole page controller and view.
Call the wishlist module controller in the cart controller, pass it to the cart view and display it there.
Not too difficult, mostly stripping of what is not needed.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by letxobnav » Fri Jul 31, 2020 10:12 pm

Well, I changed wishlist so that you need not be signed in to manage it.
The weird thing about default OC is that you can add to the wishlist as a guest but you have to register or sign in to view/manage it, why? no idea.

So I use a cookie as well as the customer database, meaning it is saved in a cookie for guests and also in the table for signed in customers.

you can checkout how that looks on our site, just add some products to the wishlist 7 cart and visit the cart page.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by nightwing » Fri Jul 31, 2020 10:33 pm

I will check it out, Yeah I found that its weird. On my site I noticed that if you add to Wishlist as a guest, then it says you must be signed in... And says Wishlist (1). After you actually sign in, it goes to 0 and no items are in the Wishlist.
letxobnav wrote:
Fri Jul 31, 2020 10:12 pm
Well, I changed wishlist so that you need not be signed in to manage it.
The weird thing about default OC is that you can add to the wishlist as a guest but you have to register or sign in to view/manage it, why? no idea.

So I use a cookie as well as the customer database, meaning it is saved in a cookie for guests and also in the table for signed in customers.

you can checkout how that looks on our site, just add some products to the wishlist 7 cart and visit the cart page.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by letxobnav » Fri Jul 31, 2020 10:49 pm

I double checked, I do not even save it in the database for customers anymore, too much hassle for nothing, just in a cookie is just fine.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by nightwing » Sat Aug 01, 2020 12:58 am

Oh I see, I think I would pass it to the db after login or registration, like the cart items.
letxobnav wrote:
Fri Jul 31, 2020 10:49 pm
I double checked, I do not even save it in the database for customers anymore, too much hassle for nothing, just in a cookie is just fine.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » Sat Aug 01, 2020 3:05 am

At login OC transfers the wishlist items to the DB. For guest users you would most likely have to build an array from the session wishlist data and loop that to your view.

Not sure its worth all the effort unless this is a mandatory feature, probably a lot of duplicate code to handle guests.

For logged in customers its simple as you could just pull the $this->model_account_wishlist->getWishlist(); as shown in the wishlist controller.

letxobnav cookie suggestion may work well and probably a better overall solution, but you would still have to re-work the wishlist controller and other aspects for that logic.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by letxobnav » Sat Aug 01, 2020 3:08 pm

cookie suggestion may work well and probably a better overall solution, but you would still have to re-work the wishlist controller and other aspects for that logic.
yes, I have, I do store the wishlists in the DB for both customers and guests the moment they add a product but only for analysis purposes, i.e. to be able to see which products people put in their wishlists, not for online processing.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by nightwing » Sat Aug 01, 2020 8:17 pm

I get what you mean. :D
letxobnav wrote:
Sat Aug 01, 2020 3:08 pm
cookie suggestion may work well and probably a better overall solution, but you would still have to re-work the wishlist controller and other aspects for that logic.
yes, I have, I do store the wishlists in the DB for both customers and guests the moment they add a product but only for analysis purposes, i.e. to be able to see which products people put in their wishlists, not for online processing.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm

Who is online

Users browsing this forum: No registered users and 329 guests