简体   繁体   中英

Shopp plugin in wordpress -to display select box of shipping method

I'm new to WordPress and a very new to "shopp plugin", I want to select box that displays shipping method

shopp('shipping', 'option-menu', 'difference=on');

This doesn't work. Please tell me in details about how to fetch this shipping method data using above code and where to look after the code for further changes to get the select box with details comes by OrderAmount-0, ItemQuantity-0 filling from [shipping menu] present in [system] side menu.

Try this code:

<?php if ( shopp('shipping', 'has-options') ): ?>
    <?php while ( shopp('shipping','options')): 
    $selected = ''; 
    if ( shopp('shipping','option-selected') ) 
        $selected = ' selected="selected"';
    $value = shopp('shipping','get-option-slug');
    $name = shopp('shipping','get-option-name');
    $cost = shopp('shipping','get-option-cost);
    $delivery = shopp('shipping', 'get-option-delivery');
    $label = $name.' &mdash '.$cost.' '.$delivery;
    ?>

    <select name="shipmethod" class="shopp shipmethod">
    <option value="<?php echo $value; ?>"<?php echo $selected; ?> ><?php echo $label; ?></option>
    </select>

    <?php endwhile; ?>
    <?php endif; ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM