简体   繁体   English

Wordpress中的Shopp插件-显示选择运输方式的框

[英]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 我是WordPress的新手,并且是“ shopp插件”的新手,我想选择显示运输方式的框

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. 请详细告诉我有关如何使用上面的代码获取此运送方式数据以及如何在代码中查找进一步更改以获取带有详细信息的选择框的信息,这些信息由OrderAmount-0,ItemQuantity-0(来自[运送菜单]中的[系统]侧菜单。

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; ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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