Auto submit payment/shipping method question

  • Posts: 272
  • Thank you received: 7
11 years 4 months ago #111415

Hi there,

I have chosen to 'Auto submit payment & shipping methods' so that the user can see the total in their cart before checking out (I charge a paypal fee which only shows in cart if the payment method is auto submitted).

However, when the user selects a payment method, the page of course refreshes. After the page refresh, you are looking at the very top of the page rather than the payment section which is further down the page (a little confusing for some users). Is there any way I can implement something whereby the page refresh opens at the same position on the page before the auto refresh?

Thanks again

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

  • Posts: 82758
  • Thank you received: 13346
  • MODERATOR
11 years 4 months ago #111515

Hi,

You can edit the files 'shipping' and 'payment' of the view "checkout" via the menu Display>Views and add the code:
this.form.action=this.form.action+\'#hikashop_shipping_methods\';

or:
this.form.action=this.form.action+\'#hikashop_payment_methods\';

before the code:
this.form.submit();

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

  • Posts: 272
  • Thank you received: 7
11 years 4 months ago #111573

Nicolas,

Many thanks for your fast reply. I'm not sure I have added the code in the right place. I would be very grateful if you can check what's below :)

<?php
foreach($this->methods as $method){
$checked = '';
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
$checked = 'checked="checked"';
$done = true;
}
this.form.action=this.form.action+\'#hikashop_payment_methods\';
if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
$checked.=' onclick="this.form.submit(); return false;"';
}

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

  • Posts: 12953
  • Thank you received: 1778
11 years 4 months ago #111575

Sure, I you'll also have to put this code :

this.form.action=this.form.action+\'#hikashop_shipping_methods\';
through the shipping file of your checkout view before these lines :
if($this->config->get('auto_submit_methods',1) && empty($checked))
        $checked.=' onclick="this.form.submit(); return false;"';

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

Time to create page: 0.075 seconds
Powered by Kunena Forum