Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Use Custom Add-On Instead Of My_Changes Add-On Rate Topic   - - - - -

 
  • hummer
  • Member
  • Members
  • Join Date: 23-Jul 20
  • 31 posts

Posted 21 September 2020 - 07:23 AM #1

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:

 

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
<script data-no-defer>
    alert('my_changes add-on');
</script>

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"?>
<addon scheme="3.0">
<id>my_addon_font_awesome</id>
<name>My Addon Font Awesome</name>
<description>Enables Font Awesome Support and other things</description>
<version>1.0</version>
  <priority>10000</priority>
  <position>10000</position>
<status>active</status>
<supplier>My company</supplier>
  <supplier_link>https://example.com</supplier_link>
  <authors>
      <author>
          <name>My company</name>
          <email>example@example.com</email>
          <url>https://example.com</url>
      </author>
  </authors> 
</addon>

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21077 posts

Posted 21 September 2020 - 01:52 PM #2

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • hummer
  • Member
  • Members
  • Join Date: 23-Jul 20
  • 31 posts

Posted 21 September 2020 - 02:13 PM #3

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


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21077 posts

Posted 22 September 2020 - 04:39 AM #4

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11815 posts

Posted 22 September 2020 - 10:34 PM #5

Or remove the entry from the 'addons' table.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • hummer
  • Member
  • Members
  • Join Date: 23-Jul 20
  • 31 posts

Posted 23 September 2020 - 11:50 AM #6

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?


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 21077 posts

Posted 23 September 2020 - 01:16 PM #7

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11815 posts

Posted 23 September 2020 - 06:15 PM #8

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.