Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

sdinft

Newbie
  
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sdinft's Achievements

Apprentice

Apprentice (3/14)

  • One Year In
  • First Post
  • Conversation Starter
  • Dedicated Rare
  • One Month Later

Recent Badges

0

Reputation

  1. не прокатило ошибок нет, но товары в заказе просто не выводятся
  2. Делаю вывод заказов и товаров к ним на странице аккаунта (OcStore 3). Заказы выводятся правильно (номер, дата, стоимость), а вот товары внутри заказа показываются только по самому первому заказу в списке. <?php //ORDERS $data['orders'] = array(); $this->load->model('account/order'); $order_info = $this->model_account_order->getOrder($order_id); $results = $this->model_account_order->getOrders(); foreach ($results as $result) { $data['orders'][] = array( 'order_id' => $result['order_id'], 'name' => $result['firstname'] . ' ' . $result['lastname'], 'status' => $result['status'], 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])), 'products' => ($product_total + $voucher_total), 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']), 'view' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], true), ); } // PRODUCTS_FOR_ORDERS $data['products'] = array(); $this->load->model('catalog/product'); $products = $this->model_account_order->getOrderProducts($result['order_id']); foreach ($products as $product) { $product_info = $this->model_catalog_product->getProduct($product['product_id']); if ($product_info['image']) { $image = '/image/' . $product_info['image']; } else { $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height')); } $data['products'][] = array( 'name' => $product['name'], 'thumb' => $image, 'model' => $product['model'], 'option' => $option_data, 'quantity' => $product['quantity'], 'price' => $this->currency->format($product['price'] + ($this->config->get('config_tax') ? $product['tax'] : 0), $order_info['currency_code'], $order_info['currency_value']), 'total' => $this->currency->format($product['total'] + ($this->config->get('config_tax') ? ($product['tax'] * $product['quantity']) : 0), $order_info['currency_code'], $order_info['currency_value']), 'href' => $this->url->link('product/product', 'order_id=' . $order_info['order_id'] . '&product_id=' . $product['product_id'], true) ); } Если в строке $products = $this->model_account_order->getOrderProducts($result['order_id']); $result['order_id'] поменять на номер заказа, то показывают товары уже правильно относительно заказа, но тоже во всех заказах в списке. Не могу правильно сформулировать зависимость товаров к заказу Подскажите, пожалуйста, в каком месте натупил? Можно коротко.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.