[英]Shopp plugin in wordpress -to display select box of shipping method
我是WordPress的新手,並且是“ shopp插件”的新手,我想選擇顯示運輸方式的框
shopp('shipping', 'option-menu', 'difference=on');
這行不通。 請詳細告訴我有關如何使用上面的代碼獲取此運送方式數據以及如何在代碼中查找進一步更改以獲取帶有詳細信息的選擇框的信息,這些信息由OrderAmount-0,ItemQuantity-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; ?>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.