OC version.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
If you can't find an extension, you could pay a developer such as ourselves or post a job in the Commercial Support Forum.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
First add some code to admin/controller/sale/order.php.
In function shipping() search:
Code: Select all
foreach ($products as $product) {
Code: Select all
$total_weight = 0;
Code: Select all
$product_data[] = array(
'name' => $product_info['name'],
'model' => $product_info['model'],
'option' => $option_data,
'quantity' => $product['quantity'],
'location' => $product_info['location'],
'sku' => $product_info['sku'],
'upc' => $product_info['upc'],
'ean' => $product_info['ean'],
'jan' => $product_info['jan'],
'isbn' => $product_info['isbn'],
'mpn' => $product_info['mpn'],
'weight' => $this->weight->format(($product_info['weight'] + (float)$option_weight) * $product['quantity'], $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))
);
Code: Select all
$total_weight += ($product_info['weight'] + (float)$option_weight) * $product['quantity'];
Code: Select all
'product' => $product_data,
Code: Select all
'total_weight' => $this->weight->format($total_weight, $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point')),
For example at the end of the product table:
Code: Select all
<td>{{ product.weight }}</td>
<td>{{ product.model }}</td>
<td class="text-right">{{ product.quantity }}</td>
</tr>
{% endfor %}
Code: Select all
<tr>
<td colspan="2"></td>
<td>Total weight</td>
<td>{{ order.total_weight }}</td>
<td colspan="2"></td>
</tr>
now i get this
Notice: Undefined variable: total_weight in /var/www/vhosts/shop.hair-service.be/storage/modification/admin/controller/sale/order.php on line 1935
that is this line
$total_weight += ($product_info['weight'] + (float)$option_weight) * $product['quantity'];
Notice: Undefined variable: total_weight in /var/www/vhosts/shop.hair-service.be/storage/modification/admin/controller/sale/order.php on line 1935
that is this line
$total_weight += ($product_info['weight'] + (float)$option_weight) * $product['quantity'];
Did you add ?
pprmkr wrote: ↑Mon Oct 31, 2022 8:39 pmFirst add some code to admin/controller/sale/order.php.
In function shipping() search:Add before:Code: Select all
foreach ($products as $product) {
Code: Select all
$total_weight = 0;
No OC version / No theme / No extensions
Maybe its the theme / extension that is editing the change ?
@xwalker You could try putting a lot more information into your request ?
Maybe its the theme / extension that is editing the change ?
@xwalker You could try putting a lot more information into your request ?
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
Who is online
Users browsing this forum: Baidu [Spider] and 106 guests