Empty cart without redirect possible?

  • Posts: 86
  • Thank you received: 5
3 years 3 months ago #334890

-- HikaShop version -- : 4.4.3
-- Joomla version -- : 3.9.28
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Chrome

Hi, one of the option of HikaShop is to redirect when tha cart is empty but leaving that option blank does a redirect as well, there is no way to go to a menu item associated to display cart when empty without being redirected.
Can you please check this?
thanks

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 3 months ago #334899

Hi,

Yes, that's normal. The cart display view, and the checkout view are meant to display supposing that the cart is not empty. So when the cart is empty, they need to redirect elsewhere.
If you don't enter a URL in the "URL where to redirect when the cart is empty" setting, HikaShop will automatically redirect to a products listing so I recommend entering there the main URL of your shop. That's what merchants usually do.

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
3 years 3 months ago #335100

Thanks Nicolas, but the behavior is a little different:
1) I create a "Cart" menu item and leave empty the "redirect when cart empty" parameter in HikaShop.
2) In the front-end, clicking on that menu item will redirect to the shop => some SEO tools notice a 301 redirect problem since the menu link does not point directly to the destination page (that's one problem).
3) I add a product to my cart, then the "Cart" menu item will not redirect and I can see my cart.
4) Now I remove the product from the cart, the cart is empty => the "Cart" menu item is still usable, it will not redirect to the shop even if the cart is empty, most probably since a cart was created althought without any product.
I think this is not very consistent and why not leaving the administrator the option of not redirecting the cart even if empty? Since there is an option, when the option value is empty the redirect should be disabled in my opinion.
Cheers and thanks

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 3 months ago #335113

Hi,

Indeed, the system allows you to stay on the cart details page when the cart has been created, even if there are no more products in the cart.
I agree that it's a bit inconsistent with when the cart has not been created yet.
We'll change that up for the next version to make it consistent and add a hidden option to be able to change the behavior of the system (redirect or not when the cart is empty on the cart page).

Please Log in or Create an account to join the conversation.

  • Posts: 86
  • Thank you received: 5
3 years 3 months ago #335115

Thanks a lot, I will wait for changelog in next version to use the hidden option.

Giuse

Please Log in or Create an account to join the conversation.

  • Posts: 201
  • Thank you received: 7
5 months 3 weeks ago #361354

nicolas wrote: Hi,
We'll change that up for the next version to make it consistent and add a hidden option to be able to change the behavior of the system (redirect or not when the cart is empty on the cart page).

hi.
excuse me for post in old topic. is this feature implement in hikashop and accessible now?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 months 2 weeks ago #361356

Hi,

Yes, it has been added. As I said 2 years ago, it was added as a hidden option.
Go in your PHPMyAdmin, open the hikashop_config table, and add a new entry with the namekey cart_show_page_redirect_on_empty and the value 0 and it won't redirect you when you try to access the cart page and you have an empty cart.

Please Log in or Create an account to join the conversation.

  • Posts: 201
  • Thank you received: 7
4 months 2 days ago #362204

Hello
According to you, I did the mentioned steps, but unfortunately it didn't work, and when the shopping cart is empty, the redirect is done

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 months 1 day ago #362207

Hi,

Then, what is the URL of the shop ? Could you provide instructions to reproduce the issue ?
I'm thinking we're talking about different things here.

Please Log in or Create an account to join the conversation.

  • Posts: 201
  • Thank you received: 7
4 months 8 hours ago #362240

[Moderator:] For safety purpose, we have saved on our side your references, and deleted here.
Next time, use our Contact us form to provide these kind of references.


Add this product to the shopping cart with the account mentioned above; And after going to the shopping cart, remove the product. When the shopping cart is empty, the redirect is mandatory, although according to your instructions, I also created a hidden option cart_show_page_redirect_on_empty in the database and gave it a value of 1.
After checking the necessary items; Please delete the user password and site address

Last edit: 4 months 6 hours ago by Philip.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 months 3 hours ago #362244

Hi,

What you're describing as the "shopping cart" is not the shopping cart page. It's the checkout page.
The checkout page can only be accessed with a cart.
If you empty the cart from the checkout you will be redirected, there is no way around this.
The cart_show_page_redirect_on_empty hidden parameter is for the cart page.
You can see it on this page for example:
yourwebsite.ir/%D9%85%D8%AD%D8%B5%D9%88%D9%84%D8%A7%D8%AA/cart
And I can confirm that on this page of your website, if I empty my cart, I'm not redirected and I stay on this page.
So the feature I talked about on this thread with @Giuse is working on your website too. It's just not what you thought it was.

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum