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

tr0jan

Newbie
  
  • Posts

    1
  • Joined

  • Last visited

tr0jan's Achievements

Newbie

Newbie (1/14)

  • Dedicated Rare
  • First Post
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Вывод списка товаров в истории заказов (order_list.twig) OpenCart 3.x В файле контроллера ("/catalog/controller/account/order.php") Найти $data['orders'][] = array( Добавить выше // List Products $data['products'] = array(); $products = $this->model_account_order->getOrderProducts($result['order_id']); foreach ($products as $product) { $option_data = array(); $options = $this->model_account_order->getOrderOptions($result['order_id'], $product['order_product_id']); foreach ($options as $option) { if ($option['type'] != 'file') { $value = $option['value']; } else { $upload_info = $this->model_tool_upload->getUploadByCode($option['value']); if ($upload_info) { $value = $upload_info['name']; } else { $value = ''; } } $option_data[] = array( 'name' => $option['name'], 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value) ); } $data['products'][] = array( 'name' => $product['name'], 'href' => $this->url->link('product/product', 'product_id=' . $product['product_id'], true), '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']), 'reorder' => $reorder, 'return' => $this->url->link('account/return/add', 'order_id=' . $order_info['order_id'] . '&product_id=' . $product['product_id'], true) ); } Найти 'products' => ($product_total + $voucher_total), Ниже добавить 'list' => $data['list_products'], В файле шаблона ("/catalog/view/theme/default/template/account/order_list.twig") Найти {% for order in orders %} Ниже, в нужном месте (до {% endfor %}), вставить и стилизовать под себя {% for product in order.products %} <ul> <li class="name"><a href="{{ product.href }}">{{ product.name }}</a></li> <li class="option">{% for option in product.option %}<br />&nbsp;<small> - {{ option.name }}: {{ option.value }}</small>{% endfor %}</li> <li class="model">{{ product.model }}</li> <li class="quantity">{{ product.quantity }}</li> <li class="price">{{ product.price }}</li> <li class="total">{{ product.total }}</li> <li class="reorder">{% if product.reorder %}<a href="{{ product.reorder }}">&nbsp;</a>{% endif %}</li> <li class="return"><a href="{{ product.return }}">&nbsp;</a></li> </ul> {% endfor %} Готово
Guest
×
  • 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.