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

时间:2015-05-26 12:38:58

标签: php wordpress plugins shopp

我是WordPress的新手,也是一个非常新的“shopp插件”, 我想选择显示送货方式的方框

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

这不起作用。请详细告诉我如何使用上面的代码获取此送货方法数据以及在哪里查看代码以进行进一步更改以获取包含详细信息的选择框来自OrderAmount-0,ItemQuantity-0从[shipping menu]填写[系统]侧面菜单。

1 个答案:

答案 0 :(得分:0)

试试这段代码:

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