Page 1 of 2

[SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Tue Jun 26, 2018 2:59 am
by opensab677
In OC 3.0.2 I go in extensions then in order totals and then into sub-total option where I place a number in the field sort order but opencart doesn't save it. I think it's a bug. Any suggestions to fix it?
thanks

Re: in opencart 3.0.2 I can't save order number in subtotal

Posted: Tue Jun 26, 2018 4:28 am
by cyclops12
Just looked into this and you will need to edit the controller and view files.
Open admin/controller/extension/total/sub_total.php and find

Code: Select all

if (isset($this->request->post['sub_total_sort_order'])) {
			$data['sub_total_sort_order'] = $this->request->post['sub_total_sort_order'];
		} else {
			$data['sub_total_sort_order'] = $this->config->get('sub_total_sort_order');
		}
And change it to

Code: Select all

if (isset($this->request->post['total_sub_total_sort_order'])) {
			$data['total_sub_total_sort_order'] = $this->request->post['total_sub_total_sort_order'];
		} else {
			$data['total_sub_total_sort_order'] = $this->config->get('total_sub_total_sort_order');
		}
Then open admin/view/template/extension/total/sub_total.twig and find

Code: Select all

              <input type="text" name="sub_total_sort_order" value="{{ sub_total_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control" />
And change it to

Code: Select all

 <input type="text" name="total_sub_total_sort_order" value="{{ total_sub_total_sort_order }}" placeholder="{{ entry_total_sort_order }}" id="input-sort-order" class="form-control" />
Refresh your cache and it should work.
You have the original codes above if needed.

Re: in opencart 3.0.2 I can't save order number in subtotal

Posted: Tue Jun 26, 2018 4:57 am
by opensab677
thanks

Re: in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Jul 13, 2018 5:22 pm
by one2012
Thank you cyclops12, your solution works for me too!

Re: in opencart 3.0.2 I can't save order number in subtotal

Posted: Wed Feb 27, 2019 9:05 pm
by iSaulius
Thanks a lot!!!!
working on 3.0.3.1

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Wed Feb 10, 2021 6:48 pm
by xseon
It works in the admin only. I see no effect in the front-end. Subtotal is always first. :(

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Tue Mar 16, 2021 10:14 pm
by nightwing
Using 3.0.3.2 Default theme, after doing some research I have come across: https://github.com/opencart/opencart/co ... 704aa7aeba. I have applied both changes, recommended by cyclops12 and in the github post however, its still not working properly. The Sort order now saves in the admin panel, however if I add any number other than 0, it kicks out the other total extensions like shipping, store credit. If I disable sub-total, it 0 the order total.

Please note that I did not perform this portion of the github post:

Code: Select all

- (0, 'total_sub_total', 'sub_total_sort_order', '1', 0),
+ (0, 'total_sub_total', 'total_sub_total_sort_order', '1', 0),
as after checking oc_setting I only see

Code: Select all

'total_sub_total', 'total_sub_total_status'
xseon wrote:
Wed Feb 10, 2021 6:48 pm
It works in the admin only. I see no effect in the front-end. Subtotal is always first. :(

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 2:03 am
by nightwing
Does anyone know of a working solution for this problem?
nightwing wrote:
Tue Mar 16, 2021 10:14 pm
Using 3.0.3.2 Default theme, after doing some research I have come across: https://github.com/opencart/opencart/co ... 704aa7aeba. I have applied both changes, recommended by cyclops12 and in the github post however, its still not working properly. The Sort order now saves in the admin panel, however if I add any number other than 0, it kicks out the other total extensions like shipping, store credit. If I disable sub-total, it 0 the order total.

Please note that I did not perform this portion of the github post:

Code: Select all

- (0, 'total_sub_total', 'sub_total_sort_order', '1', 0),
+ (0, 'total_sub_total', 'total_sub_total_sort_order', '1', 0),
as after checking oc_setting I only see

Code: Select all

'total_sub_total', 'total_sub_total_status'
xseon wrote:
Wed Feb 10, 2021 6:48 pm
It works in the admin only. I see no effect in the front-end. Subtotal is always first. :(

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 2:20 am
by sw!tch
Uninstall the module and then activate it again after the changes. Clear your theme and modification cache.

See these.

https://github.com/opencart/opencart/co ... c42d0eabc8
https://github.com/opencart/opencart/co ... 9dde938612
https://github.com/opencart/opencart/co ... 704aa7aeba

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 4:10 am
by nightwing
Hi sw!tch,

All those changes were already made. I uninstalled, cleared mod and cache, reinstalled, and enabled the extension, same issue. As I was saying before, I did not perform the changes at the end of this file : https://github.com/opencart/opencart/co ... 704aa7aeba

Code: Select all

@@ -3345,7 +3345,7 @@ INSERT INTO `oc_setting` (`store_id`, `code`, `key`, `value`, `serialized`) VALU
(0, 'shipping_flat', 'shipping_flat_tax_class_id', '9', 0),
(0, 'shipping_flat', 'shipping_flat_cost', '5.00', 0),
(0, 'total_shipping', 'total_shipping_sort_order', '3', 0),
-(0, 'total_sub_total', 'sub_total_sort_order', '1', 0),
+(0, 'total_sub_total', 'total_sub_total_sort_order', '1', 0),
(0, 'total_sub_total', 'total_sub_total_status', '1', 0),
(0, 'total_tax', 'total_tax_status', '1', 0),
(0, 'total_total', 'total_total_sort_order', '9', 0),
I am not sure how do do this part as it affects upload/install/opencart.sql and this store is already istalled, I would have to probably modify the table, when I checked I see no indications of this.
sw!tch wrote:
Fri Mar 19, 2021 2:20 am
Uninstall the module and then activate it again after the changes. Clear your theme and modification cache.

See these.

https://github.com/opencart/opencart/co ... c42d0eabc8
https://github.com/opencart/opencart/co ... 9dde938612
https://github.com/opencart/opencart/co ... 704aa7aeba

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 4:17 am
by sw!tch
You dont need the upload/install/opencart.sql change. Double check your changes again, its important you clear your theme cache as well.

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 4:35 am
by nightwing
Hey sw!tch the below are in my files, I uninstalled the extension, cleared mod, cleared both caches and reinstalled, same effect.
sub_total.php (controller)

Code: Select all

    	if (isset($this->request->post['total_sub_total_sort_order'])) {
			$data['total_sub_total_sort_order'] = $this->request->post['total_sub_total_sort_order'];
		} else {
			$data['total_sub_total_sort_order'] = $this->config->get('total_sub_total_sort_order');
		}
sub_total.twig

Code: Select all

<input type="text" name="total_sub_total_sort_order" value="{{ total_sub_total_sort_order }}" placeholder="{{ entry_sort_order }}" id="input-sort-order" class="form-control" />
catalog > model (sub_total.php)

Code: Select all

'sort_order' => $this->config->get('total_sub_total_sort_order')
sw!tch wrote:
Fri Mar 19, 2021 4:17 am
You dont need the upload/install/opencart.sql change. Double check your changes again, its important you clear your theme cache as well.

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 5:14 am
by sw!tch

Code: Select all

SELECT * FROM `oc_setting` WHERE `key` = 'total_sub_total_sort_order';
How many results are coming up? What is the code value?

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 5:37 am
by nightwing
One moment...
sw!tch wrote:
Fri Mar 19, 2021 5:14 am

Code: Select all

SELECT * FROM `oc_setting` WHERE `key` = 'total_sub_total_sort_order';
How many results are coming up? What is the code value?

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 5:49 am
by nightwing
Hi sw!tch
How many results are coming up? 1
What is the code value? total_sub_total
nightwing wrote:
Fri Mar 19, 2021 5:37 am
One moment...
sw!tch wrote:
Fri Mar 19, 2021 5:14 am

Code: Select all

SELECT * FROM `oc_setting` WHERE `key` = 'total_sub_total_sort_order';
How many results are coming up? What is the code value?

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 6:04 am
by sw!tch
Well appears installed correct. What do you mean by kicks out the other order total extensions? You should have each order total listed in its proper sort order.

Need more info. Screenshot or something,

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 6:19 am
by nightwing
Ok, when I change the sort order of sub_total to anything but 0, Store Credit, Shipping is removed from the Cart totals. Below are screenshots from a single account with store credit and products, all I do is update the sort order of sub-total and refresh - This number is not conflicting with any other order total extension.
When sub_total is 0
https://ibb.co/d7VvPG9

When sub_total is not 0, for example 6
https://ibb.co/6HJqqBP
sw!tch wrote:
Fri Mar 19, 2021 6:04 am
Well appears installed correct. What do you mean by kicks out the other order total extensions? You should have each order total listed in its proper sort order.

Need more info. Screenshot or something,

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 3:33 pm
by sw!tch
@nightwing - Open a new thread with this issue if you want help debugging. This is unlikely related the original topic.
-

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 3:51 pm
by nightwing
Thanks sw!tch, will do in the morning.
sw!tch wrote:
Fri Mar 19, 2021 3:33 pm
@nightwing - Open a new thread with this issue if you want help debugging. This is unlikely related the original topic.
-

Re: [SOLVED] - in opencart 3.0.2 I can't save order number in subtotal

Posted: Fri Mar 19, 2021 9:58 pm
by nightwing
Hi sw!tch, the new post is being tracked here: viewtopic.php?f=201&t=223030
nightwing wrote:
Fri Mar 19, 2021 3:51 pm
Thanks sw!tch, will do in the morning.
sw!tch wrote:
Fri Mar 19, 2021 3:33 pm
@nightwing - Open a new thread with this issue if you want help debugging. This is unlikely related the original topic.
-