国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.2KB

  1. <?php
  2. /**
  3. *
  4. * 显示购物车的商品
  5. *
  6. * @version $Id: car.php$
  7. * @package DedeCMS.Site
  8. * @copyright Copyright (c) 2020, DedeBIZ.COM
  9. * @license https://www.dedebiz.com/license
  10. * @link https://www.dedebiz.com
  11. */
  12. require_once (dirname(__FILE__) . "/../include/common.inc.php");
  13. define('_PLUS_TPL_', DEDEROOT.'/templets/plus');
  14. require_once(DEDEINC.'/dedetemplate.class.php');
  15. require_once DEDEINC.'/shopcar.class.php';
  16. require_once DEDEINC.'/memberlogin.class.php';
  17. $cart = new MemberShops();
  18. if(isset($dopost) && $dopost=='makeid')
  19. {
  20. AjaxHead();
  21. $cart->MakeOrders();
  22. echo $cart->OrdersId;
  23. exit;
  24. }
  25. $cfg_ml = new MemberLogin();
  26. //获得购物车内商品,返回数组
  27. $Items = $cart->getItems();
  28. if($cart->cartCount() < 1)
  29. {
  30. ShowMsg("购物车中不存在任何商品!", "javascript:window.close();", false, 5000);
  31. exit;
  32. }
  33. @sort($Items);
  34. $carts = array(
  35. 'orders_id' => $cart->OrdersId,
  36. 'cart_count' => $cart->cartCount(),
  37. 'price_count' => $cart->priceCount()
  38. );
  39. $dtp = new DedeTemplate();
  40. $dtp->Assign('carts',$carts);
  41. $dtp->LoadTemplate(_PLUS_TPL_.'/car.htm');
  42. $dtp->Display();
  43. exit;