Post by dandys71 » Wed Feb 24, 2021 1:58 am

Hello there,

I am tring to develop some modules in ocmode. After first installion everythink works fine. But when I want to install another module and I click on refresh button in Modifications my changes made by my first modules via install.xml are gone (When I look to FTP to storage I can see that files disappeared from modification folder). But changes of new module are made. All files from upload folder are uploaded correctly.

Remove and install my module again doesn't work, too. I can't use clear cache because it destroys eshop frontend (it looks like style.css missing or something like that, but for custumers is shop unusable...).

I use opencart 3.0.3.2.

Thank you for every idea.
Last edited by dandys71 on Wed Feb 24, 2021 6:13 am, edited 1 time in total.

Newbie

Posts

Joined
Sun Nov 17, 2019 1:05 am

Post by sw!tch » Wed Feb 24, 2021 2:08 am

What do your modifications look like?

Do both have unique name and code?

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

Post by dandys71 » Wed Feb 24, 2021 2:22 am

Thank you for your reply.

Yes, every extension have unique name in install.xml and also have unique file name(s).

There is install.xml of one of them:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<modification>
    <name>Heureka.cz Měření konverzí</name>
    <version>2.0</version>
    <author>Author</author>
    <link></link>
    <code></code>
    <description></description>
    <file path="catalog/view/theme/*/template/checkout/confirm.twig">
        <operation>
            <search><![CDATA[ {{ payment }} ]]></search>
            <add position="after"><![CDATA[
                {# HEUREKA MERENI KONVERZI #}
                {%if ( heureka_konverze_status ) and ( not heureka_konverze_api == '' ) %}
<script type="text/javascript">
var _hrq = _hrq || [];
    _hrq.push(['setKey', '{{ heureka_konverze_api }}']);
    _hrq.push(['setOrderId', '{{ heureka_order_id }}']);
    {% for product in products %}
    _hrq.push(['addProduct', '{{ product.name }}', '{{ product.price }}', '{{ product.quantity }}', '{{ product.product_id }}']);
    {% endfor %}
    _hrq.push(['trackOrder']);

(function() {
    var ho = document.createElement('script'); ho.type = 'text/javascript'; ho.async = true;
    ho.src = '{{ heureka_konverze_src }}';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ho, s);
})();
</script>
{% endif %}
             {# KONEC HEUREKA MERENI KONVERZI #}
            ]]></add>
        </operation>
    </file>
    <file path="catalog/controller/checkout/confirm.php">
        <operation>
            <search><![CDATA[ $data['payment'] = $this->load->controller('extension/payment/' . $this->session->data['payment_method']['code']); ]]></search>
            <add position="after"><![CDATA[
                //HEUREKA MERENI KONVERZI
                $data['heureka_konverze_status'] = $this->config->get('module_heureka_konverze_status');
                $data['heureka_konverze_api'] = $this->config->get('module_heureka_konverze_api');
                $data['heureka_order_id'] = $this->session->data['order_id'];

                $this->load->model('localisation/country');

                $country = $this->model_localisation_country->getCountry($this->config->get('config_country_id'));

                if ($country['iso_code_2'] == 'CZ') {
                    $data['heureka_konverze_src'] = 'https://im9.cz/js/ext/1-roi-async.js';
                } elseif ($country['iso_code_2'] == 'SK') {
                    $data['heureka_konverze_src'] = 'https://im9.cz/js/ext/2-roi-async.js';
                }
            //MERENI KONVERZI
            ]]></add>
        </operation>
    </file>
</modification>

Newbie

Posts

Joined
Sun Nov 17, 2019 1:05 am

Post by sw!tch » Wed Feb 24, 2021 2:28 am

Code tag need to be unique and filled.

Code: Select all

    <author>Author</author>
    <link></link>
    <code>my_module_name</code>
    <description>Some Random Description.. </description>

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

Post by dandys71 » Wed Feb 24, 2021 2:32 am

Thank you.

I have all of them empty. I will try it and let you know, if it works.

Newbie

Posts

Joined
Sun Nov 17, 2019 1:05 am

Post by dandys71 » Wed Feb 24, 2021 2:46 am

So I uinstalled all of them and installed them again with code filled. But unfortunately it stayed cached somewhere so it didn't helped. But I think it's the core of the problem. Maybe create new module with no file change and with code empty to simulate that I installed new version of module that had empty code? May it help?

Newbie

Posts

Joined
Sun Nov 17, 2019 1:05 am

Post by sw!tch » Wed Feb 24, 2021 3:05 am

If you want to PM me both your modifications I will look at them. Otherwise you can post them here.

- Code needs to be unique otherwise you are just overwriting the same module, name should also be descriptive to what the module is doing..

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

Post by dandys71 » Wed Feb 24, 2021 6:11 am

So problem was as sw!tch wrote in empty code element. Althought I added the code to all extensions and reinstall them again, it didn't take any effect. I noticed that there is no green success information after click on refresh button and also no changes were made in modification folder. So I tried to go to incognito mode and I tried to click on refresh button again. The success information showed up and files in modification folder were changed.

So if you want to install or uninstall more extensions in a short time period,clear browser cache after every refresh button click or open new session in incognito mode. ;)

Thank you very much sw!tch for help.

Newbie

Posts

Joined
Sun Nov 17, 2019 1:05 am
Who is online

Users browsing this forum: No registered users and 129 guests