Woocommerce product options

Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

I have custom realization - where i can add to product items, i can get for product items like this:

<?php if(!empty($cart_item['more_product'])) :
                                    $first_array = array_slice($cart_item['more_product'],0,4);
                                    $second_array = array_slice($cart_item['more_product'],4);
                                ?>
                            <div class="products__includes">

                                <div class="products__includes__btn active">
                                    Set includes
                                </div> 
                                <div class="products__includes__wrap">
                                    <div class="products__includes__inner">
                                        <table>
                                            <tbody>
                                        <?php foreach($first_array as $piece): ?>
                                            <tr>
                                                <th><?php echo $piece['title'];?></th>
                                                <th><?php echo $piece['count'];?></th>
                                            </tr>
                                        <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        <?php if(!empty($second_array)):?>
                                            <table>
                                                <tbody>
                                                <?php foreach($second_array as $piece): ?>
                                                    <tr>
                                                        <th><?php echo $piece['title'];?></th>
                                                        <th><?php echo $piece['count'];?></th>
                                                    </tr>
                                                <?php endforeach;?>
                                                </tbody>
                                            </table>
                                        <?php endif; ?>


                                    </div>  

                                </div>

                            </div>
                            <?php endif; ?>

i need get this all in order, how i can do?

Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question

I have custom realization - where i can add to product items, i can get for product items like this:

<?php if(!empty($cart_item['more_product'])) :
                                    $first_array = array_slice($cart_item['more_product'],0,4);
                                    $second_array = array_slice($cart_item['more_product'],4);
                                ?>
                            <div class="products__includes">

                                <div class="products__includes__btn active">
                                    Set includes
                                </div> 
                                <div class="products__includes__wrap">
                                    <div class="products__includes__inner">
                                        <table>
                                            <tbody>
                                        <?php foreach($first_array as $piece): ?>
                                            <tr>
                                                <th><?php echo $piece['title'];?></th>
                                                <th><?php echo $piece['count'];?></th>
                                            </tr>
                                        <?php endforeach;?>
                                            </tbody>
                                        </table>
                                        <?php if(!empty($second_array)):?>
                                            <table>
                                                <tbody>
                                                <?php foreach($second_array as $piece): ?>
                                                    <tr>
                                                        <th><?php echo $piece['title'];?></th>
                                                        <th><?php echo $piece['count'];?></th>
                                                    </tr>
                                                <?php endforeach;?>
                                                </tbody>
                                            </table>
                                        <?php endif; ?>


                                    </div>  

                                </div>

                            </div>
                            <?php endif; ?>

i need get this all in order, how i can do?

Share Improve this question asked Oct 28, 2019 at 19:17 LerryLerry 1111 gold badge2 silver badges10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Put a look here for all sort possibility with an array: https://www.php/manual/fr/array.sorting.php

Look here for array_reverse if you want to reverse the list: https://www.php/manual/en/function.array-reverse.php

EDIT: But maybe you want to manually sort your items?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745048929a4608265.html

相关推荐

  • Woocommerce product options

    Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress.

    7小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信