Use Custom Add-On Instead Of My_Changes Add-On

Hi community,

instead of using the "my_changes" add-on for custom implementations I want to split my custom code into several "own" add-ons.

This code works in "my_changes" add-on:


Stylesheet is included and script runs as expected.

The code is located here in a file named "head_scripts.post.tpl":

/var/www/cscart/design/themes/responsive/templates/addons/my_changes/hooks/index

It works. So far, so good.

Now I moved this code (the file head_scripts.post.tpl) to this location:

/var/www/cscart/design/themes/responsive/templates/addons/my_addon_font_awesome/hooks/index

Also I created a addon.xml file in this newly created folder:

/var/www/cscart/app/addons/my_addon_font_awesome
<?xml version="1.0"?>

my_addon_font_awesome
My Addon Font Awesome
Enables Font Awesome Support and other things
1.0
  10000
  10000
active
My company
  https://example.com
  
      
          My company
          example@example.com
          https://example.com
      
   

When I try to install the add-on (click on Install in "Manage Add-Ons") the message "add-on has been installed successfully" occurs. But: button "Install" remains (switches not to "active" as expected).

Does someone know why? I checked folder permissions. What else can I do?

Best regards

hummer

Usually such thing happens when addon ID in the addon.xml does not correspond the addon directory name. Please double check

I have now given the add-on a new (shorter) name and copied it via the clipboard into all folder names and into the Add-On Id field.
It works now. :grin: Although I checked it a hundred times before. :mad:
What bothers me now: under "Manage Add-Ons" there is still the old add-on name and the old description displayed. I deleted the subfolders in
\cscart\var\cache 
but it still shows the old name and description.
Do you know why?
May I ask for help again?
Best regards
hummer

Name can be changed if you uninstall and install the module again

Or remove the entry from the 'addons' table.

Thanks for your suggestions!

Name can be changed if you uninstall and install the module again

Did not work for me, sorry. I uninstalled the add-on, deleted all files in cscart/var/cache folder and installed it again - unfortunalely with no effect.

Or remove the entry from the 'addons' table.

Does that mean the entry will then be rewritten (based on the entries in add_on.xml)?

So far, I haven't dared to delete the entry, just edited it (in the cscart_addons table).

Can I actually delete it?

If you use translations both in addon.xml and .po file, value in .po file will take precedence

Does that mean the entry will then be rewritten (based on the entries in add_on.xml)?

So far, I haven't dared to delete the entry, just edited it (in the cscart_addons table).

Can I actually delete it?

If you remove or rename it, the addon is effectively uninstalled. I made this suggestion ONLY because I though you deleted the files BEFORE uninstalling the addon. Hence there's no way to find the data to uninstall.