ThaiSEOBoard.com

พัฒนาเว็บไซต์ => CMS & Free Script => ข้อความที่เริ่มโดย: mart7612 ที่ 07 มิถุนายน 2017, 13:12:30



หัวข้อ: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 13:12:30
opencart  เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ

เพราะเวลาลูกสั่งสินค้าเข้ามาบ้างทีก็งง อยากให้ดึกรูปสินค้ามาโชว์ด้วย ผมต้องไปแก้ตรงไหนครับ

(https://www.img.in.th/images/ea89aeed6ed36c7f431f7ab39453dad6.md.png)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: SingThong ที่ 07 มิถุนายน 2017, 13:18:05

.


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 13:21:09
ทำยังไงครับ ตรงข้อมูลการสั่งซื้อ ให้โชว์แบบตรงนี้ ให้มีรูปสินค้าด้วย  :-X



หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 13:29:45
ทำยังไงครับ ตรงข้อมูลการสั่งซื้อ ให้โชว์แบบตรงนี้ ให้มีรูปสินค้าด้วย  :-X



ใช้ opencart version อะไรยุครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 14:03:37
Version 2.3.0.2 ครับ ปรับได้ไหมครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: maneemeena ที่ 07 มิถุนายน 2017, 14:57:07
ได้ครับ catlog/controller/account/order.php
หา method public function info()
หา loop ที่มันดึงข้อมูลสินค้าจากคำสั่งซื้อ จะเจอ

โค๊ด:
foreach ($products as $product) {

...
}
ก่อน loop foreach () ก็ load->model('tool/image'); มาใช้งานก่อน เพื่อเรียกใช้ฟังชั่นเปลี่ยนขนาดรูป

แล้วก็ใส่ตัวแปรรูปใน loop ต่อจาก $product_info

            
โค๊ด:
if ($product_info['image']) {
$image = $this->model_tool_image->resize($product_info['image'], $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
} else {
$image = $this->model_tool_image->resize('placeholder.png', $this->config->get($this->config->get('config_theme') . '_image_product_width'), $this->config->get($this->config->get('config_theme') . '_image_product_height'));
}

ได้ค่า $image มาแล้วก็ใส่ลงไปใน array ของ

โค๊ด:
$data['products'][] = array
...
'image' => $image,

แล้วฝั่ง template/account/order_info.tpl ก็ดึงรูปมาใช้ได้เลยครับ

ทั้งหมดที่ว่ามานี้ ควรทำเป็น vqmod จะดีงามพระราม 9 ครับ :wanwan020: :wanwan020: :wanwan020:


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 15:06:41
หาที่ใส่ตามที่บอกไม่เจออะครับ  ใส่ยังไงหรอ :P รบกวนหน่อยครับ

catlog/controller/account/order.php
โค๊ด:
<?php
class ControllerAccountOrder extends Controller {
public function index() {
if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('account/order'''true);

$this->response->redirect($this->url->link('account/login'''true));
}

$this->load->language('account/order');

$this->document->setTitle($this->language->get('heading_title'));

$url '';

if (isset($this->request->get['page'])) {
$url .= '&page=' $this->request->get['page'];
}

$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home')
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_account'),
'href' => $this->url->link('account/account'''true)
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('account/order'$urltrue)
);

$data['heading_title'] = $this->language->get('heading_title');

$data['text_empty'] = $this->language->get('text_empty');

$data['column_order_id'] = $this->language->get('column_order_id');
$data['column_customer'] = $this->language->get('column_customer');
$data['column_product'] = $this->language->get('column_product');
$data['column_total'] = $this->language->get('column_total');
$data['column_status'] = $this->language->get('column_status');
$data['column_date_added'] = $this->language->get('column_date_added');

$data['button_view'] = $this->language->get('button_view');
$data['button_continue'] = $this->language->get('button_continue');

if (isset($this->request->get['page'])) {
$page $this->request->get['page'];
} else {
$page 1;
}

$data['orders'] = array();

$this->load->model('account/order');

$order_total $this->model_account_order->getTotalOrders();

$results $this->model_account_order->getOrders(($page 1) * 1010);

foreach ($results as $result) {
$product_total $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']);
$voucher_total $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']);

$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),
);
}

$pagination = new Pagination();
$pagination->total $order_total;
$pagination->page $page;
$pagination->limit 10;
$pagination->url $this->url->link('account/order''page={page}'true);

$data['pagination'] = $pagination->render();

$data['results'] = sprintf($this->language->get('text_pagination'), ($order_total) ? (($page 1) * 10) + 0, ((($page 1) * 10) > ($order_total 10)) ? $order_total : ((($page 1) * 10) + 10), $order_totalceil($order_total 10));

$data['continue'] = $this->url->link('account/account'''true);

$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');

$this->response->setOutput($this->load->view('account/order_list'$data));
}

public function info() {
$this->load->language('account/order');

if (isset($this->request->get['order_id'])) {
$order_id $this->request->get['order_id'];
} else {
$order_id 0;
}

if (!$this->customer->isLogged()) {
$this->session->data['redirect'] = $this->url->link('account/order/info''order_id=' $order_idtrue);

$this->response->redirect($this->url->link('account/login'''true));
}

$this->load->model('account/order');

$order_info $this->model_account_order->getOrder($order_id);

if ($order_info) {
$this->document->setTitle($this->language->get('text_order'));

$url '';

if (isset($this->request->get['page'])) {
$url .= '&page=' $this->request->get['page'];
}

$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home')
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_account'),
'href' => $this->url->link('account/account'''true)
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('account/order'$urltrue)
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_order'),
'href' => $this->url->link('account/order/info''order_id=' $this->request->get['order_id'] . $urltrue)
);

$data['heading_title'] = $this->language->get('text_order');

$data['text_order_detail'] = $this->language->get('text_order_detail');
$data['text_invoice_no'] = $this->language->get('text_invoice_no');
$data['text_order_id'] = $this->language->get('text_order_id');
$data['text_date_added'] = $this->language->get('text_date_added');
$data['text_shipping_method'] = $this->language->get('text_shipping_method');
$data['text_shipping_address'] = $this->language->get('text_shipping_address');
$data['text_payment_method'] = $this->language->get('text_payment_method');
$data['text_payment_address'] = $this->language->get('text_payment_address');
$data['text_history'] = $this->language->get('text_history');
$data['text_comment'] = $this->language->get('text_comment');
$data['text_no_results'] = $this->language->get('text_no_results');

$data['column_name'] = $this->language->get('column_name');
$data['column_model'] = $this->language->get('column_model');
$data['column_quantity'] = $this->language->get('column_quantity');
$data['column_price'] = $this->language->get('column_price');
$data['column_total'] = $this->language->get('column_total');
$data['column_action'] = $this->language->get('column_action');
$data['column_date_added'] = $this->language->get('column_date_added');
$data['column_status'] = $this->language->get('column_status');
$data['column_comment'] = $this->language->get('column_comment');

$data['button_reorder'] = $this->language->get('button_reorder');
$data['button_return'] = $this->language->get('button_return');
$data['button_continue'] = $this->language->get('button_continue');

if (isset($this->session->data['error'])) {
$data['error_warning'] = $this->session->data['error'];

unset($this->session->data['error']);
} else {
$data['error_warning'] = '';
}

if (isset($this->session->data['success'])) {
$data['success'] = $this->session->data['success'];

unset($this->session->data['success']);
} else {
$data['success'] = '';
}

if ($order_info['invoice_no']) {
$data['invoice_no'] = $order_info['invoice_prefix'] . $order_info['invoice_no'];
} else {
$data['invoice_no'] = '';
}

$data['order_id'] = $this->request->get['order_id'];
$data['date_added'] = date($this->language->get('date_format_short'), strtotime($order_info['date_added']));

if ($order_info['payment_address_format']) {
$format $order_info['payment_address_format'];
} else {
$format '{firstname} {lastname}' "\n" '{company}' "\n" '{address_1}' "\n" '{address_2}' "\n" '{city} {postcode}' "\n" '{zone}' "\n" '{country}';
}

$find = array(
'{firstname}',
'{lastname}',
'{company}',
'{address_1}',
'{address_2}',
'{city}',
'{postcode}',
'{zone}',
'{zone_code}',
'{country}'
);

$replace = array(
'firstname' => $order_info['payment_firstname'],
'lastname'  => $order_info['payment_lastname'],
'company'   => $order_info['payment_company'],
'address_1' => $order_info['payment_address_1'],
'address_2' => $order_info['payment_address_2'],
'city'      => $order_info['payment_city'],
'postcode'  => $order_info['payment_postcode'],
'zone'      => $order_info['payment_zone'],
'zone_code' => $order_info['payment_zone_code'],
'country'   => $order_info['payment_country']
);

$data['payment_address'] = str_replace(array("\r\n""\r""\n"), '<br />'preg_replace(array("/\s\s+/""/\r\r+/""/\n\n+/"), '<br />'trim(str_replace($find$replace$format))));

$data['payment_method'] = $order_info['payment_method'];

if ($order_info['shipping_address_format']) {
$format $order_info['shipping_address_format'];
} else {
$format '{firstname} {lastname}' "\n" '{company}' "\n" '{address_1}' "\n" '{address_2}' "\n" '{city} {postcode}' "\n" '{zone}' "\n" '{country}';
}

$find = array(
'{firstname}',
'{lastname}',
'{company}',
'{address_1}',
'{address_2}',
'{city}',
'{postcode}',
'{zone}',
'{zone_code}',
'{country}'
);

$replace = array(
'firstname' => $order_info['shipping_firstname'],
'lastname'  => $order_info['shipping_lastname'],
'company'   => $order_info['shipping_company'],
'address_1' => $order_info['shipping_address_1'],
'address_2' => $order_info['shipping_address_2'],
'city'      => $order_info['shipping_city'],
'postcode'  => $order_info['shipping_postcode'],
'zone'      => $order_info['shipping_zone'],
'zone_code' => $order_info['shipping_zone_code'],
'country'   => $order_info['shipping_country']
);

$data['shipping_address'] = str_replace(array("\r\n""\r""\n"), '<br />'preg_replace(array("/\s\s+/""/\r\r+/""/\n\n+/"), '<br />'trim(str_replace($find$replace$format))));

$data['shipping_method'] = $order_info['shipping_method'];

$this->load->model('catalog/product');
$this->load->model('tool/upload');

// Products
$data['products'] = array();

$products $this->model_account_order->getOrderProducts($this->request->get['order_id']);

foreach ($products as $product) {
$option_data = array();

$options $this->model_account_order->getOrderOptions($this->request->get['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($value020) . '..' $value)
);
}

$product_info $this->model_catalog_product->getProduct($product['product_id']);

if ($product_info) {
$reorder $this->url->link('account/order/reorder''order_id=' $order_id '&order_product_id=' $product['order_product_id'], true);
} else {
$reorder '';
}

$data['products'][] = array(
'name'     => $product['name'],
'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)
);
}

// Voucher
$data['vouchers'] = array();

$vouchers $this->model_account_order->getOrderVouchers($this->request->get['order_id']);

foreach ($vouchers as $voucher) {
$data['vouchers'][] = array(
'description' => $voucher['description'],
'amount'      => $this->currency->format($voucher['amount'], $order_info['currency_code'], $order_info['currency_value'])
);
}

// Totals
$data['totals'] = array();

$totals $this->model_account_order->getOrderTotals($this->request->get['order_id']);

foreach ($totals as $total) {
$data['totals'][] = array(
'title' => $total['title'],
'text'  => $this->currency->format($total['value'], $order_info['currency_code'], $order_info['currency_value']),
);
}

$data['comment'] = nl2br($order_info['comment']);

// History
$data['histories'] = array();

$results $this->model_account_order->getOrderHistories($this->request->get['order_id']);

foreach ($results as $result) {
$data['histories'][] = array(
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'status'     => $result['status'],
'comment'    => $result['notify'] ? nl2br($result['comment']) : ''
);
}

$data['continue'] = $this->url->link('account/order'''true);

$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');

$this->response->setOutput($this->load->view('account/order_info'$data));
} else {
$this->document->setTitle($this->language->get('text_order'));

$data['heading_title'] = $this->language->get('text_order');

$data['text_error'] = $this->language->get('text_error');

$data['button_continue'] = $this->language->get('button_continue');

$data['breadcrumbs'] = array();

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home')
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_account'),
'href' => $this->url->link('account/account'''true)
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('account/order'''true)
);

$data['breadcrumbs'][] = array(
'text' => $this->language->get('text_order'),
'href' => $this->url->link('account/order/info''order_id=' $order_idtrue)
);

$data['continue'] = $this->url->link('account/order'''true);

$data['column_left'] = $this->load->controller('common/column_left');
$data['column_right'] = $this->load->controller('common/column_right');
$data['content_top'] = $this->load->controller('common/content_top');
$data['content_bottom'] = $this->load->controller('common/content_bottom');
$data['footer'] = $this->load->controller('common/footer');
$data['header'] = $this->load->controller('common/header');

$this->response->setOutput($this->load->view('error/not_found'$data));
}
}

public function reorder() {
$this->load->language('account/order');

if (isset($this->request->get['order_id'])) {
$order_id $this->request->get['order_id'];
} else {
$order_id 0;
}

$this->load->model('account/order');

$order_info $this->model_account_order->getOrder($order_id);

if ($order_info) {
if (isset($this->request->get['order_product_id'])) {
$order_product_id $this->request->get['order_product_id'];
} else {
$order_product_id 0;
}

$order_product_info $this->model_account_order->getOrderProduct($order_id$order_product_id);

if ($order_product_info) {
$this->load->model('catalog/product');

$product_info $this->model_catalog_product->getProduct($order_product_info['product_id']);

if ($product_info) {
$option_data = array();

$order_options $this->model_account_order->getOrderOptions($order_product_info['order_id'], $order_product_id);

foreach ($order_options as $order_option) {
if ($order_option['type'] == 'select' || $order_option['type'] == 'radio' || $order_option['type'] == 'image') {
$option_data[$order_option['product_option_id']] = $order_option['product_option_value_id'];
} elseif ($order_option['type'] == 'checkbox') {
$option_data[$order_option['product_option_id']][] = $order_option['product_option_value_id'];
} elseif ($order_option['type'] == 'text' || $order_option['type'] == 'textarea' || $order_option['type'] == 'date' || $order_option['type'] == 'datetime' || $order_option['type'] == 'time') {
$option_data[$order_option['product_option_id']] = $order_option['value'];
} elseif ($order_option['type'] == 'file') {
$option_data[$order_option['product_option_id']] = $this->encryption->encrypt($order_option['value']);
}
}

$this->cart->add($order_product_info['product_id'], $order_product_info['quantity'], $option_data);

$this->session->data['success'] = sprintf($this->language->get('text_success'), $this->url->link('product/product''product_id=' $product_info['product_id']), $product_info['name'], $this->url->link('checkout/cart'));

unset($this->session->data['shipping_method']);
unset($this->session->data['shipping_methods']);
unset($this->session->data['payment_method']);
unset($this->session->data['payment_methods']);
} else {
$this->session->data['error'] = sprintf($this->language->get('error_reorder'), $order_product_info['name']);
}
}
}

$this->response->redirect($this->url->link('account/order/info''order_id=' $order_id));
}
}


template/account/order_info.tpl
โค๊ด:
<?php echo $header?>

<div class="container">

  <ul class="breadcrumb">

    <?php foreach ($breadcrumbs as $breadcrumb) { ?>

    <li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a></li>

    <?php ?>

  </ul>

  <?php if ($success) { ?>

  <div class="alert alert-success"><i class="fa fa-check-circle"></i> <?php echo $success?>

    <button type="button" class="close" data-dismiss="alert">&times;</button>

  </div>

  <?php ?>

  <?php if ($error_warning) { ?>

  <div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> <?php echo $error_warning?>

    <button type="button" class="close" data-dismiss="alert">&times;</button>

  </div>

  <?php ?>

  <div class="row"><?php echo $column_left?>

    <?php if ($column_left && $column_right) { ?>

    <?php $class 'col-sm-6'?>

    <?php } elseif ($column_left || $column_right) { ?>

    <?php $class 'col-sm-9'?>

    <?php } else { ?>

    <?php $class 'col-sm-12'?>

    <?php ?>

    <div id="content" class="<?php echo $class?>"><?php echo $content_top?>

      <h2><?php echo $heading_title?></h2>

      <table class="table table-bordered table-hover">

        <thead>

          <tr>

            <td class="text-left" colspan="2"><?php echo $text_order_detail?></td>

          </tr>

        </thead>

        <tbody>

          <tr>

            <td class="text-left" style="width: 50%;"><?php if ($invoice_no) { ?>

              <b><?php echo $text_invoice_no?></b> <?php echo $invoice_no?><br />

              <?php ?>

              <b><?php echo $text_order_id?></b> #<?php echo $order_id?><br />

              <b><?php echo $text_date_added?></b> <?php echo $date_added?></td>

            <td class="text-left" style="width: 50%;"><?php if ($payment_method) { ?>

              <b><?php echo $text_payment_method?></b> <?php echo $payment_method?><br />

              <?php ?>

              <?php if ($shipping_method) { ?>

              <b><?php echo $text_shipping_method?></b> <?php echo $shipping_method?>

              <?php ?></td>

          </tr>

        </tbody>

      </table>

      <table class="table table-bordered table-hover">

        <thead>

          <tr>

            <td class="text-left" style="width: 50%; vertical-align: top;"><?php echo $text_payment_address?></td>

            <?php if ($shipping_address) { ?>

            <td class="text-left" style="width: 50%; vertical-align: top;"><?php echo $text_shipping_address?></td>

            <?php ?>

          </tr>

        </thead>

        <tbody>

          <tr>

            <td class="text-left"><?php echo $payment_address?></td>

            <?php if ($shipping_address) { ?>

            <td class="text-left"><?php echo $shipping_address?></td>

            <?php ?>

          </tr>

        </tbody>

      </table>

      <div class="table-responsive">

        <table class="table table-bordered table-hover">

          <thead>

            <tr>

              <td class="text-left"><?php echo $column_name?></td>

              <td class="text-left"><?php echo $column_model?></td>

              <td class="text-right"><?php echo $column_quantity?></td>

              <td class="text-right"><?php echo $column_price?></td>

              <td class="text-right"><?php echo $column_total?></td>

              <?php if ($products) { ?>

              <td style="width: 20px;"></td>

              <?php ?>

            </tr>

          </thead>

          <tbody>

            <?php foreach ($products as $product) { ?>

            <tr>

              <td class="text-left"><?php echo $product['name']; ?>

                <?php foreach ($product['option'] as $option) { ?>

                <br />

                &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>

                <?php ?></td>

              <td class="text-left"><?php echo $product['model']; ?></td>

              <td class="text-right"><?php echo $product['quantity']; ?></td>

              <td class="text-right"><?php echo $product['price']; ?></td>

              <td class="text-right"><?php echo $product['total']; ?></td>

              <td class="text-right" style="white-space: nowrap;"><?php if ($product['reorder']) { ?>

                <a href="<?php echo $product['reorder']; ?>" data-toggle="tooltip" title="<?php echo $button_reorder?>" class="btn btn-primary"><i class="fa fa-shopping-cart"></i></a>

                <?php ?>

                <a href="<?php echo $product['return']; ?>" data-toggle="tooltip" title="<?php echo $button_return?>" class="btn btn-danger"><i class="fa fa-reply"></i></a></td>

            </tr>

            <?php ?>

            <?php foreach ($vouchers as $voucher) { ?>

            <tr>

              <td class="text-left"><?php echo $voucher['description']; ?></td>

              <td class="text-left"></td>

              <td class="text-right">1</td>

              <td class="text-right"><?php echo $voucher['amount']; ?></td>

              <td class="text-right"><?php echo $voucher['amount']; ?></td>

              <?php if ($products) { ?>

              <td></td>

              <?php ?>

            </tr>

            <?php ?>

          </tbody>

          <tfoot>

            <?php foreach ($totals as $total) { ?>

            <tr>

              <td colspan="3"></td>

              <td class="text-right"><b><?php echo $total['title']; ?></b></td>

              <td class="text-right"><?php echo $total['text']; ?></td>

              <?php if ($products) { ?>

              <td></td>

              <?php ?>

            </tr>

            <?php ?>

          </tfoot>

        </table>

      </div>

      <?php if ($comment) { ?>

      <table class="table table-bordered table-hover">

        <thead>

          <tr>

            <td class="text-left"><?php echo $text_comment?></td>

          </tr>

        </thead>

        <tbody>

          <tr>

            <td class="text-left"><?php echo $comment?></td>

          </tr>

        </tbody>

      </table>

      <?php ?>

      <?php if ($histories) { ?>

      <h3><?php echo $text_history?></h3>

      <table class="table table-bordered table-hover">

        <thead>

          <tr>

            <td class="text-left"><?php echo $column_date_added?></td>

            <td class="text-left"><?php echo $column_status?></td>

            <td class="text-left"><?php echo $column_comment?></td>

          </tr>

        </thead>

        <tbody>

          <?php if ($histories) { ?>

          <?php foreach ($histories as $history) { ?>

          <tr>

            <td class="text-left"><?php echo $history['date_added']; ?></td>

            <td class="text-left"><?php echo $history['status']; ?></td>

            <td class="text-left"><?php echo $history['comment']; ?></td>

          </tr>

          <?php ?>

          <?php } else { ?>

          <tr>

            <td colspan="3" class="text-center"><?php echo $text_no_results?></td>

          </tr>

          <?php ?>

        </tbody>

      </table>

      <?php ?>

      <div class="buttons clearfix">

        <div class="pull-right"><a href="<?php echo $continue?>" class="btn btn-primary"><?php echo $button_continue?></a></div>

      </div>

      <?php echo $content_bottom?></div>

    <?php echo $column_right?></div>

</div>

<?php echo $footer?>


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 15:23:07
โค๊ด:
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=23579

อยากได้ประมาณนี้หรอ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 15:26:02
โค๊ด:
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=23579

อยากได้ประมาณนี้หรอ


ใช้ครับ เสียตังด้วย :-X

มีแบบแก้ง่ายๆไหมครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 15:35:43
โค๊ด:
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=23579

อยากได้ประมาณนี้หรอ


ใช้ครับ เสียตังด้วย :-X

มีแบบแก้ง่ายๆไหมครับ
หน้า orderที่จะต้องการ นี่คือหน้าที่ลูกค้าจะกด confirm ตอนซื้อใช่มะ หรือหน้าOrder history หลังจากซื้อไปแล้ว

// แก้ไข

โทดทีครับ chrome รูปที่ให้ดูมันไม่ขึ้น ต้องดูกับfirefox เดี๋ยวเขียน vqmodให้ครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 15:42:25
โค๊ด:
https://www.opencart.com/index.php?route=marketplace/extension/info&extension_id=23579

อยากได้ประมาณนี้หรอ


ใช้ครับ เสียตังด้วย :-X

มีแบบแก้ง่ายๆไหมครับ
หน้า orderที่จะต้องการ นี่คือหน้าที่ลูกค้าจะกด confirm ตอนซื้อใช่มะ หรือหน้าOrder history หลังจากซื้อไปแล้ว

// แก้ไข

โทดทีครับ chrome รูปที่ให้ดูมันไม่ขึ้น ต้องดูกับfirefox เดี๋ยวเขียน vqmodให้ครับ



จริงอยากให้โชว์รูปที่ระบบหลังร้านครับ หน้า admin  อะ

/admin/index.php?route=sale/order/info&token

(https://www.uppic.org/image-0312_5937BD22.jpg)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: infamous ที่ 07 มิถุนายน 2017, 16:40:28
admin/controller/sale/order.php

หาบรรทัด 1011
โค๊ด:
$data['products'] = array();
วางโค๊ดนี้ไว้ด้านล่าง
โค๊ด:
$this->load->model('tool/image');


หาบรรทัด 1041
โค๊ด:
$data['products'][] = array(
วางโค๊ดนี้ไว้ด้านบน
โค๊ด:
if (is_file(DIR_IMAGE . $product['image'])) {
$image = $this->model_tool_image->resize($product['image'], 100, 100);
} else {
$image = $this->model_tool_image->resize('no_image.png', 100, 100);
}
หาบรรทัด 1044
โค๊ด:
'name'    	 	   => $product['name'],
วางโค๊ดนี้ไว้ด้านบน
โค๊ด:
'image'    	 	   => $image,

admin/view/template/sale/order_info.tpl

หาบรรทัด 150
โค๊ด:
<td class="text-left"><?php echo $column_product?></td>
วางโค๊ดนี้ไว้ด้านบน
โค๊ด:
<td></td>
หาบรรทัด 160
โค๊ด:
<td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
วางโค๊ดนี้ไว้ด้านบน
โค๊ด:
<td><?php echo $product['image']; ?></td>

opencart เวอร์ชั่นใหม่ๆ ผมแนะนำให้ลงพวก vQmod Editor/vQmod Manager มาลงนะครับ เวลาแก้ไขอะไรไปมันจะไม่กระทบถึงไฟล์เดิม(core) ครับ

ปอลิง. ขอค่าตอบแทนเป็นหนังซักแผ่นสิครับ  :wanwan016:


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 17:21:28
เกือบได้ละครับแต่รูปไม่โชว์ 

(https://www.img.in.th/images/888c1d3d247ea3a4c55e45e99c2c7343.md.png)

\\ เอาหนังแนวไหนครับ  :'(


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: infamous ที่ 07 มิถุนายน 2017, 17:33:09
เกือบได้ละครับแต่รูปไม่โชว์ 

(https://www.img.in.th/images/888c1d3d247ea3a4c55e45e99c2c7343.md.png)

\\ เอาหนังแนวไหนครับ  :'(

โทษทีท่าน ผมลืมไปตัวหนึ่ง
เปลี่ยนจาก
โค๊ด:
<td><?php echo $product[&#39;image&#39;]; ?></td>

เป็น
โค๊ด:
<td><img src="<?php echo $product[&#39;image&#39;]; ?>" alt="<?php echo $product[&#39;name&#39;]; ?>" class="img-thumbnail" /></td>

ถ้าสินค้ามีรูป และรูป no_image.png มีในเว็บมันต้องโชว์ครับ ไม่อย่างใดอย่างหนึ่ง ลอง view source ดูครับ

ส่วนหนัง ผมล้อท่านเล่นครับ  :wanwan024:


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: tinnakorn2499 ที่ 07 มิถุนายน 2017, 17:41:07
คุณ infamous ผม +1 ให้ครับ #คนมีน้ำใจ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 17:46:46
เกือบได้ละครับแต่รูปไม่โชว์ 

(https://www.img.in.th/images/888c1d3d247ea3a4c55e45e99c2c7343.md.png)

\\ เอาหนังแนวไหนครับ  :'(

โทษทีท่าน ผมลืมไปตัวหนึ่ง
เปลี่ยนจาก
โค๊ด:
<td><?php echo $product[&#39;image&#39;]; ?></td>

เป็น
โค๊ด:
<td><img src="<?php echo $product[&#39;image&#39;]; ?>" alt="<?php echo $product[&#39;name&#39;]; ?>" class="img-thumbnail" /></td>

ถ้าสินค้ามีรูป และรูป no_image.png มีในเว็บมันต้องโชว์ครับ ไม่อย่างใดอย่างหนึ่ง ลอง view source ดูครับ

ส่วนหนัง ผมล้อท่านเล่นครับ  :wanwan024:


แก้ตรงไหนหรอครับ ชุดนี้ 

ขอบคุณมากครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 17:58:23
ลง VQmod รึยังครับ ผมลองเขียนให้เสร็จแล้ว มีแสดงที่
1. หน้าconfirm เวลาซื้อ
2. หน้า order history ของลูกค้า
3. หน้า order info ของ admin

ถ้าไม่ลงVqmod ก็ลงไว้เลยครับ เดี๋ยวส่งไฟล์ให้


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครū
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 18:07:20
ลง VQmod รึยังครับ ผมลองเขียนให้เสร็จแล้ว มีแสดงที่
1. หน้าconfirm เวลาซื้อ
2. หน้า order history ของลูกค้า
3. หน้า order info ของ admin

ถ้าไม่ลงVqmod ก็ลงไว้เลยครับ เดี๋ยวส่งไฟล์ให้


ลงยังไงครับ Vqmod ไม่รู้จริงๆครับ

แปปนะครับกำลังหาวิธีลง


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 18:14:45
ลง VQmod รึยังครับ ผมลองเขียนให้เสร็จแล้ว มีแสดงที่
1. หน้าconfirm เวลาซื้อ
2. หน้า order history ของลูกค้า
3. หน้า order info ของ admin

ถ้าไม่ลงVqmod ก็ลงไว้เลยครับ เดี๋ยวส่งไฟล์ให้


ลงยังไงครับ Vqmod ไม่รู้จริงๆครับ

https://github.com/vqmod/vqmod/releases

โหลดมาลงแปปเดียว ผมใช้ 2.6 เขียนให้นะครับ
(https://www.mx7.com/i/b45/ku9uMT.jpg)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครū
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 18:26:55
ลงละครับไม่แน่ทำถูกไหมลากไฟล์ไปใส่เซิฟละ



ขึ้นว่า

VQMOD ALREADY INSTALLED!


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 18:34:35
install vqmod แล้วเอาไปลง

โค๊ด:
https://yadi.sk/d/yX4C5WiB3JuSPW

เอาไปใส่ที่ vqmod/xml

แล้วลองเปิดหน้าorderดู


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 18:58:32
install vqmod แล้วเอาไปลง

โค๊ด:
https://yadi.sk/d/yX4C5WiB3JuSPW

เอาไปใส่ที่ vqmod/xml

แล้วลองเปิดหน้าorderดู

ได้แต่ในหน้า adminครับ
(https://www.uppic.org/image-17C7_5937EA24.jpg)
ส่วนหน้าลูกค้าขึ้นแต่ชื่อ
(https://www.uppic.org/image-8E22_5937EA24.jpg)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 19:02:46
install vqmod แล้วเอาไปลง

โค๊ด:
https://yadi.sk/d/yX4C5WiB3JuSPW

เอาไปใส่ที่ vqmod/xml

แล้วลองเปิดหน้าorderดู

ได้แต่ในหน้า adminครับ
(https://www.uppic.org/image-17C7_5937EA24.jpg)
ส่วนหน้าลูกค้าขึ้นแต่ชื่อ
(https://www.uppic.org/image-8E22_5937EA24.jpg)


ขอดู error
ไปดูที่ vqmod/log
ของผมลองแล้วได้ปกติ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครū
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 19:09:02
หน้านี้ปะครับ
เหมือนผมจะติดตั้ง vqmod ไม่ผ่านหรือป่าวครับ
ขึ้นว่า
VQMOD ALREADY INSTALLED!

(https://www.uppic.org/image-C6C2_5937EC9A.jpg)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครū
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 19:14:42
หน้านี้ปะครับ
เหมือนผมจะติดตั้ง vqmod ไม่ผ่านหรือป่าวครับ
ขึ้นว่า
VQMOD ALREADY INSTALLED!

(https://www.uppic.org/image-C6C2_5937EC9A.jpg)

5555+
ไม่ใช่ครับ เข้าไปดูที่hostครับ ไฟล์จะอยู่ที่ vqmod/logs
จะมีไฟล์ txt อยู่ครับ


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 19:18:36
ขึ้นแบบนี้อะครับ


---------- Date: 2017-06-07 18:52:35 ~ IP : 171.6.214.215 ----------
REQUEST URI : /index.php?route=account/order
MOD DETAILS:
   modFile   : /home/istylesh/domains/istyleshoes.com/public_html/vqmod/xml/image_order.xml
   id        : Image Oder - Affsom thaiseo board
   version   : 1.4.x and above
   vqmver    : 2.6.0
   author    : Affsom

File Name    : catalog/controller/account/order.php(1)
VQModObject::applyMod - SEARCH NOT FOUND (SKIPPED): 'name'     => $product['name'],

----------------------------------------------------------------------


---------- Date: 2017-06-07 18:53:11 ~ IP : 171.6.214.215 ----------
REQUEST URI : /index.php?route=account/order/info&order_id=25
MOD DETAILS:
   modFile   : /home/istylesh/domains/istyleshoes.com/public_html/vqmod/xml/image_order.xml
   id        : Image Oder - Affsom thaiseo board
   version   : 1.4.x and above
   vqmver    : 2.6.0
   author    : Affsom

File Name    : catalog/controller/account/order.php(1)
VQModObject::applyMod - SEARCH NOT FOUND (SKIPPED): 'name'     => $product['name'],

----------------------------------------------------------------------


---------- Date: 2017-06-07 19:04:11 ~ IP : 171.6.214.215 ----------
REQUEST URI : /index.php?route=account/order/info&order_id=25
VQMod::_parseMods - INVALID XML FILE: : Opening and ending tag mismatch: add line 83 and td in /home/istylesh/domains/istyleshoes.com/public_html/vqmod/xml/image_order.xml, line: 87
----------------------------------------------------------------------


---------- Date: 2017-06-07 19:06:07 ~ IP : 171.6.214.215 ----------
REQUEST URI : /admin/index.php?route=sale/order/info&token=YhFxoXrKwJlS3WP0w2CuVJBUP6hbMXmy&order_id=25&filter_order_status=5,1,2,12,3
VQMod::_parseMods - INVALID XML FILE: : Opening and ending tag mismatch: add line 129 and td in /home/istylesh/domains/istyleshoes.com/public_html/vqmod/xml/image_order.xml, line: 133


หน้านี้ขึ้นครับ แต่ตรงข้อมูลการสั่งซื้อ ไม่ขึ้น  แต่ได้แค่นี้ก็ดีใจมากแล้ว  ขอบคุณมากๆนะครับ  แต่รูปนี้กดซูมไม่ได้ใช่ไหมครับ
(https://www.uppic.org/image-8D89_5937EE65.jpg)


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 19:24:11
ขอไฟล์ php
1- catalog/controller/account/order.php

จะเอาซูมก็ได้ หรือว่ามีรูปตอนส่ง Invoid ก็ได้ แต่ต้องขอดูก่อน เพราะปกติเล่นแต่ v.1.5 v2.3 ไม่ค่อยได้ดูอาจใช้เวลา
ผมว่าพี่น่าจะเคยลงvqmodมาก่อนแล้วนะ เพราะที่หน้าเวปเห็นมี module การสอบถามอะไรนั่นมาด้วย code xml อาจทับกันมั้ง ลองดูที่
vqmod/xml ว่ามีกี่ไฟล์ ถ้าเพิ่งลง จะมี อยู่2ไฟล์ คือที่ผมส่งไปกับของระบบ

 :P :P


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 19:33:09
ขอไฟล์ php
1- catalog/controller/account/order.php

จะเอาซูมก็ได้ หรือว่ามีรูปตอนส่ง Invoid ก็ได้ แต่ต้องขอดูก่อน เพราะปกติเล่นแต่ v.1.5 v2.3 ไม่ค่อยได้ดูอาจใช้เวลา
ผมว่าพี่น่าจะเคยลงvqmodมาก่อนแล้วนะ เพราะที่หน้าเวปเห็นมี module การสอบถามอะไรนั่นมาด้วย code xml อาจทับกันมั้ง ลองดูที่
vqmod/xml ว่ามีกี่ไฟล์ ถ้าเพิ่งลง จะมี อยู่2ไฟล์ คือที่ผมส่งไปกับของระบบ

 :P :P

โชว์แต่ตรง admin ก็ได้ครับ อยากให้กดดูได้

https://drive.google.com/file/d/0B9vOIdaYZmx9WHQ3XzdDQmVVbDQ/view?usp=sharing


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 19:37:45
อ่อตรงโค้ดสอบถาม ผมเอาไปใส่ ไว้ไฟล์นั้นเลยครับ  ผมไม่รู้ว่ามีผลไรไหมใช้ไม่เป็นเลยจัดง่ายๆเลยครับ  :P :P

catalog/view/theme/default/template/common/footer.tpl


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: affsom ที่ 07 มิถุนายน 2017, 19:49:05
อ่อตรงโค้ดสอบถาม ผมเอาไปใส่ ไว้ไฟล์นั้นเลยครับ  ผมไม่รู้ว่ามีผลไรไหมใช้ไม่เป็นเลยจัดง่ายๆเลยครับ  :P :P

catalog/view/theme/default/template/common/footer.tpl

มีผลตอนที่เราจะแก้ไฟล์ จาก vqmod เพราะมันจะหาสิ่งที่ต้องการแก้ไขไม่เจอถ้าเกิดเขียน vqmod แล้วมันไปตรงกับจุดที่เราแก้ที่ไฟล์หลัก ใช้vqmodในการแก้ดีกว่าครับ
และผมลองดูไฟล์ ก็เป็นต้นฉบับ ลองเคลียร์ vqmod แคช โดย
เข้าไปลบ
vqmod/vqcche
กับลบ ไฟล์ logs ทิ้งให้หมด

แล้วลองดูใหม่ จะต้องมีไฟล์vqmod/vqcache อยู่ 14 ไฟล์
ของระบบ 6 และที่ผมเขียนไปอีก 8

ถ้าไม่ได้ต้องดูที่logsใหม่ เพราะที่ส่งมามันมีการเรียกใช้หลายครั้ง logsมันซ้ำ
ถ้ายังไม่ได้ส่งไฟล์ มาอีก 2
catalog/view/theme/default/template/account/order_info.tpl
catalog/model/account/order.php

เดี๋ยวช่วยดูกำลังว่าง ไม่งั้นก็ ลง Chrome Remote Desktop เดี๋ยวดูให้


หัวข้อ: Re: opencart เราสามารถดึงภาพมากโชว์ตรงorderได้ไหมครับ
เริ่มหัวข้อโดย: mart7612 ที่ 07 มิถุนายน 2017, 23:58:01
อ่อตรงโค้ดสอบถาม ผมเอาไปใส่ ไว้ไฟล์นั้นเลยครับ  ผมไม่รู้ว่ามีผลไรไหมใช้ไม่เป็นเลยจัดง่ายๆเลยครับ  :P :P

catalog/view/theme/default/template/common/footer.tpl

มีผลตอนที่เราจะแก้ไฟล์ จาก vqmod เพราะมันจะหาสิ่งที่ต้องการแก้ไขไม่เจอถ้าเกิดเขียน vqmod แล้วมันไปตรงกับจุดที่เราแก้ที่ไฟล์หลัก ใช้vqmodในการแก้ดีกว่าครับ
และผมลองดูไฟล์ ก็เป็นต้นฉบับ ลองเคลียร์ vqmod แคช โดย
เข้าไปลบ
vqmod/vqcche
กับลบ ไฟล์ logs ทิ้งให้หมด


 แล้วลองดูใหม่ จะต้องมีไฟล์vqmod/vqcache อยู่ 14 ไฟล์
ของระบบ 6 และที่ผมเขียนไปอีก 8

ถ้าไม่ได้ต้องดูที่logsใหม่ เพราะที่ส่งมามันมีการเรียกใช้หลายครั้ง logsมันซ้ำ
ถ้ายังไม่ได้ส่งไฟล์ มาอีก 2
catalog/view/theme/default/template/account/order_info.tpl
catalog/model/account/order.php

เดี๋ยวช่วยดูกำลังว่าง ไม่งั้นก็ ลง Chrome Remote Desktop เดี๋ยวดูให้



ไม่ได้เหมือนเดิมครับ ขอโทษทีครับที่มาอ่านช้าไป พอดีน้ำท่วม เข้าบ้าน
มีเฟสไหมครับจะได้คุยกันสะดวกหน่อย :)

https://drive.google.com/open?id=0B9vOIdaYZmx9akMyRUJfYXN3WWM