Post by cheeseus » Thu Mar 07, 2024 7:01 pm

I have re-done my translation of the OpenCart UI (admin, catalog, and extension) for OC 4.x and now I am trying to create an installation package along with instructions for users. However, I am stuck myself as I can't get the language folders and files to upload to their correct destination folders, e.g \administrator\language\bg-bg.

Things seem to have changed since OC 3.x but I can't find any documentation on how to structure my extension so that it uploads correctly and works.

1. OpenCart Version: 4.0.2.3 (latest)
2. Used Template/Theme: default
3. (Additional) Installed Extension(s): none
4. (Additional) Installed Translation(s): none
5. Used PHP Version: 8.3.3
6. Used Browser and Version (and if used, installed extensions like Ads-Blocker, etc.): Firefox (latest). I have uBlock Origin but I've disabled it for my test site.

My test installation is local: WAMP Server on my C: drive.

What I have found so far:
– In OC 3.x, the extension needs to have the following folder structure: [upload] > [admin] and [catalog] > [language] > [language code] > [subfolders and files]
– In OC 4.x, the structure needs to be: [administrator] and [catalog] and [extension] > [language] > [language code] > [subfolders and files]. However, an install.json file is also required, which needs to be placed in the root folder, next to [administrator], [catalog], [extension].

* The "admin" folder is called "administrator" because this is what I renamed the "admin" directory to when prompted upon first log in to the admin panel. I realise the user may be using a different name. So, my first question is How should I name the "admin" folder in my extension?

Second question: Is what I have included in the install.json file sufficient? I opened the same file from the extensions already in /storage/marketplace and copied the contents, editing them as necessary:

Code: Select all

{
  "name": "Bulgarian translation of OpenCart 4.x UI",
  "version": "1.0",
  "author": "Asphodel Works",
  "link": "https://asphodel-works.com"
}
This seems to suffice because the extension installer said "Success: The extension has been uploaded!" and then, when I clicked the "+" button to install it, the response was "Success: You have modified extensions!"

I then added the new language under System > Localisation > Languages.

I then went to System > Settings > My Store > [edit] > Local > selected my country, region, time zone, and chose my language for both "Language" and "Administrative language". But when I click "Save", I get an error message saying "Warning: Please check the form carefully for errors!"

But there are no errors anywhere! No fields in any of the tabs are highlighted red. I then used the Firefox inspector to try and find out more details: Inspect > Network > click the Save button again > a POST method is executed with status 200 > when I select it and go to the Response tab, I see:

Code: Select all

JSON
error	Object { processing_status: "You must choose at least 1 order process status", complete_status: "You must choose at least 1 order complete status", warning: "Warning: Please check the form carefully for errors!" }
This is weird because the store edit form does not contain any such settings (order process and order complete statuses).

Ultimately, I checked the actual directories where my translations should have been uploaded to:
/administrator/language – a "bg-bg" folder should have been added here
/catalog/language – same as above
/extension/opencart/admin and /extension/opencart/catalog – with the corresponding subfolders – nothing uploaded here, either.

Instead, my extension had been unpacked directly under /extension/, creating a new folder.

So, my third question is: How do I structure the extension installer package so that everything is moved to its correct destination? Is there a detailed guide that explains this? This here: https://docs.opencart.com/en-gb/developer/module/ does not provide any such details.

I read this thread: viewtopic.php?t=231912, where the OP explains they manually pasted each folder where it needs to be. Of course, I can do that, too. Indeed, this is what I did when I tested my translation on 4.0.2.3. But I can't expect the users who buy my translation to move everything manually.

I hope you can help me. Thank you!

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am

Post by OSWorX » Thu Mar 07, 2024 11:16 pm

cheeseus wrote:
Thu Mar 07, 2024 7:01 pm
.. But I can't expect the users who buy my translation to move everything manually.

I hope you can help me. Thank you!
This is THE most important sentence of your post: you want to sell ..
Which means: you get money for a lousy, simple translation.

Okay your decision.
But do not expect that the users here will help you in this matter.
Instead you should post it in the OpenCart Forum> Commercial Section and pay some developer who knows what and how to do.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by cheeseus » Thu Mar 07, 2024 11:55 pm

OSWorX wrote:
Thu Mar 07, 2024 11:16 pm
cheeseus wrote:
Thu Mar 07, 2024 7:01 pm
.. But I can't expect the users who buy my translation to move everything manually.

I hope you can help me. Thank you!
This is THE most important sentence of your post: you want to sell ..
Which means: you get money for a lousy, simple translation.

Okay your decision.
But do not expect that the users here will help you in this matter.
Instead you should post it in the OpenCart Forum> Commercial Section and pay some developer who knows what and how to do.
Your reply is both ridiculous and insulting. My translation is neither lousy, nor simple!

I am simply looking for a guide that should be there in the documentation. Especially since the developer(s), who are taking 50% of whatever I sell, have decided to change things since OC 3.x, without documenting what is different.

New member

Posts

Joined
Sat Apr 18, 2015 3:59 am
Who is online

Users browsing this forum: No registered users and 9 guests