magento manage CRUD operations on custom tables on backend - magento

I added 2 tables, for now, maybe will need more and I'm looking on how to add an administration page on the backend side. I found this SO question Magento: Custom Module: How to Manage with Multiple tables that is extactly whay I need. The answer given is just, in my own words, that's too dificult to achieve and too long to explain in SO.
So, anyone willing to share some link, tutorial or DIY step by step explanation? I've already my models working and configured, thanks to #AlanStorm tutorials. I'm doing CRUD operations from within my code but I need to do it from backend on a window for administration purposes.
I thought this Magento Custom CRUD Application Tutorial would help me but it involves using magento ModuleCreator plugin and is not working for me on magento 1.7.0.2. Also I already have my own module fully configured so lot of what module creator adds is not needed.
Found this sample/tutorial/code but I'm having hard time following it, lot of obscure points and not sure what I'm doing, even if it is correct.

You could definitely benefit from some adminhtml grids, there are no shortage of tutorials if you look for them. I wrote my own which I now shamelessly plug here.

Related

CS-Cart: integrating Fishbowl

I am developing a cs-cart based website and my client wants to integrate Fishbowl into his website.
I have searched an add-on for it, but there is no one for me.
I have experience developed a simple add-on and, now I am going to build one add-on to integrate fishbowl.
Please guide me if you have solid experience on integrating fishbowl and cs-cart or another warehouse solution for cs-cart.
I don't understand why the fishbowl doesn't provide or developed the add-on for it.
Please help!
Thanks for reading!
Well, there are a few things to watch out for, and therefore a number of options.
Firstly, what does your client really want. Does he want the stock to be updated on the fly, or once a night? If the client wants to stock to be updated on the fly you will need to add some sort of post function for updating products to also execute your code. If your client wants it only once a night you could just get away by sending every product in the database (with your selected columns).
Secondly, try using object oriented code. If you are really into PHP you will know what I mean by this. Otherwise dont bother (or try learing PHP Object Oriented), though I must note that this can make your addon significantly faster.
Thirdly, use the provided dbquery function
If you have any more questions regarding this, feel free to ask.

Create a Plugin-Based System Like Wordpress With Laravel / PHP

This question has been bugging me for quite some time now, I want to create a cms, a School Mnagement System to be more specific, and what matters to me the most, is making this system plugin based, in a way that administrators can download and install plugins right through their admin panel, just like wordpress.
Now I've read about wordpress Hooks, Actions and Filters, and in all honesty i can say i'm just a little familiar with their functionality, but to apply same functionality to a Laravel App... , It's a bit hard to figure out, at least for me.
I've also searched about this question and found out that almost everyone is suggesting packages, But while packages can work great for other developers wanting to get use of the package's functionality, they can't be easily installed by a user not familiar with any programming language, And that's exactly what i want in my application.
Now what i have in my mind so far, as in Wordpress Actions and Filters, almost everything one would want to use in Wordpress theme files ( to make that piece of code flexible for adding plugin functionality ) should be called as functions, and calling that function by Wordpress do_action() is kind of a must-take path, which of course makes sense.
This way plugin developers can just call add_action() / add_filter() in their files and put their plugins into the flow of the application.
So...
Basically what I'm asking here is:
How to apply such functionality to a laravel app?
Is there an easier way than calling everything by a function like do_action()?
Should i write some kind of a file management module for downloading and updating plugins?
Again I must say that I am not very familiar with wordpress ways to achieve this kind of functionality, So I may be wrong about some of the description I mentioned above, But please, I appreciate any clarification around this subject if you can.
Thanks in advance for any insight.
*P.S. I've tried to be as clear as I possibly can about the problem, And I'm not looking for any specific method for the system I`m developing.
What i want is to know Common / Best methods ( If there is a best method ) for achieving such functionality, preferably in Laravel, but a general algorithm would still be very appreciated.
I know lots of people have the same question and are tackling with the same issue, so if you even only provide a link to a useful article it would be great.*
I have been working as a Wordpress Developer for a very long time and I also have sufficient experience in Laravel... and to be honest, making this kind of functionality is not that difficult at all.
How?
First of all, you must understand that the web app that you will be making will have all the functionalities, but they can only be enabled/disabled from the front-end (Admin Panel/Dashboard). In other words, your School Management System app is actually having all the features/functionalities pre-installed, but you are just allowing the users to enable/disable it. This is much simpler.
So, if for eg. you want to provide someone attendance management functionality, you will have to give the admin of the site, the access to enable/disable it.
Why?
Wordpress has a built-in UI for adding/updating plugins. But in Laravel, everything is code based and therefore this I believe is the simplest way to go (especially for making things in your app pluggable).
Steps
Make a site with UI etc...
Create a config and migration file which will have the names of all the plugins you are going to allow the user to enable/disable.
Make a sync command that will sync all the plugins in your app.
Use it render a page from the front-end and manage their status from the back-end (is_active etc etc...)
Now once, these plugins are active, make sure the user (say moderator, editor) has access to manage them, for which you will obviously have to create roles/permissions and use Laravel Policies for such stuff.
Lastly, only the admin will have the enabling/disabling writes and no one else.
For the other part where you want the people to perform their own functions with filters/actions. I'd say this is completely contradictory to the part where you say Installing Laravel Packages isn't easy. Well, if you would really want a developer a way into this, why not straight away ask them to make a package for your app alone? Hmmmm.... Think about it :)
But, even then, if you would like to create such a functionality, create a simple class which the user can call and user its functions to call their own functions... Something like -> SMSPlugin::do_action(). But then again, making things like updating/deleting the plugin will require you to build your own Plugin Store and ask users to upload to it. Then you'll have to make an API to constantly check for updates for all the installed plugins and blah blah.... It's a really long procedure... And I don't believe that feasible too!
Hope I answered everything. Let me know in the comments if you have any doubts :)
I know it was 2 years ago, but for now you can achieve this with laravel with some packages:
So i think the steps will be:
Create new Laravel App and add some packages for BASIC admin UI and things you will need like:
Authentication (https://laravel.com/docs/5.7/authentication)
Roles and Permissions (https://github.com/spatie/laravel-permission)
Users managment
Modules (https://nwidart.com/laravel-modules/v4/introduction)
At this point you must configure and write a UI for manage every thing from every package mentioned.
So i think this is the way or at least some try to do it in 2019 :D
Happy new year to all!
There's a package for this, it supports version 5, didn't test yet with 6:
https://github.com/oneso/laravel-plugins

Application to display information from database

I understand that this is a very broad question and could get flagged but I need inputs from experienced programmers and will ask it anyway. If there is another forum where I can post this question, please let me know.
Currently we manage all our application information in an Excel spreadsheet. At a high level it contains an app id, the server names that it is hosted on and the name of the environment. The Excel spreadsheet has become too large and I am looking to build a simple application for it.
Ideally, I would like to write this app on Windows as everyone uses Windows but dont know how to go about it in Windows. I then thought of using MySQL and PHP or Perl (CGI) to build this but thought of exploring something new. I read about Joomla and a few other CMS products which make it very easy to build websites but am not sure whether these allows me to pull information from a database.
I am seeking inputs on what would be a good way to way to build this application.
Use Joomla! CMS is a good choice and to pull data from database you may use webservice calls. So, you will able to create a CMS website using joomla and will able to pull data easily from database with the help of webservice.
You can get webservice support in joomla by installing component redCORE in joomla.
Component: https://github.com/redCOMPONENT-COM/redCORE
Wiki: http://redcomponent-com.github.io/redCORE/?chapters/webservices/overview.md
Other videos: https://www.youtube.com/watch?v=UzJkC7f9fJE
https://www.youtube.com/watch?v=1NRT5jh3Ewc
Joomla dev group discussion https://groups.google.com/d/msg/joomla-dev-cms/3OctbkIZlQw/5d_1MLrzbgYJ
You can also post questions in Joomla forum http://forum.joomla.org/
I think Joomla is a great option to handle big loads of information. If you already know PHP and don't need to reinvent the wheel, it's cool. The way of handling data in Joomla is using Components.
If you want to try, it would be as easy as installing a local copy of Joomla, building the field structure on component-creator.com installing it and importing the data inside the component using phpmyadmin.

what is simple MVC based PHP blogging application?

I am searching for a Blogging tools like wordpress. But I want MVC based tools to extend my blog with MVC structure.
My main requirements is
Must be based on MVC
Simple & lightweight
it's blog url structure should be domain.com/cat_name/post_title , because my current wordpress blog is like that, I don't want to lose Facebook Share and Tweets.
I want a simple one, because this is learning only.
Clarifying: if a CMS you use is based on a MVC design pattern or not is irrelevant to you as an user, except if you want to meddle with its inner workings (which you don't - a CMS is made to be used and possibly extended, but in 99% of use cases, if it isn't extendable to your needs, changing the source code is a bad idea, as it will most likely break with any updates you may want to make)
You may want a MVC framework, which will in turn allow you to **code** a CMS of your own, or use a good, extendable, CMS app
The one I use is ProcessWire, which is a CMS/CMF (F stands for Framework) php app, and seems to be the kind of thing you are looking for - it manages your content for you (the default installation comes with a few demo pages) but you define the fields, and you use them to display your content at will. Check it out - the user forum is quite active, and people there are really helpful.
Well there are tons of Content Managment System Based on MVC frameworks (eg . CodeIgniter ) . I personally recommend Pyro ( Based on CodeIgniter) but other also seem promising . but i don't know much since i haven't tried .
Note that this is a highly relative question and will bring forth a ton of opinions and not real answers. With that in mind, here is my answer.
I know of a tool that you can use to install an MVC template for and on top of ProcessWire along with basic project managing tasks using gulp. Note, the M will be considered ProcessWire.
Have a look on github.com and look at the profile of fixate and repo generator-fixate-pw. (ie: generator-fixate-pw, added the sentence if the link breaks).
Install this by following the instructions on the repository. The tool is very specific but learning to use the framework helped improve my php skills allot (still learning allot).
Whether the CMS will be used as a blog or not will depend on your implementation of the install.

Magento custom fields on checkout

Is there any tutorial available for how do i add custom fields on front end check out step like PO number,Job name , customer comments etc as well as in admin->create->order.
My usual motto is to find (and buy if needed) a module that already has the functionality you seek. Especially when the life of this project involves version upgrades because then you can seek a pre-packaged solution from the provider.
I regret every bit of custom code I have added to our Magento install. Because now I've got to maintain the site to just keep working in addition to figuring out my hacks. Time to devote more time to replacing hacks with off-the-shelf extensions, which would have been much faster in the first place.
I know this attitude goes somewhat against the stack overflow thinking of I can do anything, but really, Magento's job is to enable someone to do less work.
Two years later, an update: after the gentle poke of a downvote (probably for appearing to shrug off the question), I am back to revisit and share some of what I've learned. The programming aspect of additional fields is the concept of persistence of the data.
If you're ok with the custom fields only appearing in the transactional emails following the order, then the task is as "simple" as adding the fields to the form somewhere and then updating the controller to to catch and insert the post data into the email. You can use a custom variable in the back end to readily expose this to the email templates. And a Magento SE on programatically creating a custom variable.
Getting persistence into the back end requires adding database fields via an installer in your module. The iCoreThink blog lays out the steps clearly and explains why, how to confirm your work, and then provides real-world implementation, like displaying to the customer in their account. The "other blog" mentioned below has a great example of this, though his example is specifically related to billing and shipping.
Resources from my upvotes and bookmarks:
» This iCoreThink blog post is my favorite reference so far and what I'm following now.
» I was using Templates Master's FireCheckout which includes their own checkoutfields module, but I've abandoned their single view checkout for the flow of Magento's one page checkout. I'm now trying to adapt their checkout fields (and use their controller) into my template for checkout.
» I thought for sure Alan Storm wrote an article about Checkout custom fields, but I don't see one.
» This Magento SE lists a couple blogs and a paid extension. The excellence blog is ok, but his style is too rote for me and I don't learn anything. The other blog discusses the procedure for building your module and installing the database fields.
» The unexpected-IT blog demonstrates and informal hack to add the code to core files (but sadly doesn't show how to override those files by copying them to app/code/local) and the steps to manually perform to get the column and fields added in the database. Apparently is perfect for 1.4 and below, but comments seem to explain what to do for 1.5 and up.
This last hack-ish change is my personal favorite as it seamlessly adds the extra bits into existing Magento admin pages and "feels like" less work. Caveats: I wouldn't do this without using version control and it will absolutely break if any core code changes happen between version upgrades.

Resources