Checkout payment selection

  • Posts: 128
  • Thank you received: 1
8 years 5 months ago #241403

-- HikaShop version -- : 2.6.3

Dear team,

I would like to change the payment selection from radio button to drop down selection instead.
In which php file can I do the changes? Where there? and what is the code to change and insert? I hence need the code so that the view in the attachment shown changes to a drop down selection.

Thanks and regards

Thomas

Attachments:
Last edit: 8 years 5 months ago by thomasf.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 5 months ago #241418

Hi,

You can do that in the file "payment" of the view "checkout" that you can edit via the menu Display>Views. You'll have to basically replace all the code there to add a dropdown with a foreach on the payment methods array available in $this->methods

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

  • Posts: 128
  • Thank you received: 1
8 years 5 months ago #241444

Hi, Nicolas,

and what is that drop down code? and what is the word I need to replace? Can you just put one line as example? Thanks very much.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 5 months ago #241454

Hi,

Please note that we provide user support on this forum, not custom coding services, and giving you one line of code is useless if you don't know what to do with it. The hints I gave you in my previous message should be enough for a developer to do it on its own. I'll make an exception because it's quite easy. It will be something like that:

<select name="hikashop_payment">
<?php $done=false;
 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;
				}
echo '<option value="'.$method->payment_type.'_'.$method->payment_id.'" '.$checked.'>'.$method->payment_name.'</option>'; 
} ?>
</select>

The following user(s) said Thank You: thomasf

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

  • Posts: 128
  • Thank you received: 1
8 years 5 months ago #241517

Hi Nicolas, I highly appreciate this and understand your information. Regards
Thomas

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

Time to create page: 0.057 seconds
Powered by Kunena Forum