Checkout cart redirect

  • Posts: 1119
  • Thank you received: 114
5 years 4 months ago #301721

Hi,

We have 2 steps checkout.

First step is cart and coupon, second step all other views and where user is finishing he's order....

Now question.

1. If cart gets empty on first step is there a way not to redirect anythere and show some kinda message that cart is empty?

2. If cart gets empty on second step redirect to first step and show message?

I know there is a menu item with cart view but it's not ajax and there is no way to add coupon view to that menu item.

It seems that this will require core hack but i hope it won't.

Thanks for help.

Regards

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

  • Posts: 1119
  • Thank you received: 114
5 years 4 months ago #301722

Update.

So i almost manage to do what i need.

However i found that after i removed my url from "URL where you will be redirected when the cart is empty" it reloads checkout page and url changes to something like this: mysite/checkout/product/listing with some strange display, i have attached screenshot. Shouldn't it stay on same page/menu item with url: mysite/checkout, insteed of adding this unneaded product listing display or whatever it is??

Thanks

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 4 months ago #301742

Hi,

The checkout system cannot display itself without a cart.
That's why it redirects you somewhere else. And usually you want to use that setting to redirect it to your shop main page. You could also redirect it to a joomla article with only your message. Wouldn't that do it ?
If you really want to stay on the checkout page after emptying the cart, I'm afraid it will indeed require some serious core hack.

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

  • Posts: 1119
  • Thank you received: 114
5 years 4 months ago #301771

Hi,

We just want to give user possibility to review hes cart, with some options, or go directly to checkout. Checkout it self for sure have minicart and it works well now...But in the future we want to force user to login/register or continue as a guest via joomla registration/login page...

After some thinking i think the best would be to create menu item cart and do some modifications there as we want and redirect to this page.

The only question is how to trigger hikashop cart module refresh from menu item hikashop->cart page. What js we could use? As example in our jquery ajax success response...

Thanks

Last edit: 5 years 4 months ago by kyratn.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 4 months ago #301772

Hi,

You could use such javascript:

window.Oby.fireAjax('cart.updated');
The product/cart.php view file has javascript at the beginning to register that cart.updated event so that it will refresh itself when such event is fired.

The following user(s) said Thank You: kyratn

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

  • Posts: 1119
  • Thank you received: 114
5 years 3 months ago #301934

Hi,

So after doing some customizations in cart/show view we found some issues with redirection. In the settings "URL where you will be redirected when the cart is empty" we set url of our HikaShop » Cart Display menu url.

Now, when we add product to cart and empty it the redirections works fine, i also can access url at any time just typing that url in the browser... However if i close browser completely and reopen it, i am not able to access cart page, browser throws some kinda error that to many redirections. It seems that there is some issue with session because after it ends i am not able to access cart page but i think it still should be accessible with empty cart message?



Thanks

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 3 months ago #301936

Hi,

No, you can't access the cart page when the cart is empty. When you already have a cart and remove the last product the cart is still there but without products so it still let's you access the cart details page. But if you really have no cart at all, it will redirect to the URL set in the configuration. So the best would be to use a URL where you don't have the checkout nor the cart since both normally require a cart to be there to display properly.
The error you get is because it's doing a loop as it tries to redirect to that URL, which checks the cart again and redirect again, etc.

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

  • Posts: 1119
  • Thank you received: 114
5 years 3 months ago #301948

Hi.

That makes sense but shouldn't user be able to access cart page and see some message that car is empty like 99% of shops have it? Ebay, amazon and so on....

It's just feels not the best practice for user experiance.

Thanks

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 3 months ago #301954

Hi,

That's what you get. If you have a cart or checkout link, HikaShop will redirect to the URL you put in the configuration AND display a message "the cart is empty" on that page.
That message can be tweaked with a translation override if necessary.
And with that URL setting, you can either redirect to the shop main page (which most shop owners want to do), or to a page with an empty article if you don't want to display anything besides the message, or somewhere else based on your specific needs.

I'm not familiar with eBay, however, I'm quite familiar with Amazon. What they do when you try to access the cart page is that they display you a message that the cart is empty and then below it they have a listing of the products in the wishlist (if any) and below a listing of "last seen products" and another one of "related products", which you can somewhat do with HikaShop content modules that you would assign to the page where you redirect the customer.
Amazon doesn't display an empty cart interface either, at least, that's what I have on my end when I use Amazon.
Now regarding the 99% of the other shops, that's your opinion that they display a cart or checkout interface without any products, but I believe that most of them display a message like we do and redirect to the main shop page or a page with some modules displaying potentially interesting products to the customer.
So I really don't see why you're trying to do that.

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

  • Posts: 1119
  • Thank you received: 114
5 years 3 months ago #301961

Hi,

I think you a bit not right about amazon. If you click on cart, you will be redirect to cart page and it will show you that cart is empty. If you add anything to cart and click again cart icon, you will be redirect to same cart page with product in cart. So the cart does 2 jobs, shows user hes products or show that it's empty...I just looked into US amazon and France amazon, and they have same behiviour.

Now, i don't want to use custom article with empty cart message because url could be accessible even if user has some products in cart. That's not the option and can confuse people...

Also, hikashop have only checkout possibility but there is no pre-checkout/shopping cart view where we could define some usefull informations to buyer with "checkout now" button... Even amazon after product is added to cart gives you to 2 options. View cart or checkout now...

So there is nothing unusual what we want to achieve. We just want to added extra button in hikashop cart module "view cart" so user can view hes full cart and have some options there with go to checkout button... If user empty cart there, it should be refreshed with empty cart message. If user delete product in checkout cart, it should be redirected to that page with empty cart message. If user tries to go to cart page via url, same message should appear. However this is not possible with hikashop menu cart display.

Another thing, if you have cart icon as hikashop cart module and press on it, you going to checkout but i think if you press bag you should go to bag? Isn't it? I know there is minicart with dropdown but you can't put a lot content there because of low space and so on... Yes, there is cart view in checkout but it''s checkout and you can't redirect here. And having cart empty message as joomla message is just lazy thing, insteed having cart view where you can force user to do something like bundle product, move to wishlist and many other useful things...

It's just my opinion based on other shops and my self shopping experiance from other shops. Most of them put a lot effort/money to give user best experiance.

Anyway, thanks for taking time to replay and read it.

We also found some solution where we use hikashop cart module with different layout on empty article page. So it will redirect there and module will show empty message, + we don't need to add our own jquery ajax as it already have it. :)

Kind Regards

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

  • Posts: 103
  • Thank you received: 5
5 years 2 months ago #302883

i have also some troubles how it is done right now by hikashop core.
this redirection does not help, i got also the error message from the browser "to many redirections".
i want to suggest that it should be possible to browser to a empty checkout - then I wouldn't have to build a new subpage which only serves for a redirection.

kyratn wrote: We also found some solution where we use hikashop cart module with different layout on empty article page. So it will redirect there and module will show empty message, + we don't need to add our own jquery ajax as it already have it. :)

kyratn how does your solution exactly look a like with the cart module?

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

  • Posts: 1119
  • Thank you received: 114
5 years 2 months ago #302890

Hi,

@n00bster

It's a bit tricky but i'll try to explain you as better as possible.

1. We have created empty joomla menu item "featured article" and named it "cart".
2. Then we added this menu item to hikashop redirect after cart is empty...
3. By default we have 1 hikashop cart module where in hikashop options->mini cart is set to "dropdown". We use this module as standart on the right header.......So we created another hikashop cart module and set hikashop options->mini cart to "NO". Pointed this module to show only in the empty article we created above...

4. Now we have copied hikashop cart.php file and named it as example "custom_cart.php" and put it inside template/my_template_name/html/hikashop/product folder... Basically we have created our own view override with custom name...

5. Inside product/cart.php we wrapped hikashop code into this:

<?php if((int)$this->params->get('small_cart')==0) {?>
...set layout based on hikashop mini cart settings here...
  <?php $this->setLayout('custom_cart');
  echo $this->loadTemplate();?>
<?php }else{ ?>

....default hikashop code here.....

<?php }?>

So what it does. If hikashop cart module settings-> mini cart is set to "NO" it will use our own layout else it will use hikashop code...

Everything else is just customization on what should be shown if cart empty and so on... I am not sure if it's the best way to do it but it does work really well. You may want to play on our site, in order to access cart page you need to add product to cart, go to checkout and in the cart view there is a button "change" on top right side (desktop) which will point you to cart page...

Hope that helps.

Thanks

The following user(s) said Thank You: n00bster

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

Time to create page: 0.103 seconds
Powered by Kunena Forum