Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2014
    Posts
    25
    Plugin Contributions
    0

    Default Multi Store pickup location with drop down menu

    [Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]

    Zencart v1.5.5f
    Does anyone knows how to change the radio button for the store pickup location to a drop down menu???
    i have many locations. it's definitely better to have the drop down menu.


    i think i should edit the below code in the file tpl_checkout_shipping_default
    but not sure how to make it work.
    could someone give me a direction.

    PHP Code:
                      for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
            // set the radio button to be checked if it is the method chosen
                        $checked = (($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true : false);

                        if ( ($checked == true) || ($n == 1 && $n2 == 1) ) {
                          //echo '      <div id="defaultSelected" class="moduleRowSelected">' . "\n";
                        //} else {
                          //echo '      <div class="moduleRow">' . "\n";
                        }
            ?>
            <?php
                        
    if ( ($n 1) || ($n2 1) ) {
            
    ?>
            <div class="important forward"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></div>
            <?php
                        
    } else {
            
    ?>
            <div class="important forward"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . zen_draw_hidden_field('shipping'$quotes[$i]['id'] . '_' $quotes[$i]['methods'][$j]['id']); ?></div>
            <?php
                        
    }
            
    ?>

            <?php echo zen_draw_pull_down_menu('shipping'$quotes[$i]['id'] . '_' $quotes[$i]['methods'][$j]['id'], $default'id="ship-'.$quotes[$i]['id'] . '-' str_replace(' ''-'$quotes[$i]['methods'][$j]['id']), $checked .'"'); ?>
            
            <label for="ship-<?php echo $quotes[$i]['id'] . '-' str_replace(' ''-'$quotes[$i]['methods'][$j]['id']); ?>" class="checkboxLabel" ><?php echo $quotes[$i]['methods'][$j]['title']; ?></label>
            <!--</div>-->
            <hr class="clearBoth" />
            <?php
                        $radio_buttons
    ++;
                      }
                    }
            
    ?>

            </fieldset>
            <?php
                
    }
            
    // eof: field set
                  
    }

  2. #2
    Join Date
    Dec 2014
    Posts
    25
    Plugin Contributions
    0

    Default Re: Multi Store pickup location with drop down menu

    i replaced with the following code. it can now show all locations in drop down menu. However, when i click the checkout button, it displays "Please select a shipping method".
    It seems that the selected option is not passed.
    could anyone tell me what is missing?
    thanks


    PHP Code:
    <select>
    <?php
    for ($i=0$n=sizeof($quotes); $i<$n$i++) {
        for (
    $j=0$n2=sizeof($quotes[$i]['methods']); $j<$n2$j++) {
      
        echo 
    "<option value=".$quotes[$i]['methods'][$j]['title'].">".$quotes[$i]['methods'][$j]['title']."</option>";
    ?>
    </select>

  3. #3
    Join Date
    Dec 2014
    Posts
    25
    Plugin Contributions
    0

    Default Re: Multi Store pickup location with drop down menu

    no one?

  4. #4
    Join Date
    Dec 2014
    Posts
    25
    Plugin Contributions
    0

    Default Re: Multi Store pickup location with drop down menu

    solved with the below code.
    i think it is better to call zen_draw_pull_down_menu() instead of using a for loop.
    anyway, this is a quick solution to change the radio button to a drop down menu for many store pick up locations.

    <select name="shipping" id="shipping" onchange="updateForm();">

    <?php

    for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {
    for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {

    echo "<option value=".$quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] . " id=ship-".$quotes[$i]['id'] . '-' . $quotes[$i]['methods'][$j]['id'].'"'; ?>
    <?php if ($_POST['shipping'] == $quotes[$i]['methods'][$j]['title']) echo 'selected="selected"'; ?> <?php echo ">".$quotes[$i]['methods'][$j]['title']."</option>";
    }}
    ?>
    </select>

 

 

Similar Threads

  1. v151 How do I specify location in the shipping drop-down menu
    By SilverHD in forum General Questions
    Replies: 2
    Last Post: 6 May 2014, 05:20 PM
  2. v139h Shipping estimator location drop down menu font color change
    By RNRN in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Jun 2013, 03:54 PM
  3. Help with Drop down menu
    By melindaf in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 7 Aug 2009, 07:41 AM
  4. Help with Drop down menu
    By melindaf in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 6 Aug 2009, 07:05 AM
  5. Problem with custom drop down menu
    By christianpatrick in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 30 Jan 2009, 05:42 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR