[英]Shopp: How to sort categories by slug
我需要顯示按子彈排序的類別。 誰能幫我?
到目前為止,這是我的代碼:
<?php if(shopp('catalog','has-categories')): ?>
<ul class="products">
<li class="row">
<ul>
<?php while(shopp('catalog','categories')): ?>
<li class="product">
<div class="frame">
<a href="<?php shopp('category','url'); ?>"><?php shopp('category','coverimage','setting=thumbnails'); ?></a>
<a href="<?php shopp('category','url'); ?>" class="category-link"><h3><?php shopp('category','name'); ?></h3></a>
</div>
</li>
<?php endwhile; ?>
</ul>
</li>
</ul>
<?php endif; ?>
另一種方法是
$categories = shopp('storefront.category-list','load=true&orderby=slug');
foreach ($categories as $category){
// the category markup code goes here
}
您必須添加一些li和ul標簽
如果您只需要一個鏈表使用
shopp('storefront.category-list','orderby=slug');
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.