Jump to content

#_desktop_cart div empty when !$customer.is_logged


conchito

Recommended Posts

Hi there,

I have a problem with the cart icon displayed in the header.

Description of the problem

Step 1: When I launched the site, I wanted people to create their account befoyre buying anything. For a few days, there was no cart icon displayed as long as you weren't logged in. You could click "add to cart" all you want, nothing happened and it was absolutely normal, for you had to log in first.

Step 2: Eventually I decided that people should be able to add products to cart before logging in or signing up. So I had to edit some files accordingly and I got the desired result. The visitor sees a product he likes. He "adds to cart". He's redirected to the login page. He either logs in or signs up. He's now logged in and the product he had added before is already in his cart.

Step 3: Finally the idea came to my mind that I should let anyone buy stuff on this site without ever having to log in or even have an account. The problem is, the visitor can't even known if the product was added, since the cart icon (in _desktop_cart div, you know) is not there. Actually I had removed it in step 1. The "add-to-cart" functions works fine though (for if you log in or create an account after having clicked "Add to cart", you see the selected product in you cart). But the non-loggedin customer can't go further because he has no way to check his cart.

So basically, on a more technical level, the problem is is. When !$customer.is_logged (to put in bluntly), the #_desktop_cart div is empty. But as soon as $customer.is_logged, the #_desktop_cart div is alright, and the cart contains whatever customer added before logging in.

I want the #_desktop_cart div to work exactly the same whether one is logged or not. Can someone help me ?

 

Context :

- i use a child theme

Than you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...