Skip to content

Commit

Permalink
https://github.com/opencart/opencart/issues/12661
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Mar 24, 2024
1 parent 3e960fc commit ba22182
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions upload/catalog/controller/checkout/confirm.php
Expand Up @@ -234,6 +234,7 @@ public function index(): string {
// Products
$order_data['products'] = [];

// Use cart products to get data for order
$products = $this->cart->getProducts();

foreach ($products as $product) {
Expand Down Expand Up @@ -320,22 +321,13 @@ public function index(): string {

$data['products'] = [];

// Use model cart products to get data for template
$products = $this->model_checkout_cart->getProducts();

foreach ($products as $product) {
if ($product['option']) {
foreach ($product['option'] as $key => $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 = '';
}
}

$product['option'][$key]['value'] = (oc_strlen($value) > 20 ? oc_substr($value, 0, 20) . '..' : $value);
$product['option'][$key]['value'] = (oc_strlen($option['value']) > 20 ? oc_substr($option['value'], 0, 20) . '..' : $option['value']);
}
}

Expand Down

0 comments on commit ba22182

Please sign in to comment.