Update to Hikashop 4.0. – checkout workflow and back button

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #298890

-- HikaShop version -- : 4.0
-- Joomla version -- : 3.8.13
-- PHP version -- : 7.2.1.0

Hello Guys,

I have two issues with Hikashop checkout that I would like to kindly ask to help me with.

1) appeared after updating to Hikashop 4.0.

I accept only "guest checkout" since my product customer buys only once in life.

I have a step with "login + address" in this order. But in checkout, it appears in opposite order (check attachment). The email field (for login) is under all other fields. I would need it opposite for UX reasons. Is that possible? Is there any simple trick to have same formating for both tables or I have to mess up with css?




2) I have this issue from my beginning with Hikashop. When I click back in checkout, I get error ERR_CACHE_MISS. I tried it with Redirect POST mode off and on but it behaves the same.

Thank you in advance for any tips!

Thank you,
F.

Attachments:

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #298920

Hi,

1.
It must be a CSS issue with your template.
Please provide a link to the shop so that we can look at the page and analyse the CSS there.

2.
That's normal. When you fill a form on a page and validate to go to another page, if you click back on that new page, you will get that error.
The redirect POST mode is a setting that was made for the products listings, it doesn't inpact anything else so it's normal that it doesn't change anything.
Now, there are ways to avoid that on the checkout. For example, if you configure your checkout workflow to be in one step, and provided that the "checkout legacy" setting of the HikaShop configuration is turned off, you won't have that error on your checkout.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #298946

Hello,

First of all, thank you very much for your great care!

1. I checked CSS as well as template override, I can't see the problem.
Here is a click: www.elody.cz.uvirt72.active24.cz/obchod/kolekce/2018/

Click to big green button, in next field fill anything in required field "datum svatby" and then click next to see a problem.

2. Thank you for explanation. Your "one step" solution means I will have only one page checkout or it will be in one page by php code, but it will behave like multiple pages?

Thank you,
Filip

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #298950

Hi,

1. To me it indeed looks like a view override issue.
Try switching temporarily to the default template of Joomla and see if you still have the problem. I guess you won't, which will confirm that it is a view override issue.
I would also recommend to turn off the "checkout legacy" setting of the HikaShop configuration in order to switch to the new checkout of HikaShop. You'll loose some of the customization you have in your checkout, but the checkout will work much better that way.

2. Yes, you would have only one page. Note that before that switching to the new checkout by turning off the "checkout legacy" setting will probably help as I don't have the issue on my end with the new checkout even with several steps (pages).

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299016

Hello!

Turning Checkout legacy off resolved both issues. Email is above other fields and I can go back in checkout without any problem :-).

Thank you so much for your perfect support!

F.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299020

I am sorry. Other things...


1) I have custom js function for my custom currency switcher. It loads on page load.

The problem is with a coupon and quantity when I add or remove coupon, or change quantity, it refreshes price and my function doesn't have a chance to trigger. Please, could you advise file and line, where I can call my function, that refresh price? It must be after the coupon is added/removed.

2) When I fill 1st address (billing) I don't select "same address for shipping" and then I require another address from me (shipping address). Is possible to avoid asking shipping address and only fill the same as billing? then the customer can change it in an address list
- for quick and better understanding there is video: www.youtube.com/watch?v=Wh6EPDQSf6M&feature=youtu.be

3) Same scenario but I select "same address for shipping"... After clicking next It takes me to the next step. Is possible to show address list before?
- again, short video for better understanding: www.youtube.com/watch?v=WRWaHvgFouo&feature=youtu.be


I know I am very demanding and I strongly appreciate all your help.

Last edit: 5 years 6 months ago by FilipHradil.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #299040

Hi,

1. Since you're now using the new checkout, it uses ajax to dynamically refresh the different elements on the page.
So in your javascript, you can now register yourself to the events of each block of the checkout so that when a block is refreshed you can do your things:

window.Oby.registerAjax(['checkout.cart.updated', 'cart.updated'], function(params){
   // your javascript code when the cart is updated (because a coupon was added or removed, or something else changed in the cart)
});

2. Well, don't uncheck the checkbox which does exactly that and the shipping address will be prefilled with the billing address. It's the whole point of that checkbox. Otherwise, you can hide that checkbox with CSS so that it is always checked but not seen by the customer.

3. That link doesn't work for me so I'm not sure what you mean.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299061

Hello Nicolas,

Thank you.

1. My custom script only adds css classes to spans or divs containing price. With your code I am able to run a script, it adds classes for a fraction of second and then it is again rewritten by original code. It looks like the code is executed in the middle of reloading. Is there change to run it when is page block fully loaded, please?

2. Yes, that would be a solution if we resolve my question no. 3, because when I check this box and click "next" it won't show a list of billing and shipping addresses, but it will take me to next step: shipping and payment methods.

2 AND 3 resolved!!! :-)

In my css there was such a code:

button#hikashop_register_form_button,
.hkform-group.control-group.hikashop_registration_required_info_line {
    /* display: none; */
}

That caused skipping step with addresses list.


So very last thing I would need to help with is no. 1 question. Then you won't hear about me again :-))


FILIP

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #299066

Hi,

1. This code will trigger your javascript after the cart block is refreshed. However, if your code modify another block of the checkout then it's indeed possible that your code will be called before that block is refreshed. You just need to change the 'checkout.cart.updated' part there to target the block where your javascript is doing the modifications.
For example, if it's the shipping methods selection block, it's 'checkout.shipping.updated' instead.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299093

Hello,

Thank you very much.

I understand the principle, but I have no idea what is name of my block in this format.

Please, could you check my image? I highlighted green prices that are updated. After they are updated I would need to call my js function.
It is total price per product, coupon, delivery and total price of order.



It is refreshed when I change quantity or add a coupon.


I indeed thank you!
Filip

Attachments:

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299098

UPDATE:

This code resolved quantity update issue:

window.Oby.registerAjax(['checkout.cart.updated', 'cart.updated'], function(params){
   LoadCurrency();
});

But this code haven't resolved coupon add/remove issue.
window.Oby.registerAjax(['checkout.coupon.updated','cart.updated'], function(params){
   LoadCurrency();
});

It is triggered (when I try it with "alert()" for example, but I think it is too soon and then the html is overwritten.

Any ideas, please?

Last edit: 5 years 6 months ago by FilipHradil.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #299105

Hi,

When a coupon is added or removed the cart block is updated so the first code of your message should work for both cases.
I don't know what you have in your LoadCurrency() function though. Could you provide the code of that function ?
Also, a link to the shop with the instructions to reproduce the problem would help to look at the situation and better understand what's going on. Because as far as I can see, this code should do what you want.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299130

Hello,

I replaced my complicated function with very simple one line of code as to as demonstrate issue. I think that problem is not in my function.

I am adding class "HIKASHOP-TEST-CLASS" to element with id hikashop_checkout_cart_final_total_title and checking it with Google Chrome Developer.

window.Oby.registerAjax(['checkout.cart.updated', 'cart.updated'], function(params){
     document.getElementById("hikashop_checkout_cart_final_total_title").classList.add("HIKASHOP-TEST-CLASS");
});

When I add or remove coupon, this class is added but it disappears immediately. You can check it here:
www.elody.cz.uvirt72.active24.cz/obchod/vse/model-1186

1) add product to cart
2) add or remove coupon with code "model081"

When I change quantity the class is added and resists there. So it works perfect.


Thank you for checking.

I also tried to add this javascript to the end of file show_block_coupon.php, but the result is same.


Thank you,
Filip

Last edit: 5 years 6 months ago by FilipHradil.

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

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 6 months ago #299136

Hi,

thank you. I see what is the problem.
The trigger is actually called after the return of the coupon being added (or removed) but before the cart block is refreshed.
So it's not the good approach for what you're trying to do.
Instead, you should add your javascript in a script tag of the show_block_cart view file. Note that you need to put it outside of any condition with such test:
if(empty($this->ajax)) {
Otherwise it would only display your javascript when the page is loaded, and not when the block is refreshed.

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

  • Posts: 217
  • Thank you received: 4
5 years 6 months ago #299192

Hello,

Thank you very much. I call function twice in show_block_cart.php, right after end of this condition "if(empty($this->ajax)) {". It works!!


Thank you so much for your help!

Have a great day,
Filip

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

Time to create page: 0.092 seconds
Powered by Kunena Forum