Post by haxcop » Mon Oct 18, 2021 11:04 pm

Hello.

I would like to get a solution to this issue I have with some ocmod's which opencart seems to not found the line of code in question to apply the mod
OC V 3.0.3.6
MySQL 8
Table oc_modification xml longtext utf8mb4_general_ci
PHP 7.3

Here's the code
File: admin/view/template/sale/order_info.twig
Error:

Code: Select all

MOD: OpenCart Track Shipment
NOT FOUND!
CODE: data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),
FILE: admin/view/template/sale/order_info.twig
XML

Code: Select all

<operation>
            <!-- add history add tracking number and courier var -->
            <search>
                <![CDATA[data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),]]></search>
            <add position="replace"><![CDATA[
        data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()) + '&tracking_number=' + encodeURIComponent($('input[name=\'tracking_number\']').val()) + '&courier_slug=' + encodeURIComponent($('select[name=\'courier_slug\']').val()),
      ]]></add>
        </operation>
This kind of situation is being happened with many of my ocmod files and I would like to know if any of you here have had that experience before and know how to address this correctly?

Thanks!
Last edited by haxcop on Wed Oct 20, 2021 12:40 am, edited 1 time in total.

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Mon Oct 18, 2021 11:30 pm

Contact the extension developer to resolve this issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by by mona » Tue Oct 19, 2021 12:14 am

To understand what is happening you have to understand what it is supposed to do.

LOCATE - this file
FIND - some code
REPLACE - use this code instead

So basically it has found he file but it has not found the code

Why? Well usually because you have another mod that has already located the same file and the same code and replaced it already.
This is not always the case, but you can check by :-
Locating the file in your system/modifications folder (the rest of the directory will be exactly as the ocmod path) - is it there? has that code been changed?

Straightlight already answered what you should do if you are unable to resolve that yourself. I just thought I would add why it might be and not to assume that it is a developers “fault” as such .. this is part of the reason that some people here would like to move towards events.

However each system has its own pluses and minuses and ocmod is a great system, as was vqmod .. again vqmod was / is better in some ways - ocmods advantage - removing the files on uninstall - but neither check for duplicated files (files used by more than one extension) on uninstall. Nothing is perfect.

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


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by haxcop » Tue Oct 19, 2021 12:53 am

straightlight wrote:
Mon Oct 18, 2021 11:30 pm
Contact the extension developer to resolve this issue.
Honestly and no offence intended...
if all your answers on this forum will be offering a paid service or tell us to look for the developer who build the extension - Doesn't help at all, limit yourself to help or do not do this kind of bad moves.

Most of us know those two options but we are a community or at least that's how I see it, to help each other - that is the purpose of the forum.

Thanks again,

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by haxcop » Tue Oct 19, 2021 1:03 am

by mona wrote:
Tue Oct 19, 2021 12:14 am
To understand what is happening you have to understand what it is supposed to do.

LOCATE - this file
FIND - some code
REPLACE - use this code instead

So basically it has found he file but it has not found the code

Why? Well usually because you have another mod that has already located the same file and the same code and replaced it already.
This is not always the case, but you can check by :-
Locating the file in your system/modifications folder (the rest of the directory will be exactly as the ocmod path) - is it there? has that code been changed?

Straightlight already answered what you should do if you are unable to resolve that yourself. I just thought I would add why it might be and not to assume that it is a developers “fault” as such .. this is part of the reason that some people here would like to move towards events.

However each system has its own pluses and minuses and ocmod is a great system, as was vqmod .. again vqmod was / is better in some ways - ocmods advantage - removing the files on uninstall - but neither check for duplicated files (files used by more than one extension) on uninstall. Nothing is perfect.
Hi, Thanks for your Real answer.

as you mentioned, yes I did my ocmod "correctly" as I can see and there's no other mod using the file in question.
That's my reason of question that maybe some of you found the same kind of issues when using ocmod, In other instances, I have had to just add a comment bellow/after the code I want to replace - modify or add, and this tent to work and do the job, but in other instances, it seems that it cannot find the code needed and throw the error even though the line exists and the file is not being used or replaced by other instance.


Here's the code to avoid misunderstanding
This method doesn't work

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Ship</name>
    <id>ship</id>
    <version>3.0.0</version>
    <link>http://</link>
    <author>Ship</author>
    <code>ship</code>
<file path="admin/view/template/sale/order_info.twig">
        <operation>
            <!-- add history add tracking number and courier var -->
            <search>
                <![CDATA[data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),]]></search>
            <add position="replace"><![CDATA[
        data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()) + '&tracking_number=' + encodeURIComponent($('input[name=\'tracking_number\']').val()) + '&courier_slug=' + encodeURIComponent($('select[name=\'courier_slug\']').val()),
      ]]></add>
        </operation>
        </file>
        </modification>
This method works

and here's the code after doing an alteration in the original Opencart file "../order_info.twig" adding a double forward bar
before

Code: Select all

data:
after

Code: Select all

//data:
Here's the code to avoid misunderstanding

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
    <name>Ship</name>
    <id>ship</id>
    <version>3.0.0</version>
    <link>http://</link>
    <author>Ship</author>
    <code>ship</code>
<file path="admin/view/template/sale/order_info.twig">
        <operation>
            <!-- add history add tracking number and courier var -->
            <search>
                <![CDATA[//data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),]]></search>
            <add position="replace"><![CDATA[
        data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '&notify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()) + '&tracking_number=' + encodeURIComponent($('input[name=\'tracking_number\']').val()) + '&courier_slug=' + encodeURIComponent($('select[name=\'courier_slug\']').val()),
      ]]></add>
        </operation>
        </file>
        </modification>

Thanks again and looking forward for your support on this matter

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by by mona » Tue Oct 19, 2021 1:29 am

works for me
I write differently - and I am not sure why your comment is where it is - that would not be correct
anyway works - there is no problem with OCMOD or the code

Attachments

Screen-Shot-2021-10-18-at-18.24.54.png

Screen-Shot-2021-10-18-at-18.24.54.png (82.19 KiB) Viewed 725 times

Screen-Shot-2021-10-18-at-18.21.18.png

Screen-Shot-2021-10-18-at-18.21.18.png (19.41 KiB) Viewed 725 times


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


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by haxcop » Tue Oct 19, 2021 1:47 am

The comment was just to test if the search was or not working.
Looks like was a caching issue on my side - I have tested on a clean install. and worked now... Anyway Thanks for your Time ;D

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Tue Oct 19, 2021 3:05 am

haxcop wrote:
Tue Oct 19, 2021 12:53 am
straightlight wrote:
Mon Oct 18, 2021 11:30 pm
Contact the extension developer to resolve this issue.
Honestly and no offence intended...
if all your answers on this forum will be offering a paid service or tell us to look for the developer who build the extension - Doesn't help at all, limit yourself to help or do not do this kind of bad moves.

Most of us know those two options but we are a community or at least that's how I see it, to help each other - that is the purpose of the forum.

Thanks again,
As you quoted my last response yourself, and does not indicate that paid services should be used but rather to contact the extension developer since you're referring to an installed extension, then the purpose of this forum is indeed to, not only follow the forum rules about support itself, but also that the purpose of the forum as you say is to contact the proper channels when something is not in regards of the OC core. Otherwise, especially from paid extensions, you are affecting support from the extension developers where these people can provide support specifically.

Therefore, to conclude, this forum has never been about troubleshooting extension packages in the first place. This analogy is only based on you and yours only.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by haxcop » Tue Oct 19, 2021 4:27 am

With all due respect ... You are very, very, very wrong.
that's not a paid extension - It's a Free extension without the support and I had to modify it accordingly, besides I was asking for a Review of whoever wants it to have the time and look at it and help me debug my issue which the other user did very polite and accordingly to the question.

The main question was about the search of Opencart OCMOD functionality FYI

You have a Bad Positive attitude, and that is you always reply in the same manner, either asking for premium support or a very irresponsible reply like you just did early today.
Please save your time and effort and just reply if you are willing to help, and don't get me wrong, everyone has the right to get paid for work but at least try to earn it when at least it goes beyond a simple line of code

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Tue Oct 19, 2021 5:02 am

haxcop wrote:
Tue Oct 19, 2021 4:27 am
With all due respect ... You are very, very, very wrong.
that's not a paid extension - It's a Free extension without the support and I had to modify it accordingly, besides I was asking for a Review of whoever wants it to have the time and look at it and help me debug my issue which the other user did very polite and accordingly to the question.

The main question was about the search of Opencart OCMOD functionality FYI

You have a Bad Positive attitude, and that is you always reply in the same manner, either asking for premium support or a very irresponsible reply like you just did early today.
Please save your time and effort and just reply if you are willing to help, and don't get me wrong, everyone has the right to get paid for work but at least try to earn it when at least it goes beyond a simple line of code
What I did mentioned on the previous reply is especially if it's a paid extension, and not regarding a free extension specifically. Take note that extension developers don't need to provide support via free extensions from the Marketplace. However, since you have already modified the extension accordingly, but looking for a developer to take a look at the issue, you could always create a new service request in the Commercial Support section of the forum to have this issue investigated as a custom job.

I do appreciate your understanding, as you'd be absolutely right, about developers that do have the right to get paid for the work and services they provide willingly as your request might be, indeed, about a bigger project than expected on the public forum to achieve. Which is why, the Commercial Support has been suggested to you. Whether you decide to take it or leave it, at this point, is totally up to you.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by haxcop » Tue Oct 19, 2021 5:08 am

The main question was about the search of Opencart OCMOD functionality FYI

Thank you for your time.
Have a nice day

New member

Posts

Joined
Tue Jan 14, 2014 9:38 pm
Location - Dublin

Post by straightlight » Tue Oct 19, 2021 5:11 am

haxcop wrote:
Tue Oct 19, 2021 5:08 am
The main question was about the search of Opencart OCMOD functionality FYI

Thank you for your time.
Have a nice day
From the forum topic's perspective, yes. However, custom codes and extensions are also included, as much as information, as it is about codes on the first post which is what you are really asking about.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: DesignCart and 99 guests