Post by chrisgwynne » Wed Nov 29, 2017 9:24 pm

Ok bare with me :). I want to add HTML to a specific input button on the payment page.

Code: Select all

<?php foreach ($payment_methods as $payment_method) { ?>
  <div class="radio">
    <label>
      <?php if ($payment_method['code'] == $code || !$code) { ?>
      <?php $code = $payment_method['code']; ?>
      <input type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" checked="checked" />
      <?php } else { ?>
      <input type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" />
      <?php } ?>
      <?php echo $payment_method['title']; ?>
      <?php if (isset($payment_method['terms']) && $payment_method['terms']) { ?>
      (<?php echo $payment_method['terms']; ?>)
      <?php } ?>
    </label>
  </div>
  
  <?php } ?>
So I want to specify, that if payment option is pp_pro_iframe, then add some extra html into this part

Code: Select all

<input type="radio" name="payment_method" value="<?php echo $payment_method['code']; ?>" />
So it'd end up

Code: Select all

<input type="radio" name="payment_method" NEW HTML CODE value="<?php echo $payment_method['code']; ?>" />
Is this possible and how?

Thank you.

New member

Posts

Joined
Fri Nov 11, 2016 7:33 am

Post by straightlight » Wed Nov 29, 2017 9:39 pm

No OC version provided. No objective explanation provided with the provided code.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by chrisgwynne » Wed Nov 29, 2017 10:33 pm

Sorry

OC v 2.3.0.2

Objective, to insert JS into that particular input option so when clicked it hides elements on screen, that part I can handle, I just unsure on how to specify that particular input payment

New member

Posts

Joined
Fri Nov 11, 2016 7:33 am

Post by straightlight » Wed Nov 29, 2017 10:41 pm

Since the payment extensions are operating in a loop statement, the best suggestion would be to use the example provided in the catalog/view/theme/<your_theme>/template/product/product.tpl file where the: cart.add is indicated. Use the same method with your own function and code this function in your own JS file the same way the catalog/view/theme/<your_theme>/javascript/common.js has been coded with the cart instantiation.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 160 guests