Создание, продвижение сайтов
40-33-54

Программный вывод корзины товаров Drupal Commerce

07 августа 2018
global $user;
if ($order = commerce_cart_order_load($user->uid)) {
 $wrapper = entity_metadata_wrapper('commerce_order', $order);
 if (commerce_line_items_quantity($wrapper->commerce_line_items, commerce_product_line_item_types()) > 0) {
  echo commerce_embed_view('commerce_cart_form', 'default', array($order->order_id), 'cart');
 }
}

Статьи