Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24
  1. #21
    Join Date
    May 2004
    Location
    Hong Kong
    Posts
    1,291
    Plugin Contributions
    1

    Default Re: Pre-Select A Payment Option at check-out?

    If for the Zen Cart Order Manager, there is a topic about it.
    May be ask and discuss there.
    Zen-Cart Order Manager

    .
    A New Starter again

  2. #22
    Join Date
    Jun 2004
    Posts
    8
    Plugin Contributions
    0

    Default Re: Pre-Select A Payment Option at check-out?

    I really think this should be built in by default. People always miss that "credit card" radio button when filling it out. There should be a "selected: True | False" thing in the Payments admin area.

  3. #23
    Join Date
    Oct 2006
    Posts
    3
    Plugin Contributions
    0

    Idea or Suggestion Re: Pre-Select A Payment Option at check-out?

    There is a fairly simple solution to this problem
    I edited the code in /includes/templates/template_default/templates/tpl_checkout_payment_default.php

    the edit basically sets it so which ever payment method is first in your sort order is the selected option it requires adding a variable called $checked_set and setting the value to true before entering the FOR loop that prints the radio buttons/payment methods and then setting to false before the end of the for statement but after the printing of the radio buttons and then also changing the call to zen_draw_radio_field() to use that variable rather than the one it is looking up so for those of you who wanted to know the solution there it is... for those of you who just want it fixed here is the code and the replacement code replacements will be marked in red

    ***ORIG FOR STATEMENT***


    <?php
    $radio_buttons = 0;
    for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
    ?>
    <?php
    if (sizeof($selection) > 1) {
    ?>
    <?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
    <?php
    } else {
    ?>
    <?php echo zen_draw_hidden_field('payment', $selection[$i]['id']); ?>
    <?php
    }
    ?>
    <label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>
    <?php
    if (MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
    ?>
    <div class="alert"><?php echo TEXT_INFO_COD_FEES; ?></div>
    <?php
    } else {
    // echo 'WRONG ' . $selection[$i]['id'];
    ?>
    <?php
    }
    ?>
    <br class="clearBoth" />
    <?php
    if (isset($selection[$i]['error'])) {
    ?>
    <div><?php echo $selection[$i]['error']; ?></div>
    <?php
    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
    ?>
    <div class="ccinfo">
    <?php
    for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
    ?>
    <label <?php echo (isset($selection[$i]['fields'][$j]['tag']) ? 'for="'.$selection[$i]['fields'][$j]['tag'] . '" ' : ''); ?>class="inputLabelPayment"><?php echo $selection[$i]['fields'][$j]['title']; ?></label><?php echo $selection[$i]['fields'][$j]['field']; ?>
    <br class="clearBoth" />
    <?php
    }
    ?>
    </div>
    <br class="clearBoth" />
    <?php
    }
    $radio_buttons++;
    ?>
    <br class="clearBoth" />
    <?php
    }
    ?>

    ***END ORIGIONAL FOR STATMENT***

    ***NEW FOR STATEMENT***

    <?php
    $radio_buttons = 0;
    $checked_set = true;
    for ($i=0, $n=sizeof($selection); $i<$n; $i++) {
    ?>
    <?php
    if (sizeof($selection) > 1) {
    ?>

    <?php echo '<p align="left">' . zen_draw_radio_field('payment', $selection[$i]['id'], $checked_set , 'id="pmt-'.$selection[$i]['id'].'"'); ?>
    <?php
    } else {
    ?>
    <?php echo zen_draw_hidden_field('payment', $selection[$i]['id']); ?>
    <?php
    }
    ?>
    <label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label> </p>
    <?php
    if (MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
    ?>
    <div class="alert"><?php echo TEXT_INFO_COD_FEES; ?></div>
    <?php
    } else {
    // echo 'WRONG ' . $selection[$i]['id'];
    ?>
    <?php
    }
    ?>
    <br class="clearBoth" />
    <?php
    if (isset($selection[$i]['error'])) {
    ?>
    <div><?php echo $selection[$i]['error']; ?></div>
    <?php
    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
    ?>
    <div class="ccinfo">
    <?php
    for ($j=0, $n2=sizeof($selection[$i]['fields']); $j<$n2; $j++) {
    ?><label <?php echo (isset($selection[$i]['fields'][$j]['tag']) ? 'for="'.$selection[$i]['fields'][$j]['tag'] . '" ' : ''); ?>class="inputLabelPayment"><?php echo $selection[$i]['fields'][$j]['title']; ?></label><?php echo $selection[$i]['fields'][$j]['field']; ?>
    <br class="clearBoth" />
    <?php
    }
    ?>
    </div>
    <br class="clearBoth" />
    <?php
    }
    $radio_buttons++;
    $checked_set = false;
    ?>
    <br class="clearBoth" />
    <?php
    }
    ?>

    ***END OF NEW FOR STATEMENT***

    Hope this Helps RYAN

  4. #24
    Join Date
    Feb 2005
    Posts
    283
    Plugin Contributions
    0

    Default Re: Pre-Select A Payment Option at check-out?

    Hi,
    It looks like newer versions of Zen Cart have auto-selecting of appropriate payment radio-buttons as a built-in feature now.

 

 
Page 3 of 3 FirstFirst 123

Similar Threads

  1. v150 Pre-Select A Payment Option at check-out
    By ShopVille in forum Addon Payment Modules
    Replies: 9
    Last Post: 12 Sep 2014, 03:35 PM
  2. v151 Pre-Select A Payment Option at check-out (COWOA)
    By SarahL in forum General Questions
    Replies: 0
    Last Post: 4 Sep 2014, 02:06 PM
  3. How to MAKE customer select an option before checking out?
    By nasdaqphil in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 29 Nov 2010, 05:11 AM
  4. Need help installing Master card and Visa as a payment option during check out
    By Tester28 in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 22 Jul 2010, 02:17 AM
  5. Pre-select default payment method
    By breadfan in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 1 Aug 2007, 05:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg