[Skip to main content](#vessel-content)

#   force login after I empty my cart

##

- **[li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")**
- [![li&#95;gordon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32895-li-gordon "View li&#95;gordon's Profile") Topic Author
- [ Offline](/forum/user/32895-li-gordon)

Less More

- Posts: 25
- Thank you received: 2
-
-

3 years 3 months ago [\#353352](#353352) by [li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")  *[force login after I empty my cart](/forum/27-checkout/906711-force-login-after-i-empty-my-cart#353352 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.3.3 -- PHP version -- : 7.4 -- Browser(s) name and version -- : chrome  We use only the GUEST CHECKOUT, as we do not want users logging into Joomla to make purchases.  the Guest checkout works PERFECTLY, except when we do the following:  This works: ---&gt; The master delete button on the top of the page works fine and it does bring the buyer back to the list of literature.  This brings us to a login screen: ---&gt; But I am still being sent to the member to log in when I delete everything in my cart individually , and this only happens when I use the trash can under each item and only happens if all the items added to the cart are deleted this way  Is there something that I should be setting so if I use the TRASH can for each item and the cart is emptied the system does NOT take me to the login screen?  thanks, Laura")* was created by *[li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")*

-- HikaShop version -- : 4.7.4
-- Joomla version -- : 4.3.3
-- PHP version -- : 7.4
-- Browser(s) name and version -- : chrome

We use only the GUEST CHECKOUT, as we do not want users logging into Joomla to make purchases.

the Guest checkout works PERFECTLY, except when we do the following:

This works: ---&gt; The master delete button on the top of the page works fine and it does bring the buyer back to the list of literature.

This brings us to a login screen: ---&gt; But I am still being sent to the member to log in when I delete everything in my cart individually , and this only happens when I use the trash can under each item and only happens if all the items added to the cart are deleted this way

Is there something that I should be setting so if I use the TRASH can for each item and the cart is emptied the system does NOT take me to the login screen?

thanks,
Laura

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0LzkwNjcxMS1mb3JjZS1sb2dpbi1hZnRlci1pLWVtcHR5LW15LWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

3 years 3 months ago [\#353354](#353354) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[force login after I empty my cart](/forum/27-checkout/906711-force-login-after-i-empty-my-cart#353354 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.3.3 -- PHP version -- : 7.4 -- Browser(s) name and version -- : chrome  We use only the GUEST CHECKOUT, as we do not want users logging into Joomla to make purchases.  the Guest checkout works PERFECTLY, except when we do the following:  This works: ---&gt; The master delete button on the top of the page works fine and it does bring the buyer back to the list of literature.  This brings us to a login screen: ---&gt; But I am still being sent to the member to log in when I delete everything in my cart individually , and this only happens when I use the trash can under each item and only happens if all the items added to the cart are deleted this way  Is there something that I should be setting so if I use the TRASH can for each item and the cart is emptied the system does NOT take me to the login screen?  thanks, Laura")*

Hi,

Try changing the line: Code:

if(!empty($cart) &amp;&amp; empty($user_id)) {

to: Code:

if(!empty($cart) &amp;&amp; !empty($cart-&gt;cart_products) &amp;&amp; empty($user_id)) {

in the function "show" of the file components/com_hikashop/controllers/cart.php and it should fix the problem.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0LzkwNjcxMS1mb3JjZS1sb2dpbi1hZnRlci1pLWVtcHR5LW15LWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")**
- [![li&#95;gordon's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32895-li-gordon "View li&#95;gordon's Profile") Topic Author
- [ Offline](/forum/user/32895-li-gordon)

Less More

- Posts: 25
- Thank you received: 2
-
-

3 years 3 months ago [\#353356](#353356) by [li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")  Replied by *[li\_gordon](/forum/user/32895-li-gordon "View li&#95;gordon's Profile")* on topic *[force login after I empty my cart](/forum/27-checkout/906711-force-login-after-i-empty-my-cart#353356 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.3.3 -- PHP version -- : 7.4 -- Browser(s) name and version -- : chrome  We use only the GUEST CHECKOUT, as we do not want users logging into Joomla to make purchases.  the Guest checkout works PERFECTLY, except when we do the following:  This works: ---&gt; The master delete button on the top of the page works fine and it does bring the buyer back to the list of literature.  This brings us to a login screen: ---&gt; But I am still being sent to the member to log in when I delete everything in my cart individually , and this only happens when I use the trash can under each item and only happens if all the items added to the cart are deleted this way  Is there something that I should be setting so if I use the TRASH can for each item and the cart is emptied the system does NOT take me to the login screen?  thanks, Laura")*

But if I make that chnage to cart.php, if I install any updates to hika shop won't that change be removed?

Is there a way this could be an option if you are using GUEST checkout... if GUEST is being used, and the person isn't logged in, you shouldn't be forced to login, right?

thanks,
Laura

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0LzkwNjcxMS1mb3JjZS1sb2dpbi1hZnRlci1pLWVtcHR5LW15LWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86322
- Thank you received: 14281
-
-

3 years 3 months ago [\#353358](#353358) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[force login after I empty my cart](/forum/27-checkout/906711-force-login-after-i-empty-my-cart#353358 "-- HikaShop version -- : 4.7.4 -- Joomla version -- : 4.3.3 -- PHP version -- : 7.4 -- Browser(s) name and version -- : chrome  We use only the GUEST CHECKOUT, as we do not want users logging into Joomla to make purchases.  the Guest checkout works PERFECTLY, except when we do the following:  This works: ---&gt; The master delete button on the top of the page works fine and it does bring the buyer back to the list of literature.  This brings us to a login screen: ---&gt; But I am still being sent to the member to log in when I delete everything in my cart individually , and this only happens when I use the trash can under each item and only happens if all the items added to the cart are deleted this way  Is there something that I should be setting so if I use the TRASH can for each item and the cart is emptied the system does NOT take me to the login screen?  thanks, Laura")*

Hi,

This won't be an option. If you can confirm that the modification works, we'll include it in the next version of HikaShop of course.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0LzkwNjcxMS1mb3JjZS1sb2dpbi1hZnRlci1pLWVtcHR5LW15LWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
