Post by opensab677 » Tue Jun 26, 2018 2:59 am

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

New member

Posts

Joined
Mon Sep 04, 2017 7:54 pm

Post by cyclops12 » Tue Jun 26, 2018 4:28 am

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.

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by opensab677 » Tue Jun 26, 2018 4:57 am

thanks

New member

Posts

Joined
Mon Sep 04, 2017 7:54 pm

Post by one2012 » Fri Jul 13, 2018 5:22 pm

Thank you cyclops12, your solution works for me too!

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by iSaulius » Wed Feb 27, 2019 9:05 pm

Thanks a lot!!!!
working on 3.0.3.1

Newbie

Posts

Joined
Tue Oct 16, 2012 2:02 am

Post by xseon » 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. :(

Deeper and Better Category Module
Mass Product Price Change


User avatar
New member

Posts

Joined
Thu Dec 01, 2011 3:04 pm
Location - Bulgaria

Post by nightwing » 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. :(

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Fri Mar 19, 2021 2:03 am

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. :(

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » 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

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by nightwing » Fri Mar 19, 2021 4:10 am

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

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » 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.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by nightwing » Fri Mar 19, 2021 4:35 am

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.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » 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?

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by nightwing » 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?

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Fri Mar 19, 2021 5:49 am

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?

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » 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,

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by nightwing » Fri Mar 19, 2021 6:19 am

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,

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by sw!tch » 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.
-

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm
Location - USA

Post by nightwing » 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.
-

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by nightwing » Fri Mar 19, 2021 9:58 pm

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.
-

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm

Who is online

Users browsing this forum: justint24, paulfeakins, ru-lefthanded, thekrotek and 27 guests