Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Shopp:如何按slug对类别进行排序_Php_Sorting_Shopp - Fatal编程技术网

Php Shopp:如何按slug对类别进行排序

Php Shopp:如何按slug对类别进行排序,php,sorting,shopp,Php,Sorting,Shopp,我需要显示按slug排序的类别。 有人能帮我吗 这是我目前的代码: <?php if(shopp('catalog','has-categories')): ?> <ul class="products"> <li class="row"> <ul> <?php while(shopp('catalog','categories')): ?> <li class=

我需要显示按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');
可能重复的