Results 1 to 5 of 5

Threaded View

  1. #1
    Join Date
    Dec 2007
    Posts
    8
    Plugin Contributions
    0

    Default Changing the default payment option

    (ZC 1.3.7.1)

    This has come up a couple of times, e.g. http://www.zen-cart.com/forum/showpost.php?p=305832

    I also had the desire to auto-select whatever happened to be the first payment option in the list, but I did it in one line.

    again, edit /includes/templates/template_default/templates/tpl_checkout_payment_default.php

    Around line 138 change

    Code:
    <? php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
    so that it says this instead:

    Code:
    <?php echo zen_draw_radio_field('payment', $selection[$i]['id'], (!$i ? true : false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
    It takes advantage of the $i in the for() loop just above so logically "NOT $i" will always be boolean true for the first item in the list, and only the first item.

    Have I missed something subtle? I tried it in conjunction with payment modules only being available for a certain zone / currency and it still seems to work fine :)
    Last edited by gdhgdh; 3 Jan 2008 at 11:01 PM. Reason: typo

 

 

Similar Threads

  1. Changing the words of a payment option to say Visa/AMEX
    By wildchick in forum Addon Payment Modules
    Replies: 2
    Last Post: 25 Jul 2011, 04:40 AM
  2. Changing Default Shipping Option to FedEx instead of flat?
    By stlnyc in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 28 Dec 2010, 09:18 AM
  3. credit card payment option selected as default
    By mediathing in forum Managing Customers and Orders
    Replies: 3
    Last Post: 24 Feb 2009, 10:50 PM
  4. Hiding the 'default' option for required attributes
    By xtinexoop in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 16 Dec 2007, 11:09 PM
  5. How to controll the default option ?
    By mrbert in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 7 Apr 2007, 09:52 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