名称: cart 

功能: 读取购物车数据

示例:

# HTTP请求方式
http://esite.likun.work/?act=cart&ajax=yes

# 模板调用方式1
<?php $cart = EsiteApp::app()->cart(); ?>

# 模板调用方式2
商品总数量{$cart['numbers']}, 商品总金额{$cart['money']}

# 备注:具体的参数可以通过模板变量调试方法输出到浏览器控制台

 


数据格式参考:

Array
(
    [products] => Array
        (
            [0] => Array
                (
                    [id] => 52
                    [user_id] => 1
                    [product_id] => 35
                    [numbers] => 1
                    [exts] => []
                    [price] => 320
                    [money] => 320
                    [utime] => 1582155624
                    [info] => Array
                        (
                            [id] => 35
                            [cat_id] => 14
                            [filename] => 
                            [name] => 哥弟女装2018春季新款拼色长袖针织开衫A400135
                            [price] => 320
                            [weight] => 0.18
                            [sn] => 
                            [title] => 哥弟女装2018春季新款拼色长袖针织开衫A400135
                            [keywords] => 藏蓝 S M L
                            [description] => 哥弟女装2018春季新款拼色长袖针织开衫A400135
                            [image] => Array
                                (
                                    [0] => /esite_static/upload/image/day_180523/a693714497a9bbcf85aa7fc7254d3c87.jpg
                                    [1] => /esite_static/upload/image/day_180523/0520fdcce9dfbeb702297a5e3f8c4093.jpg
                                    [2] => /esite_static/upload/image/day_180523/03e96f5413a5200925dcd9784c24fd16.jpg
                                    [3] => /esite_static/upload/image/day_180523/9cc2367a2809cda2b78e7c7a60aae0a2.jpg
                                    [4] => /esite_static/upload/image/day_180523/dcfd9bf398652f1202f780ac2dba9afe.jpg
                                )

                            [edit_time] => 1532522276
                            [sort] => 0
                            [ext1] => 
                            [ext2] => 
                            [ext3] => 
                            [ext4] => 
                            [ext5] => 
                            [ext6] => 
                            [ext7] => 
                            [ext8] => 
                            [ext9] => 
                            [ext10] => 
                            [ext11] => 
                            [ext12] => 
                            [ext13] => 
                            [ext14] => 
                            [ext15] => 
                            [cat_unique_id] => 女士针织衫
                            [product_url] => /女士针织衫/35-product.html
                            [category_url] => /女士针织衫/p1-products.html
                        )

                )

            [1] => Array
                (
                    [id] => 53
                    [user_id] => 1
                    [product_id] => 47
                    [numbers] => 1
                    [exts] => []
                    [price] => 400
                    [money] => 400
                    [utime] => 1582155661
                    [info] => Array
                        (
                            [id] => 47
                            [cat_id] => 15
                            [filename] => 
                            [name] => 哥弟女装2018春季新款中袖绑带衬衫8300044
                            [price] => 400
                            [weight] => 0.18
                            [sn] => 
                            [title] => 哥弟女装2018春季新款中袖绑带衬衫8300044
                            [keywords] => 白色 S M L
                            [description] => 哥弟女装2018春季新款中袖绑带衬衫8300044
                            [image] => Array
                                (
                                    [0] => /esite_static/upload/image/day_180523/de2934cf7a907e7d1d48bb3d5f9225a0.jpg
                                    [1] => /esite_static/upload/image/day_180523/49e538553a5256a817fa6b3f746e02c1.jpg
                                    [2] => /esite_static/upload/image/day_180523/f8522373474c7c8f5935d3c893e4c03e.jpg
                                    [3] => /esite_static/upload/image/day_180523/7966015060960ac2e3cb1a0e5688ecff.jpg
                                    [4] => /esite_static/upload/image/day_180523/0355a1dec3ee5f6f30e41d277ed8c239.jpg
                                )

                            [edit_time] => 1527078327
                            [sort] => 0
                            [ext1] => 
                            [ext2] => 
                            [ext3] => 
                            [ext4] => 
                            [ext5] => 
                            [ext6] => 
                            [ext7] => 
                            [ext8] => 
                            [ext9] => 
                            [ext10] => 
                            [ext11] => 
                            [ext12] => 
                            [ext13] => 
                            [ext14] => 
                            [ext15] => 
                            [cat_unique_id] => 女士衬衫
                            [product_url] => /女士衬衫/47-product.html
                            [category_url] => /女士衬衫/p1-products.html
                        )

                )

        )

    [numbers] => 2
    [money] => 720
)