open source e-commerce for moodle

open source e-commerce for moodle

by ryan sanders -
Number of replies: 33

needing to start some place. might as well here.

i been asked more often for SOHO (small office / home office) other words small business. for simple to use doing, to sell a basic course, but generally need a little bit more e-commerce than default moodle provides. and i am not been happy with 3rd party software integration i have looked at so far. 

as a result i been looking for more. i am not real interested in moodle partner setups. granted i should take a look at what they offer. at this time i have not. my luck something would be copyrighted or like and there it goes. 

with above said, i am looking to port something, not simply integrate it into moodle. but take existing code, and search & replace of what i can so entire code base becomes moodle native code base, adhering to moodle coding guild lines. 

my research up to this point, has been searching on the ugly 3 letters.

  • e-commerce / internet shopping cart website to sell stuff = low end of the scale of selling stuff / managment.
  • CMS = content management system = document handling more small end doing (wordpress joomla)
  • CRM = customer relationship management
  • POS = point of sale = cash drawer, bar code scanners, bar code printers, touch screens, receipt printers. other words deals more with direct connection of reading labels and computer software.
  • ERP = enterprise resource planning = upgrade / mix of CMS and POS = large scale business, or more of ware house tracking, clients with accounts, some accounting mixed in. 
  • SIS = student information system = handles more of school related info, parent info, absentees, meals, scheduling, specific health info (allergies, medication) for a student, siblings, parents, etc...
  • LMS = learning mangment system (aka moodle)

most of googling i have done resulted pretty much everything ending up on the following links.

my requirements have been for porting over into moodle

  • open source
  • php
  • mysql (min, database type)
  • no installs on local computer (either download and install or through browser)
  • no special scripting beyond a cron job. 

legend for below

  • X = software recently downloaded, and installed on WAMP no https installed. to see current versions. 
  • O = need to install on localhost to see more. (demo website not working)
  • - (minus sign) = something i dislike about it.
  • + (plus sign) = something i like about it. 

the start of shopping cart software.

legend notations / website / (comments)

the start of ERP / accounting software ((side note: i forgot what account software looks like, been some time from highschool / collage))

POS (point of sale) notations.

  • my guess a java applet will be needed to link hardware (scanners, cameras, bar code readers, printers) to moodle via a web browser. HTML5 will allow for a camera connection, but everything else = no go.

SIS (student information system)

  • google "student information system" covers a large set of specific information and data sets. that is directly specific to K-12, collage, universities. and not directly related to SOHO (small office / home office) businesses. 



Average of ratings: -
In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

what am i wanting in a open source e-commerce plugin/s?

after looking at various software in research i have done up to this point...

i am wanting a "multi store, multi vendor, multi website" like functionalty built directly into moodle.  other words, many of the e-commerce / shopping cart software out there. including moodle. someone comes along and creates a mod (modification) / plugin for the software, so you could have www.mymy.com, www.meeme.com, www.moomo.com all point to a single moodle installation, and each of them having there own unquie setup and courses. 

with moodle. it gets a little bit more complicated, from SOHO (small office home office) setting, to K-12, to collage, to universities, to other. a one integration fits all, does not really work. with that i am looking to allow for....

(front end) of store what folks see going to some website, www.walmart.com, www.newegg.com, etc...

  • www.moodle.org => my home page => add block (store front end).   = every person with a user account within moodle can have there own private generic e-commerce store, 
  • www.moodle.org => course (course is the front end) = every course can have it's own private generic e-commerce store,  
  • www.moodle.org => course => activity and/or resource (resource or activity is the front end of the store)= a private generic e-commerce store. 
  • www.moodle.org ((front page / home page for site)) (unsure possibly a meta course) = it's own private generic ecommerce store.

admin side of things....

  • www.moodle.org => my home page => add block (store admin)
  • www.moodle.org => course => course adminstration block => store admin
  • www.moodle.org => course => TURN ON EDITING => activity and/or resource => edit settings.
  • www.moodle.org => ((front page / home page)) => site admin => front page => store admin.

using standard generic moodle database to allow above.

  • new table named (mstore) with following fields
  • id
  • type (home page = 0, course = 1, activity = 2, resource = 3, user = 4)
  • unquie id that moodle assigns for ((home page, course, activity, resource, user)

with above 1 table and 3 fields. a single database set (what ever is ported over) should allow for full range of independent stores throughout moodle.  each store being a complete fully functional e-commerce store, with front end and back end capabilities (within reason), using a single database set. no independent database for each store.

============

splitting up the front end and admin settings....

i am looking at "admin settings" as one time type of setting, localization settings, such as language, tax info, store name, store address/location, store description, contact info,. some of this info can be pulled from moodle already. along with orders, returns, various reports.

i am then looking at for the front end..."product" add/edit/delete.  for moodle a product = a activity type or a resource type, (special type = course itself). i am wanting to use the "edit settings" for each activity and resource of were a person would enter all the product info. (length, width,depth, price, sku, tags, product attributes, etc...)... other words goto any e-commerce / shopping cart admin section, to add/edit/delete a product. that entire section (normally multi tabbed) and dropped into the "edit settings" of each and every resource and activity type, as a "general module" for all of them. 

for more information see thread...adding conditions, and title changes to all activities / resources?



In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

in attempt to get a better handle of things of what would moodle has and does not have... i made a list from a generic www.opencart.com install i recently did on localhost. and did a quick run down of admin menu of opencart, these are the results.

what is duplicated, and moodle already has. (ADMIN side of things) going through dashboard...

  • dashboard = site admin
  • categories  = course management (new categories / new courses / new meta courses)
  • catalog => filters = grouping folks, course enroll, 
  • catalog => manufactures = assignment "external tool"
  • catalog => downloads (resource types / assignment types)
  • catalog => reviews = feedback
  • catalog => information (CMS like doing for contact us page, delivery info, terms & conditions, privacy policy)
  • extensions => extension installer
  • extensions => modifications
  • extensions => modules YES / NO / DEPENDS
  • extensions => feeds
  • sales => customers
  • sales => customer groups YES / NO / DEPENDS
  • sales => custom fields
  • sales => banned IP
  • marketing => advertisement banners
  • marketing => affiliates
  • marketing => mail
  • system => settings
  • system => design => layouts
  • system => design => banners
  • system => users ALL
  • localization =>  languages
  • localization => countries
  • tools => ALL

ADMIN => what is NOT duplicated, opencart has, but moodle does not have.

  • catalog => product add / listings ((EXTREME AMOUNT OF INFO))
  • catalog => recurring profiles (re-occurring billing) so for subscriptions
  • catalog => filters = grouping folks, course enroll, = YES and NO for moodle more for pricing vs assigning person to different courses.
  • catalog => attributes
  • catalog => attributes => attributes
  • catalog => attributes => attribute groups
  • catalog => attributes => attribute options
  • catalog => manufactures = moodle YES / NO / DEPENDS
  • catalog => downloads (resource types / assignment types) = YES / NO / DEPENDS
  • extensions => modules YES / NO / DEPENDS
  • extensions => shipping (fedex, ups, dhl, usps, pickup from store, etc..)
  • extensions => payments (paypal, amazon, autherize.net, check, cash on delivery, etc...) payment types
  • extensions => order totals (coupon, store credit, handling fee, reward pionts, shipping, su-total, taxes, gift voucher)
  • sales => orders (who has ordered what, with sorting)  print invoice, print reciept, add a new order directly
  • sales => recurring orders (same as above)
  • sales => returns (RMA "return material autherization", and a new notation for a return.
  • sales => customer groups YES / NO / DEPENDS
  • sales => gift vouchers 
  • marketing => coupons
  • localization =>  store location ((store address primarily))
  • localization => currencies 
  • localization => stock status list
  • localization => order status lists
  • localization => returns => return status lists
  • localization => returns => return actions lists
  • localization => returns => reasons list
  • localization => zones 
  • localization => geo zones
  • localization => taxes => tax classes
  • localization => taxes => tax rates
  • localization => length classes 
  • localization => weight classes
  • reports => ALL

FRONT END => what is NOT duplicated, opencart has, but moodle does not have.

  • returns
  • order history
  • specials
  • gift vouchers
  • shopping cart
  • wish list
In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -
random issues that have come to mind... and just jotting them down... 

splitting things up between lines of ==========

===========

credit card compliance. 

looking at recent PCI DSS compliance. and considering were moodle is install, how it is installed. i am looking at a ZERO credit card data being stored in any database or file. and i am looking at payment gateways, that use a "post method" or like. were during checkout proccess. capturing regular user info (billing/shipping) in moodle, but as soon as it comes time for credit card. pushing the customer to the "payment gateway" ((company that process credit cards online)). 

otherwords, i am not looking to capture credit cards or like on moodle, but rather making sure actually entering type of credit card, the numbers for card, expiration data, cvv code on back. is never done on moodle servers. this looks ugly to customers tuff folks! folks.. here is why, on my current thinking...

if you keep any sort of credit card data (beyond name/billing info, possibly credit issuing bank number), and something happens, i am guessing you will be at a very high risk of a law suit and you loosing it all. 

if you need to verify something, you should be able to login into the "payment gateway" website, and obtain limited what is legal info that way.

remember ya using a software were a bunch of kids, collage students use every day, by millions of folks, one little miss hap, and bye bye. if you want further integration for checkout process, then i would imagine you have nice deep pocket to reach into, to become fully PCI DSS complaint. and most likely a full time paid system administrator that can deal with issues. 

================

i am looking at a some different payment gateway plugins beyond the paypal and autherize.net payment gateways.  such as... goto X teacher, to pay for shop class materials, or a field trip.  or perhaps goto local front office of the school. (the teacher or front office, acting something like a "brick and mortar" store front. example menards and other hardware stores, you may goto back counter and get a print out of materials you want to buy (lumber), and then goto register (teacher or front office in this case), pay your dues, and then go outside and pickup your materials (goto X teacher and say shop class "material locker" grab what you paid for), and then do a final checkout at the gate inspection, before ya drive off (teacher double checking stuff). 

===============

POS (point of sale) were you have a cash drawer, some sort of bar code scanner, credit card swiper, check scanner, (any or all of the above). i am not looking to install into this ecommerce plugin.  primarily due to needing most likely a "java applet" (do not confuse java with javascript, completely different)

this also goes with a "inventory" scanner. not looking to do it personally. 

===============

i am looking at basic "accounting" for most part most e-commerce websites have basic accounting info. but do not offer, the extra. so you can have folks with "accounts" were payment may not be paid up in full. due to say grants, or what ever the case maybe.  possible K-12 meal program, or possibly having parent / gaurdians pay X amount into an account, and issuing students a "student card, pretty much a school only credit card" so come meal time, they just swipe the card. so kids are not carrying money around with them all day. 

===============

reward points, or like.  for example: in many online games, you pay say $100 bucks, for say 1,000 in game credits. and then you spend those credits on premium items. i am wanting to keep this ability within each store. and be able to adjust per "activity and/or resource" how much it costs with those reward points / credits, or how much you get back if spending actual money. 

===============

the "admin" section of each store. i am looking at "optional setting" "linking" each store to one another.  via moodle "meta course"

each course acting like a product category.  any online store has categories (cloths, plumbing, lumber, gardening, etc...) but for moodle. a category is a "course",  or you could use different "course formats",  say weekly format, and each week is a different category.

i am also looking at being able to setup "fake stores",  say for an actual course of learning to how to use moodle and ecommerce side. the students could create there own course via a resource or activity, or possibly having a course for each student created that way. 

with "fake stores" i am looking at needing a "approval rolls" for certain things. while anyone might create a store and add / change stuff to it if they have the correct rights to do so in moodle.  there still would be an approval roll, that would need to be assigned to someone beyond initial admin for larger schools and like. 

the approval roll, would allow various shipping modules, payment gateways, taxes, and more speficically allowing stuff to be displayed by anyone else. other words i could see a kid trying to scam someone just for the heck of it. and the approval roll who or whom ever gets assigned with this right. can deal with things from that point. 

for example. a teacher may want there own private little store, for some sort of class / course project. or a school club needing to keep tract of stuff (bill of materials), what ever case maybe.  YES moodle database plugin, can do this. but moodle database can not deal with money. 

==============

i doubt it will be implemented, but have considered database thrashing, and longer load times due to moodle and the ecommerce plugin, run a bunch of more extra code every single time a page is refreshed or another paged is clicked on within moodle. i have considered putting in an option. that check to see if item has been paid for or not. BUT only running this check, everytime that person logs into moodle.  it would become that miracle cure, logoff, then log back in. and everything is working like it is suppose to thing.  

================

add/edit/delete stuff on the ecommerce side of things. Not sure how moodle currently handles things. 

example: i goto www.newegg.com, login, goto order history, flip back 5 years. i can pull up an invoice, and i can see product image, and full detail specs, of exactly what i saw 5 years ago when i purchased that item. 

  • adding a new product = a new database record.
  • edit a product = 
    • if anything has been changed, the full current changes get saved first the database, and then the original product gets edited with a ID pointing to the new edits, and is hidden from view in everything.   this is to allow "order history" like doing noted above, you may change price a couple different times, or change specs of an item. but if customer goes back to order history, they maybe seeing a completely different price or specifications all of a sudden. 
    • if nothing has been changed, nothing happens
  • if a product gets deleted, the database record gets assigned "delete" but is not actually deleted.   this is more like deleting a file in windows, the file goes to the recylin bin, but in case of moodle. in order to fully delete or retrieve item, it will require an administrator / IT staff with rights and knowledge of how to pull that data back from the database. 
  • using a cron job or like, to go through and check what records can actually be deleted permanently from moodle to free up database space. 

if what ever is ported to moodle. i will most likely go with what ever it already has setup. even if it means a full deleting item out of the database for good. and then put notation of upgrading at a later date. 

===================

initially looking at getting install / uninstalll scripts setup, and getting the database and files ported over into moodle. "large job in itself" at that point, there will most likely be a delay. due to needing to customize the code for moodle and creating scripts from scratch. to obtain basic functionality. 

i am hoping stay with a more of a plugin/hooks doing like newer e-commerce software has, but initially it maybe a bit ugly.  i am expecting everything would need to be redone for any sort of plugin that might of worked on the software before porting it over to moodle.  other words the ecommerce software will become one more of them customized jobbies with its own set of plugins, that does not confirm to any other e-commerce software out there. 

==================

i am still not familiarized with moode code enough, to figure out how to handle various "external tool", or connection to "external databases" or like modular / plugin interface setup. 

my hope is that this ecommerce port for moodle. would act like a ebay, amazon, google => shopping,  were folks add stuff to there e-commerce software, and then export it to the bigger websites, but at the same time i want moodle to act like one of those bigger sites. for example: teacher creates there store, adds stuff, and then clicks a couple buttons, and all the info is sent to the main school store. and the teacher kinda washes there hands of all the payment stuff / shipping stuff.  or a third party website links into moodle. and can populate certain things within the ecommerce fields. say manufacture name, MSRP (manufacture suggested retail price), description, product image, basic simple stuff just to the given activity, resource, or course itself.

===================

there i go, i think i got all my notes taken care of. 

off to download and install few more test installs, and looking at there open source code, to see what looks easy to follow and port over to moodle. 



Average of ratings: Useful (1)
In reply to ryan sanders

Re: open source e-commerce for moodle

by Chris Wharton -

Hi Ryan, it looks like you have put a lot of thought into this. The available Moodle plugins such as paypal enrolment allow courses to be sold to users, but I agree it is limited for anything else.

You mention converting an e-commerce platform to a Moodle plugin. This approach may work, but the code would end up being bespoke and difficult to maintain. 

I would recommend using a third-party PHP e-commerce library, with useful and generic APIs.  Then create a Moodle plugin that uses the library APIs. This would have the advantages of the library being supported and used by many users, and separating the Moodle functionality from the e-commerce code. 

Some quick searching found this https://github.com/ziadoz/awesome-php#e-commerce - I haven't tried any of that software myself.

Average of ratings: Useful (1)
In reply to Chris Wharton

Re: open source e-commerce for moodle

by Colin Fraser -
Picture of Documentation writers Picture of Testers

wow... sounds like you really want to build a new app with a couple of different applications at its core. I could suggest you look for individual products, each of which can be utilized for their specific tasks. However, integrating them might prove a far better option, if possible of course. I would think it unlikely that too many people would have considered using an LMS like Moodle in the way you have, so it would be a serious challenge to gain that functionality you want. What is the core function of the client? Learning or e-commerce? That might be a better place to start. You might be better off using an e-commerce system and then incorporating Moodle into that rather than the other way around.    

Average of ratings: Useful (1)
In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

thx Chris Wharton your comment of "framework" really hit home.

i did search for other frameworks, but *big frown* it was little bits of code here and there, no real meat and potoates per say. 

the link ya gave i did take note of "omnipay" for payment gateways framework. 

===============

Colin Fraser, i want both! e-commerce and LMS together as one, and more!

i see moodle as a "software suit" even without ecommerce added into it. moodle is a enterprise level software package. but can still be catered to lower end SOHO (small office home office) aka small business, hobbies, clubs, and/or a personal website. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -
installing the other ecommerce software....


i found "opencart" to be the most feature rich out of the box. with prestashop next in line.  oscommerce, oscmax, zencart, seem outdated on older technology. i gave up on magento trying to get it installed on wamp. it looks like i need a mcrypt.dll, and the wamp i have installed does not include it as a default option. other e-commerce software such as virtualmart for joomla, and woocemerece look like a ported shopping cart from one of the other shopping carts out there. 

at this point in time "opencart" seems to be the winner for porting, more so do to the wide range of free and paid addon's / plugins for it. 

=============

taking note from Chris Wharton, about framework,plugins, API's... below is list of frameworks / hooks / API's i need to take note of. 

  • product types (any activity / resource in moodle, courses, blocks, physical products, downloadable products, etc..)
  • what is listed on the "edit screen" for adding product info.
  • shipping modules (fedex, ups, usps, dhl, free shipping, pickup as store, pickup at class room, no shipping (POS (point of sale), pay at regeister aka no shipping), etc..)
  • payment gateways (paypal, autherize.net, google wallet, Cash on delivery, cashier check, business check, pay later, bill me later, partial payment, payment plans, use different reward points setup on system (student meals, general reward points from buying so much, etc..)
  • product attribute manger
  • pricing schemes (gifts vouchers, coupons, reward points / credits, buy 2 get 1 free, bundled products, group discount, category discount)
  • carts (standard shopping cart, wish list shopping cart, abandoned carts)
  • display types (buy now, out of stock, visible/hidden on group type, stocking levels, is parent or teacher vs student, call for pricing, discount based on amount bought)
  • shipping tracking (fedex, ups, usps, etc...)
  • checkout process / steps (quick checkout "quest checkout", long process checkout, manual entry, POS, shipped to non billing address (optional as a gift))
  • address checker
  • account types (manufacture info, student, third party, external, registered user, pre-paid, allowed to have neg account on checkout)
  • order view/edit/ship (different types, most likely done through simple admin menu => sub menu)
  • product feed (internal (course to course), external feeds (ebay, google, amazon, etc..)
  • order status (order received, checking stock, order ready for shipping, billed account, check cleared, shipping order, etc...)
In reply to ryan sanders

Re: open source e-commerce for moodle

by Chris Wharton -

I agree with Colin - maybe a better approach would be to set up a normal Moodle, and an E-Commerce package separately, and then figure out how to integrate them. E.g. using webservice APIs, SSO, etc. to link Moodle to the shopping software.

Similar work has been done before, with Moodle & Drupal, Moodle & Mahara, probably others.

The easiest way to do this sort of thing is usually also the way that involves the least amount of customisation to the standard software packages wink

You have mentioned lots of desired functionality, but it isn't clear to me what users will actually be doing on the site. As a developer, I also tend to start thinking about the technical solution before considering the high-level "What's the point of all this?" questions. smile

What are your expected use-cases?

Average of ratings: Useful (1)
In reply to Chris Wharton

Re: open source e-commerce for moodle

by ryan sanders -

clubs / hobbies events.  

  • accept fees, in person, and over internet
  • they more likely have a small businesses either help supporting or wanting to advertise / help club members some how with a discount possibly.
  • small business not having a website of there own. if they do it is not a e-commerce website at most just a few essentials (name, address, a couple photos, and a few paragraphs). and these folks wanting to list a few things on club internet website for sale. and be able to possibly accept cash over the internet, but not about to pay a few hundred bucks for there own website, it is not worth it to the small business owner.
  • club needing a "forum" to communicate between meetings 
  • an ability to host web conference at times, with showing a recording of what happen latter on, possibly the speaker of the web conference wanting to make a couple bucks off actual live conference and then a little bit more on the recording afterwards. ((recordings = good for dial up folks, were dial-up folk can set there and wait for recording to fully download before watching / listening ))
  • a way for emails to be sent back and forth and to communicate through the club. 
  • everyone is different in how they learn, note taking, reading, hands on experience, helping others, taking tests, talking about it, etc... moodle provides the more ways for folks to learn.
  • you are talking about small size club's, paying a few bucks a month for internet fees, and someone not that admin savoy (knowing how to code, how to setup different authorization, enrollment doings, edit layouts between multi software packages so it all looks as one)

as hobbies clubs grow and/or small business supporting them grow. a small business may get there own website and e-commerce store up and going, this means, videos, emails, ecommerce ability, tracking, some sort of small POS (point of sale), etc...  now the small business might want to import or do a product feed to the club website if possible. for club members discount, vs copy / pasting.  or they might want to do a "product embed" or what ever the case maybe.  if the small business website can communicate with the club website software. at a more lower level. there is a lot more that could be done. 

moodle has variety of web services, internal / external database connections, etc... but you still need other software to connect to moodle. at current age of most ecommerce , forum, chat, CMS "content management software" software out there. all these apps are primarily at barely meeting SOHO (small office / home office) doings. for basics. (setting up different roles, "admin, teacher, student". if a small business owner highers a couple folks even a small crew, and attempt to give them permission on these other packages. there employees just obtained full admin rights to everything.  SSO (single sign on), embedding / iframing each software into another is a complete "joke" in how much functionality there is. and you have to take care of 3 or more doings, moodle, plus software linking to, plus the plugins linking them together. plus getting theme/layouts to look the same. 

small business owners should not need full knowledge of how to code in PHP,html,css, javascript. and they should not need to check multi websites for "critical updates / security updates". 

most of the time, when i look at websites that have 2 or more software linked together, 1 software sees all the attention, and other software is completely forgotten about as if it did not exist, with exception to a handful of folks that are just curious. and when i say "joke" above with the embedding and iframe notation above, it is just that. it is a "joke" and there is a noticeable wrinkle in the 2 linked software. and folks seem to realize this intentionally or not. and just avoid it. i am going to blame (internet ads) and folks having a built in reaction of walk/click away from advertisement doings.

==================

getting back to small bushiness. 

have seen some of them running a credit card scanner via there cell phone, some with a basic website but not much schedualing, some trying to do all of it, but different software that does not communicate with each other. (a cluster mess). some trying to post some videos, but not able to achieve linking back to there website. 

restaurants...they need a POS to handle taking orders via phone, waitress, at counter, possibly over internet taking orders, they may need a few POS within the same building and/or a delivery folks, plus some ticket printers in the kitchen for the cooks, plus a back office computer to deal with ordering supplies, putting in inventory checks, etc...  these same companies also need to make sure employees take various certification tests MSDs (material safety datasheets) for various chemicals used to clean and like. along with general safety checks. plus need to keep hard paper copies of specific data around the place for both employees and customers in case of emergency or like. if stores are running 2 to 3 shifts or more of folks (full time and part time employees),  giving a spot for managers to keep notes and let them communicate back and forth like a hidden / private forum for managers. along with keeping records for employees. 

lets flip this over to K-12 and collage.  teachers taking attendance, teachers and general school staff keeping records of student issues (problems that come up per each student), scheduling, students taking quizes and signing off some safety paper work (for hand's on stuff) make it shop class, messing with chemicals or like.  library checkout (POS) "aka library fees, past due fees, computer usage fees, etc...), teachers wanting students as part of assignment to check stuff out and needing reference, front office of smaller schools to deal with various stuff that comes up, field trips, in class doings were teachers request students to pay for some supplies, student meal programs, accepting inventory and splitting the inventory up among class rooms and courses.  after school student clubs scheduling, bus scheduling err i mean delivery of pizza and drinks, and dealing with i did not get my pizza with mushrooms on it, errr i mean the kid did not get on the bus, and was not delivered to there home UTH OH! i think i will pick my pizza over the kid. errr rather same like doings, just a different way of describing things. 

seen it many times, large old beefy copier in teachers lounge, and teachers require to enter a pin number, so penny pinchers can keep track of were expense goes for all the paper and ink. and asking teachers to give some sort of inventory / expense report before anything, and then expecting another report when in actually happens within the class room. instead of double, triple, quad paper work... how about enter it once, and click a few buttons to send it back and forth in a single overall software errr software suit that knows how to talk with rest of the software in the suit. the issue is... most software is still in the old "dos / windows 3.1" it is all back office software. and non of it really does well on the internet.   moodle is the old back end software but built for the internet. 

==========

ecommerce is a big "price shocker" but it is a lot of other things as well. if you can get past the "dollar notation" and look at what else ecommerce has. and then bring it up to enterprise level of doing... ya got something.  enterprise level of doing is... roles/capabilities settings within moodle, and database, and getting everything to work together in a single setup. that is an enterprise level software package. without adding all the "3 to 4 letter terms on it" but enterprise level, means... not having a single course will all questions must be entered, and then another course were just web conferences happen, and other course were html pages happen.  but rather being able to offer different options in multi locations.  each course being able to have different activities / resources. but different content within them. a single ecommerce website software is not enterprise level. when you are able to offer ecommerce in each course like an activity or resource with different content, then it becomes enterprise level. 

==========

==========

K-12 / collage uses....

say wood shop class, they have a couple locker rooms for storage of materials. teacher/s have access to locker room via a key or padalock or swipe card or like.  they need to keep inventory, but at same time they need a material list from students so they can bill the students for materials.

  • teacher/s go into moodle. create there course if not already, create a "assignment => store" 
  • add in "wood working class S293 teachers name" for the store name
  • put in details of contacting teacher as if store contact details. possibly adding in schools front office details. as well.
  • the add a few products to the store, "2x6 4 feet long costs 2 bucks",  "1x1 6 feet long costs 3 bucks", etc...
  • the teacher also adds in how much each item cost the teacher (aka teacher went to local hardware store and purchased this stuff on a school account)
  • students make up a list of what they need, hand it over to teacher for double checking and pull out lumber from the locker rooms, checking out via moodle what they remove (if not all at once).  and the store keeps track of costs and inventory. 

art class, and certain paints or cloths to paint on cost more vs others. and students are charged for what they use. 

  • teacher goes in makes up a "resource -> store" adds details to the store, and then adds in products the students can buy.  but this time around, the teacher is not allowed to accept cash from students, and only the front office can. and the school requires parents to pay up front for class room supplies. 
  • the teacher setups each product to be bought by students, through there class / course for that class. and when they goto purchase the items, they are required to checking via there "school debit account -> school X school room account"  
  • in another class room, the teacher is able to accept money directly from students, and they are allowed to spend up to 20 bucks worth of supplies. BUT everything is paid for at end of the project. not up front.  one more catch, students can give cash directly to teacher, or they can goto front office to pay, or there parents can log into the school website and pay with credit card or through paypal or the like. 

younger students, say K through 8th grade. class project, and teachers/school requires parents to pay for supplies, say a given known amount of $11.50 no one really wants the kids to actually see the money aspect of it all. 

  • so price of stuff is kept hidden via an option in the store. but the teacher still fills out some "pricing info", and requires the kids to select what they used during the project, some kids going to use more than others and vice vs. and nothing is really hammered down to fine details. but simple tracking / inventory info. ((actual dollar figures = 0, but inventory stock amount is put in for each item))
  • parents can then either get a bill sent to them, and pay via check or show up in office and pay at the front office, or go online and check student info and pay with credit card online. or simply see how much the bill is. at same time see what the kids grades are. and if the kid has gotten all there homework in or find out what there latest homework assignments are.

to above, it could be a field trip, and needing to accept money for the field trip, at same time deal with written signature allowing student to go on field trip. 

to note it i realize there are various rules/regulations out there for teachers and what they must abid by.  but there are exceptions to every rule. and what ever is the easiest is normally what is done. if moodle had ecommerce built into it. would it become the easiest? in today's trend of everything going more and more into the "cloud".

==============

to note it, i am not looking at ecommerce as a do it all thing, i am wanting the framework of ecommerce at a enterprise level. most integration does not allow enterprise level. and there needs to be more of a complete fit.






In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

i think i am just going to go with generic name of "commerce" for all this. forget e's for internet and like. KISS (keep it simply stupid) any suggestions welcome in what to name it. 

looks like i can just edit default "moodle" GNU General Public License in files a little bit, and be ready set go. the only thing is dealing with opencart "same licenses as moodle" and needing to keep a copy some place on the internet, for i think it said 3 years? tempted to zip it backup and toss it back on github, on initial fork of moodle i made. 

========

info overload after watching, but covers it all for setting up a basic plugin. 


=========

it would seem there is a limit, i am guessing on purpose, of how deep via folders "sub plugins" can go, before ya get into a bunch of extra custom code. 

https://docs.moodle.org/dev/Subplugins

hhmmsss... going to need to look into this deeper. and/or deal with installation in a 2 or more steps. in how plugins are installed. do one first before others and messes it all up i would imagine. 

1st set of plugins, creating ((basically just plugin type managers, theme boxs to shove it all into, along with a more of the core code for "commerce"))

  • admin settings => commerce => store admin (rear end settings / connection to core code)
  • admin settings => commerce => payment gateways (paypal, amazon, etc...)
  • admin settings => commerce => shipping modules (ups, usps, etc..)
  • admin settings => commerce => product info types (sku, stock amount, product attributes)
  • etc...

2nd set of plugins. actually being the plugins, that go into... payment gateways, shipping modules, product info types, etc... 

if looking at code correctly this should allow me to remove the need for "sub plugins" 

==========

hhmmsss i thought there would be more database entries for all the various plugins and classes/functions and third party frameworks, but it would seem everything is based on "folder/file" relationships. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

chicken scratch note taking...

  • moodle -> lib -> classes -> plugin_manger.php = very bottom of file. notations for "standard plugins"
  • moodle -> lib -> classes -> plugin_manger.php = public static function resolve_plugininfo_class($type)  = note on...
    • $dir/adminlib.php
      • moodle/lib/
      • moodle/mod/assign
      • moodle/lib/editor/atto
      • moodle/lib/editor/tinymce
      • moodle/enrol/flatefile
    • \core\plugininfo\general
      • i assume refrence is to moodle -> lib -> classes -> plugininfo
    • public function get_plugin_info($component) = frankenstyle compenet name
    • public function can_uninstall_plugin($component) = check depends looks like something needs to be set in say per each payment gateways, so paymentgateway manger can not be uninstalled. 
      • protected function common_uninstall_check(\core\plugininfo\base $pluginfo) {
      •         if (!$pluginfo->is_uninstall_allowed()) {
      •             // The plugin's plugininfo class declares it should not be uninstalled.
      •             return false;
      •         }


CONTEXT NAMECONTEXT AREACONTEXTLEVEL
CONTEXT_SYSTEMthe whole site10
CONTEXT_USERanother user30
CONTEXT_COURSECATa course category40
CONTEXT_COURSEa course50
CONTEXT_MODULEan activity module70
CONTEXT_BLOCKa block80

=================

  • need to figure out why... http://localhost/moodle/admin/tool/xmldb/  does not auto create all the database tables. or if it does it on demand. and if i need to do something for plugins to allow for it. 
  • need to read up on "foreign keys"
  • want to check to see if 2 databases can be ran side by side, 1 for basic moodle. 2nd database (different username/password/host/etc..) used stuff that holds the money.  or to simply. off load an overwork database server and spread the database tables out to different physical servers. not looking forward to diving into it.
  • need to find some default numbers of what different values are set at. such as ID fields. so someone is not running out of database ID numbers due to field was set to small. or if there is a "default" value some place i can set field sizes to. 

===========

  • https://docs.moodle.org/dev/Local_pluginstalk about local plugins very last things to load. and possibly over riding different aspects of core functions / code. but not much detail on that.
  • lost link in tracker = something about common plugin and getting away from $module all together or something like that.
  • moodle -> lib -> form = all the various form types


In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

chicken scratch notes of mine. 

=================================================

moodle => admin => settings => plugins.php = moodle core site admin menu setup with basic settings


=================================================
some detail of what is what. for """ version.php """ for plugins 
example moodle/mod/mymod/version.php $plugin->maturity = MATURITY_STABLE;
moodle => lib => classes => compenent.php (lines 27 through 38)  

/** Software maturity level - internals can be tested using white box techniques. */

define('MATURITY_ALPHA',    50);

/** Software maturity level - feature complete, ready for preview and testing. */

define('MATURITY_BETA',     100);

/** Software maturity level - tested, will be released unless there are fatal bugs. */

define('MATURITY_RC',       150);

/** Software maturity level - ready for production deployment. */

define('MATURITY_STABLE',   200);

/** Any version - special value that can be used in $plugin->dependencies in version.php files. */

define('ANY_VERSION', 'any');


interesting... looks like there is an "auto update" for moodle. and if you get your plugin listed within.... www.moodle.org/plugins  your plugin will get tagged by "auto update" if there is an updated version available on www.moodle.org/plugins  by the auto update.  this is assuming you have enabled "auto update" in your moodle installation itself. 

it would seem to check the "version.php" of the plugin. and the version number within it. against a database table entry that happens during install of the plugin, vs version info at www.moodle.org/plugins  ((not a clue how, yet, that is.))

i am guessing above maturity level. is dealing with development process, setting up a tracker, etc... to point "your given plugin" is listed on www.moogle.org/plugins


=================================================


  • moodle => lib => classes => compenent.php (lines 333 through 446)  

    protected static function fetch_subsystems() {

        global $CFG;

        // NOTE: Any additions here must be verified to not collide with existing add-on modules and subplugins!!!

        $info = array(

            'access'      => null,

            'admin'       => $CFG->dirroot.'/'.$CFG->admin,

            'auth'        => $CFG->dirroot.'/auth',

            'availability' => $CFG->dirroot . '/availability',

            'backup'      => $CFG->dirroot.'/backup/util/ui',

            'badges'      => $CFG->dirroot.'/badges',

            'block'       => $CFG->dirroot.'/blocks',

            'blog'        => $CFG->dirroot.'/blog',

            'bulkusers'   => null,

            'cache'       => $CFG->dirroot.'/cache',

            'calendar'    => $CFG->dirroot.'/calendar',

            'cohort'      => $CFG->dirroot.'/cohort',

            'completion'  => null,

            'countries'   => null,

            'course'      => $CFG->dirroot.'/course',

            'currencies'  => null,

            'dbtransfer'  => null,

            'debug'       => null,

            'editor'      => $CFG->dirroot.'/lib/editor',

            'edufields'   => null,

            'enrol'       => $CFG->dirroot.'/enrol',

            'error'       => null,

            'filepicker'  => null,

            'files'       => $CFG->dirroot.'/files',

            'filters'     => null,

            //'fonts'       => null, // Bogus.

            'form'        => $CFG->dirroot.'/lib/form',

            'grades'      => $CFG->dirroot.'/grade',

            'grading'     => $CFG->dirroot.'/grade/grading',

            'group'       => $CFG->dirroot.'/group',

            'help'        => null,

            'hub'         => null,

            'imscc'       => null,

            'install'     => null,

            'iso6392'     => null,

            'langconfig'  => null,

            'license'     => null,

            'mathslib'    => null,

            'media'       => null,

            'message'     => $CFG->dirroot.'/message',

            'mimetypes'   => null,

            'mnet'        => $CFG->dirroot.'/mnet',

            //'moodle.org'  => null, // Not used any more.

            'my'          => $CFG->dirroot.'/my',

            'notes'       => $CFG->dirroot.'/notes',

            'pagetype'    => null,

            'pix'         => null,

            'plagiarism'  => $CFG->dirroot.'/plagiarism',

            'plugin'      => null,

            'portfolio'   => $CFG->dirroot.'/portfolio',

            'publish'     => $CFG->dirroot.'/course/publish',

            'question'    => $CFG->dirroot.'/question',

            'rating'      => $CFG->dirroot.'/rating',

            'register'    => $CFG->dirroot.'/'.$CFG->admin.'/registration', // Broken badly if $CFG->admin changed.

            'repository'  => $CFG->dirroot.'/repository',

            'rss'         => $CFG->dirroot.'/rss',

            'role'        => $CFG->dirroot.'/'.$CFG->admin.'/roles',

            'search'      => null,

            'table'       => null,

            'tag'         => $CFG->dirroot.'/tag',

            'timezones'   => null,

            'user'        => $CFG->dirroot.'/user',

            'userkey'     => null,

            'webservice'  => $CFG->dirroot.'/webservice',

        );


        return $info;

    }


    /**

     * Returns list of known plugin types.

     * @return array

     */

    protected static function fetch_plugintypes() {

        global $CFG;


        $types = array(

            'availability'  => $CFG->dirroot . '/availability/condition',

            'qtype'         => $CFG->dirroot.'/question/type',

            'mod'           => $CFG->dirroot.'/mod',

            'auth'          => $CFG->dirroot.'/auth',

            'calendartype'  => $CFG->dirroot.'/calendar/type',

            'enrol'         => $CFG->dirroot.'/enrol',

            'message'       => $CFG->dirroot.'/message/output',

            'block'         => $CFG->dirroot.'/blocks',

            'filter'        => $CFG->dirroot.'/filter',

            'editor'        => $CFG->dirroot.'/lib/editor',

            'format'        => $CFG->dirroot.'/course/format',

            'profilefield'  => $CFG->dirroot.'/user/profile/field',

            'report'        => $CFG->dirroot.'/report',

            'coursereport'  => $CFG->dirroot.'/course/report', // Must be after system reports.

            'gradeexport'   => $CFG->dirroot.'/grade/export',

            'gradeimport'   => $CFG->dirroot.'/grade/import',

            'gradereport'   => $CFG->dirroot.'/grade/report',

            'gradingform'   => $CFG->dirroot.'/grade/grading/form',

            'mnetservice'   => $CFG->dirroot.'/mnet/service',

            'webservice'    => $CFG->dirroot.'/webservice',

            'repository'    => $CFG->dirroot.'/repository',

            'portfolio'     => $CFG->dirroot.'/portfolio',

            'qbehaviour'    => $CFG->dirroot.'/question/behaviour',

            'qformat'       => $CFG->dirroot.'/question/format',

            'plagiarism'    => $CFG->dirroot.'/plagiarism',

            'tool'          => $CFG->dirroot.'/'.$CFG->admin.'/tool',

            'cachestore'    => $CFG->dirroot.'/cache/stores',

            'cachelock'     => $CFG->dirroot.'/cache/locks',

        );

        $parents = array();

        $subplugins = array();


it looks like core plugins, are getting a cheat sheet per say, with the above, to increase overall server performance, vs reading in each independent plugin type on each page load. 

there is a duplication of both arrays some place else ""other file""  (in a link in one of the recent previous posts if memory serves me). i need to figure out what is the "new way" vs dealing with the "old way" the arrays look the same, but the written out code is completely different, and steps through each sub folder. via a foreach maybe? or a single subfolder maybe that is what it was, a limit of one subfolder depth? exception for tinymce and one or two other notations.

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -
well that stinks... the auto save happened during at CTRL + Z and a CTRL + Y (undo / redo) and lost entire post when i kept on hitting me the keys! see if i can remember folder/file names...

  • admin/localplugins.php
  • admin/settings/...( all ).php
  • course/render.php 
    • create a html wrapper for products and most likely edit a couple of the functions there, to deal with how links are created. along with inserting "buy now cash amount
  • course and sections.
    • course/lib.php
    • course/edit.php
    • course/edit_form.php
  • mod = activity / resource
    • course/modedit.php
    • course/modedit.php
    • course/modlib.php
    • course/moodleform_mod.php
  • lib/adminlib.php
  • lib/modinfolib.php
  • lib/moodlelib.php
  • lib/classes/plugin_manager.php
  • lib/classes/plugininfo/
  • lib/classes/plugininfo/... ( all ).php
  • lib/form/...( all ).php
  • had some a couple javascript files tagged. but done forgot them.

do not remember were but there were 3 different arrays, of "core plugins", one array seemed to be the "old way and getting eliminated", and the other 2 arrays, were "new way" but unsure...  they were like cheat sheets to deal with better performance on core plugins.

=====================

need a way to handle multi type of plugins....

  • store = moodle/store/
    • this also holds data for inserting menus and handling plugin manager for these plugins in site admin
    • also holds data for displaying "forms" for "store settings" (see further below)
  • store = moodle/store/plugins
    • basic stuff, already there, but meant to extend beyond original coding with plugins. so say instead of selecting a product category, you could also select a google product category, or a ebay product category. these would be plugins. granted not best examples. for a store, it might some sort of push/pull product feeds or something from a manufacture / publishing house or like.
  • store = site admin => plugins => store 
    • for above plugins 
  • store = database table 
    • for generic settings ((need to re-look how moodle handles settings of this nature))
  • store settings = site admin => front page => store settings
    • default site store (were one would enter, settings for above plugins)
  • store settings = course admin => store settings
    • possibility of treating each course as a separate store

==============

  • paymentgateway = moodle/paymentgateway/
    • this also holds data for inserting menus and handling plugin manager for these plugins in site admin
    • also holds data for displaying "forms" for "paymentgateway settings" (see further below)
  • paymentgateway = moodle/paymentgateway/plugins
    • for expanding payment gateways, such as paypal, autherize.net, etc...
  • paymentgateway = site admin => plugins => paymentgateway
    • for above plugins 
    • this needs to do extra duty. so plugins can be "reused" but different settings. (paypal with say john doe), another store front might want to use (paypal with alex uoa), another may want to use (autherize.net someone else, and different settings)
  • paymentgateway = database table 
    • for generic settings ((need to re-look how moodle handles settings of this nature))
  • paymentgateway settings = site admin => front page => store settings => payment gateway
    • default site store (were one would enter, settings for above plugins)
  • paymentgateway settings = course admin => store settings => payment gateway
    • possibility of treating each course as a separate store and needing there own payment gateway setup.

==============

commercial address = comaddress / com_address

  • comaddress = moodle/comaddress/
    • this also holds data for inserting menus and handling plugin manager for these plugins in site admin
    • also holds data for displaying "forms" for "comaddress settings" (see further below)
  • comaddress = moodle/comaddress /plugins
    • for expanding database table by adding additional fields ((most likely will come in handy for accounting))
  • comaddress = site admin => users => comaddress 
    • for above plugins 
    • i need to tag multi types of addresses (billing, shipping, manufacture, user, etc...) and multi of them per person. this also goes with, credit card companies / shipping companies, that may return a "legit address" vs sending back "address = fake" or like, when you do handshakes with these companies via computer code, to get shipping quotes or to getting your money via credit card, to returning money, the can send back different responses in a way to prevent lost money.
  • comaddress = database table 
    • for generic settings ((need to re-look how moodle handles settings of this nature))
  • comaddress  settings = site admin => users => comaddress settings
    • were to find plugin settings 
  • comaddress settings = site admin => users => comaddress
    • add/edit/delete = comaddress for users/manufactures/etc.. manually. vs them entering it.

===================

below need a 

  • simple database table
  • simple form (exception tax rates)
  • site admin => plugins => commerce => listing of each one below
  • moodle/localisation/listing_of_each_one_below.php  
    • no plugins beyond (localisation) being treated as a single plugin, just straight name.php, name_form.php for all of below.
    • localisation acting as a plugin, would handle inserting of menu names. and a single version number for all of below.

all of the below notations are found under... opencart/admin/ (menu on let) => system = >localisation

  • currencies
  • stock status
  • order statuses
  • return statuses
  • return actions
  • return resasons
  • zones
  • geo zones
  • tax classes
  • tax rates  ((little bit more complicated))
  • length classes
  • weight classes

i do not believe above would be edited / changed a big amount. beyond initial setup of server or when laws come into effect and need an update.

====================

brain fried, ending here. before i wait and come back and loose it all again.





In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

2nd time around. the "save draft" of the editor has nailed me a couple times now... in middle of a CTRL Z and/or CTRL Y (undo / redo) and it zaps post away. not about to re-type it all backup.

============

comaddress = renamed to "addressbook"  sounds a bit more understood of what it is.  i did look some what at "users" and adding mod for users. but unsure (did not go into depth). the need to create multi addresses and link to a single user is what is wanted. and not sure if that is possible easily with what currently in moodle.    

billing address, shipping address, different credit card addresses, different ship to addresses, "address checking" from shipping and payment gateways. manufacture descriptions and assigning to products, etc...  info coming in from plugins, and be able to update there "address book info" info coming in from facebook or like. 

=============

getting a tad lost in creating a plugin,   primarily with all the little "what can and can not be included" in the verison.php, settings.php, db/access.php, db/install.xml

also getting lost, in creating the functionality of plugin types. local, mod, admin/tools, cache, enrol, auth, etc...  were you have a "plugin manager" under site admin menu => plugins => plugin manger, then a listing under that if any plugins that require additional settings. everything is already "core plugin" that allows the x_folder = special type of plugin. other words i have not come across a www.moodle.org/plugin that does same thing. as what the core moodle plugin types allow. the nearest i have came across is a couple that use the "dependency" settings in the "settings.php"

================

have destroyed moodle installation a couple times already (files and database tables). primarily with "XMLDB editor" and getting a bad "install.xml" other times commenting stuff out were i should have not been putting in // or using wrong variables for string names. *woops*, a couple times some how causing plugin to be installed a few different times and getting multi listings on the config_plugins database table for the same plugin. i have lost and gained a few site admin menu items a few times as well *woops*

i have had to "disable caches"  "under site admin menu" there be a "search box" type in "cache" and brings up results to disable a few cache' (themes, javascript, html, php)  this has helped a lot with issues above. the default "wamp" appache, mysql, php were all put onto a single cpu core. vs going into the multi core cpu.  and just maxing out the one cpu core.  after disabling the caches, the wamp/moodle started to run much faster on this dev computer.

i had at one time enabled "site admin menu => developer => show error messages" and the other settings. and that also seemed to cause some extra issues.  turning them all off and setting them back to normal, and issues above, began to clear up. 

with above said. keep with the default install of moodle when developing! seems to work best so far for me.

================

off to edit core files this time vs creating a plugin. to see if i can better duplicate a few things. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

went with moodle 2.9dev version with latest re-install. 

went through and did a "find in files" for "auth" and "enroll" in attempt to ID key files / folders. and then copy / pasted into another folder. to make it quicker to search them. ((see attached test.zip))

moodle/lib/editor/tinymce  might be a easier "something" to copy info for sub-plugins. now that i am looking more at it. less involved vs other core plugins.

=====================

  • orphaned, and deprecated notations both in code, and files named. has me some what concerned.
  • much confusing, of what runs first and what runs last. as far as code execution. ""refering to code comments inside the code / files"" more to do with "local" folder, core plugins, and then third party plugins. which order?
  • it almost seems like a "copy paste" happened.  between original plugins, and then making them core plugins. and just copying functions / classes into specific files. 
    • other words there is enough repeat of different type of settings and use of functions in same single file, to choose and pick from, vs searching all over the place. or at least that is the hope!
  • i did find the local folder more to... "customized installs" vs anything else via "default.php" and just setting some settings, and changing string names possibly. 

=======================

off to edit core files again, and see what happens, hopefully will not destroy another moodle installation, from own chicken scratch attempts. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Ryan - just a suggestion.

Would you perhaps be better off starting a doc to make all these notes rather than posting to the forum all the time?

Richard

In reply to Richard Oelmann

Re: open source e-commerce for moodle

by ryan sanders -

Richard Oelmann hey there smile

*big grin* was flustered to say the least, but still going to reply to this thread. open source software = open note taking, with feed back as a bonus!

=========================

looking at opencart "payment gateways" and noted below folders/files that dealt directly with different payment gatways. * = everyting in folder, / "nothing" = 1 or 3 files most likely that reference to a payment gateway. with a couple specific files noting direct code edits for some payment gateways.

  • admin/controller/payment/*
  • admin/controller/total/
  • admin/language/english/payment/*
  • admin/model/payment/*
  • admin/model/total/
  • admin/view/template/payment/*
  • admin/view/template/total/
  • catalog/checkout/order.php
  • catalog/controller/checkout/checkout.php
  • catalog/controller/payment/*
  • catalog/language/english/payment/*
  • catalog/language/english/total/
  • catalog/model/payment/*
  • catalog/model/total/
  • catalog/view/theme/default/template/payment/*
  • catalog/view/theme/default/template/total/
  • install/opencart.sql

still a bit confused in how opencart handles install/uninstall of different payment gateways. some of them had a special custom function built into there files, others do not.  like oscommerce, oscmax, zencart... open cart has file edits all over the place in its code for this or that add on *big frown*

===================

i am still getting a couple more errors, in my attempt to do a "copy/paste" of enrol (not the plugins for it, just main files) over to a new core plugin for paymentgateways. (no actual functions edited, beyond search and replace of enrol to paygate)

decided to take hint with "enrollments" and short handed to "enrol"  and started using "paygate" 

moodle/paygate/paymentgatewayaddons

====================

still going to code towards treating commerce as a core plugin. not sure if i would be able to pull it off, if i did not treat it as such. and have edited a good amount of core files. when doing the "copy/paste" of enrol to paygate. so far it has been simply copying a class or function of enrol, and pasting it in below it and search/replace of enrol to paygate, of given files. 

once i get rest of errors taking care of for paygate, will most likely start commenting stuff out of files. to slime things down to a min amount of files / code needed, for a "plugin code base".  that i can "copy/paste", "search/replace" for other stuff, (order totals, product info, etc...), more of an attempt to stay with moodle code styling and doings. 

*reminds me* i need to double check XMLDB, to see if the phpmyadmin, export / import of enrol to paygate table worked and did not mess up the XMLDB side. it might be a cheap trick. will find out soon enough. @@

=============

=============

=============

suggestions on specific "functions / classes" for main type of plugins for commerce? order total, product info, payment gateways, etc..

example for payment gateways?

  • function billing_address = gets current user billing address
  • function shipping_address =
  • function validate_address = validating billing, and/or shipping address
  • function error_red_flag = account has been flagged as a scam by credit card company. 
  • function error_yellow_flag = address does not match perfectly from address validator.

examples for order totals?

  • function add_total
  • function subtract_total
  • function add_sub_total
  • function subtract_subtotal
  • function tax

other words what do you think there should be for basic functions / classes? 

In reply to ryan sanders

Re: open source e-commerce for moodle

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Apologies - no intention to fluster anyone! Or to stop the notes coming! Just to suggest what (to me) would seem to be an easier way of doing the same - and the docs in Moodle are wiki based so do allow others to feedback and comment and make suggestions as well as being able to track revisions in project notes smile

But if you prefer to do it through a forum thread, keep going - it was a (helpful? - at least intended as such) suggestion only and no more than that!

R


In reply to Richard Oelmann

Re: open source e-commerce for moodle

by ryan sanders -
we keep getting off on wrong foot Richard!,  i was not flustered at you, but the auto save, and getting stung a couple times of loosing info via the editor.  i also thought you meant creating a readme.txt like document. and not *points up* development -> projects.  ((actually didn't even realize projects was there))  and thanks for bringing it up!


if i am following things correctly, looks like i need to setup a tracker first?? i am not seeing a way to create a project directly?


just created... MDL-48712 hopefully filled it out correctly.






In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

more chicken scratch notes

2 steps forward 3 steps back! i thought i was nearing point of being able to copy/paste of moodle/enrol to moodle/paygate" and then copy/paste to moodle/ordertotals, and moodle/productinfo, etc... but keep hitting extra snags. primarily due to enrollments are tied into everything within moodle.

  •  site admin menu -> plugins -> plugins overview 
    • scroll all the way down,  and see "paygates"  need to find string for this again to reference to "payment gateways"
    • flat file fake1 and flat file fake2 (copies) plugins showing up correctly, with version info
    • ========need to run cron, and flush caches======== for this area to show up. ((due to manual edits of files and not updating version number))
  •  site admin menu -> plugins -> payment gateways -> manage payment gateways
    • copy of site admin menu -> plugins -> enrolments -> manage enrolments
    • links working = name, enable/disable, up/down/ settings, and uninstall
    • not working = instances / paymentgatways = not enough yet to change code.
    • not working = foreach statements to show individual settings of enabled plugins, and listing them below the table, like page for "manage enrolments" does.
  •  site admin menu -> plugins -> payment gateways -> flat file (fake 1) plugin
    • copy of site admin menu -> plugins -> enrolments -> flat file
    • changes made are being saved, not actual uploading a file, but check boxes seem to be working.
  •  site admin menu -> plugins -> payment gateways -> flat file (fake 2) plugin
    • copy of site admin menu -> plugins -> enrolments -> flat file
    • same as above

=====================

issues to above

  • have yet to figure out how to change the admin menu -> plugins -> enrolments -> manage enrolments -> (top table)  of what is and is not displayed, for copy i did for payment gateways. 
  • just now noticed in typing this up, that the "for each plugin" is not work as well on the "manage payment gateways" in showing there settings below the table.

=====================

logging in as admin going to a course.....

  • course administration -> users -> enrolled users
    • http://localhost/moodle/enrol/users.php?id=2 
      • works
    • http://localhost/moodle/paygate/users.php?id=2 
      • sorry, but you do not currently have permissions to do that (review course payment gateways)
      • not showing up in in the menu, and directly changing URL to get above.
  • course administration -> users -> enrolment methods
    • http://localhost/moodle20141224_a/enrol/instances.php?id=2 
      • works
    • http://localhost/moodle20141224_a/paygate/instances.php?id=2 
      • sorry, but you do not currently have permissions to do that (review course payment gateways)
      • not showing up in in the menu, and directly changing URL to get above.
  • course administration -> users -> other users
    • http://localhost/moodle20141224_a/enrol/otherusers.php?id=2
      • i think i goofed up, does not show test student, 
    • http://localhost/moodle20141224_a/paygate/otherusers.php?id=2
      • shows test student, that can be assigned a role. (nothing works to assign)

=================

issues to above

  • i think i am missing some sort of capabilities, some place
  • along with enrolments / paygate copy conflicting with each other in the course administration -> users (user menu item itself) 
    • the code creating "users" menu the code for it, (going from memory here), is not easily copy/pasted if memory serves.
  • moodle/paygate/test_settings.php and moodle/paygate/locallib.php ((copies from)) moodle/enrol/test_settings.php and moodle/enrol/locallib.php take care of "site admin menu"
  • but all the other files
    • externallib.php
    • ajax.php
    • bluchange.php
    • bulkchange_forms.php
    • editpaygatement.php ((arghs)) one error there *changes it to* editpaymentgateway.php
    • editpaygatement_form.php ((arghs)) one error there *changes it to* editpaymentgateway_form.php
    • index.php
    • otherusers.php
    • renderer.php
    • unpaygateusers.php
    • users.php
    • users_forms.php
  • all above files are pulled from other locations... primarily from course administration -> users -> (menu options) and having issues with. i would like to think it is just capabilities. but also some menu navigation issues as well i do believe.

===========================

===========================

  • how many different ways can you spell enrol?
    • enrolment, enrollment, enrolments, enrollments, enrol, enroll, enrolled, ENROL, Enrol, and a couple other varitions of enrollxxxx that did not have "ment" after it.
    • the enrolments and enrollments ((double LL's)) has me!
  • find in files, replace with...(matching case) then (without matching case)
    • enrolment = paymentgateway
    • enrollment = paymentgateway
    • ENROL = PAYGATE
    • enrol = paygate
  • i do not think i have ran into any "enrollment" (double LL's) in code. and are all in comment tags // /* */ but i may very well have mis-read and applied the wrong "replace"

==========================

==========================

following files edited to get basic "site admin menu -> xxxx" working (see top of this post) they are either direct copies of "enrol" replaced with paygate within folder/file name. or copy/paste of code / function of enrol in the files.

  • moodle/admin/paygate.php
  • moodle/admin/settings/plugins.php
  • moodle/lang/en/paygate.php
  • moodle/lib/adminlib.php
  • moodle/lib/paygatelib.php
  • moodle/lib/setup.php
  • moodle/lib/classes/componenet.php
  • moodle/lib/classes/plugin_manager.php
  • moodle/lib/classes/plugininfo/paygate.php
  • moodle/paygate/loocallib.php
  • moodle/paygate/test_settings.php

flatfile plugin for enrol, copied over to paygate. pretty much straight forward "find in files" and replace enrol with paygate in code, and edit a couple file/folder names as well to reflect paygate vs enrol

currently cheating... using phpmyadmin with mysql database. to export "enrol" table, edit table names and fields for paygate, and then importing back into moodle database. along with entering a couple entries directly into tables "config" and "config_plugins" ((copy/paste of enrol to paygate notations in the tables))

=========================

i keep forgetting about...

  • moodle/lib/db/access.php
  • moodle/lib/db/install.xml ((skipping for moment))

=========================

see if i have things covered 

https://docs.moodle.org/dev/Local_plugins

/local/xxx/version.php - version of script (must be incremented after changes)
  • /local/xxx/db/install.xml - executed during install (new version.php found)
  • ((not yet dealing with)) /local/xxx/db/install.php - executed right after install.xml
  • ((not yet dealing with)) /local/xxx/db/uninstall.php - executed during uninstallation
  • ((not yet dealing with)) /local/xxx/db/upgrade.php - executed after version.php change
  • /local/xxx/db/access.php - definition of capabilities
  • ((not yet dealing with)) /local/xxx/db/events.php - event handlers and subscripts 
  • ((not yet dealing with)) /local/xxx/db/messages.php - messaging registration
  • ((not yet dealing with)) /local/xxx/db/external.php - web services and external functions descriptions
  • ((not yet dealing with)) /local/xxx/cron.php - cron job, run at the interval defined in version.php. Alternatively, you can define local_xxx_cron() in lib.php. (The lib.php method is now preferred.)
  • /local/xxx/lang/en/local_pluginname.php - language file
  • /local/xxx/lib.php - function library, automatically included with by config.php. Hook functions local_pluginname_extends_navigation() and local_pluginname_extends_settings_navigation() can be used to add items to the navigation and settings blocks
  • /local/xxx/settings.php - configuration options. These get added to the admin menu.


================

=================

need to look more in depth in the "availability API", and "completion API". to see about dealing with actual, person has paid for item/course/module. vs has not paid for item/course/module. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

purging all caches, and running cron.php was not updating certain things in database... guess it is, done at initial install of moodle. and never rechecked there after, exception during actual install/uninstall of a plugin.

  • database -> mdl_capabilties -> moodle/course:enrolreview, copying line change for paygate
  • database -> mdl_capabilties -> moodle/course:enrolconfig, copying line change for paygate

assigned initial admin account i been using as a manager role, and included above cap's into manager role. 

nearly there with course admin menhu, just not sowing paygate stuff with enrol stuff in the menu. 

looks like i need todo some copying of

  • database -> mdl_external_functions

===================

needed a break, from moodle. and been looking at opencart...

opencart has files all over the place (different sub folders), and getting tired of clicking back and forth. so been using www.advancedrenamer.com to add in folder paths directly into file names. and then cut/pasting files into quickly made up moodle plugins.  

also trying to get some common ground, of payment gateway functions. creating spreed sheet. to and tagging down the functions in it. 

((above is what attached files are about moodle/paygate/, moodle/shipping/, moodle/ordertotal/))

====================

been trying to figure out were to place "checkout pages" do i include them in paygate folder as extra files. or do i go with moodle/checkout/  like moodle/enrol/.  i suppose "checkout" being seen in browser url, might be something. 

shopping cart,  (edit amount, remove items, select shipping possibly) kinda of "checkout" but also shopping cart page. there is a distinctive split, but not really noticed. (to use to ordering stuff online to notice anymore),  of course a block for a shopping cart. moodle/block/shoppingcart,  but also "user menu", and "navigation menu" would be using same code. thinking about it, i guess it does not matter. as long as i can add a menu item from a moodle/block(code itself) and get it to the "theme" *not a clue how theme's work yet* 

========================

tossing in opencart license.txt to attached files, seeing they do not include info directly in any of the files i have looked at.


In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -
XMLDB editor.  *arghs*


it is slow :/ as in CPU INTENSIVE slow... 

==============================

moving all of opencart database tables over to moodle. and then outputting xml from the xmdldb editor.

==============================

STEP A:

CHEATING: using windows 8.1, with wamp2.x (comes with apache, php, mysql, and phpmyadmin). 

  1. install opencart like you were going to actually use it. so it creates all the database tables, and is ready to start putting in product details, etc....
  2. goto www.mysite.org/phpmyadmin
  3. export all of opencart tables, in sql, or like format.
  4. open up file from above, and do a search and replace for "oc_" to "mdl_local_oc_"  and select replace all
    1. oc = prefix used in install of opencart
    2. mdl = prefix in moodle database tables
  5. import the edited opencart file into the moodle database tables

==============================

STEP B:

NOTE:  "oc" in step's 1, 3, 5.5, and 6 below ="oc" prefix of above...

  1. create folder "oc" under www.mysite.org/moodle/local/oc
  2. create folder "db" under www.mysite.org/moodle/local/oc/db
  3. place version.php in www.mysite.org/moodle/local/oc/version.php with the following info...
    1. defined('MOODLE_INTERNAL') || die();
    2. $plugin->version   = 2010101000;               // The current module version (Date: YYYYMMDDXX).
    3. $plugin->requires  = 2010031900;      // Requires this Moodle version.
    4. $plugin->cron      = 0;               // Period for cron to check this module (secs).
    5. $plugin->component = 'local_oc'; // To check on upgrade, that module sits in correct place.
  4. login to moodle as an admin
  5. goto site admin menu -> notifications
  6. let moodle install "local_oc"
  7. goto site admin menu -> developers -> xmldb editor
  8. scroll down and you should see a listing for "local/oc/db"

NOTE: the "db" folder and version.php file are minimum required to get a listing to show up under... site admin menu -> developers -> XMLDB editor.  

==============================

STEP C:

this is were things begin getting problematic and slow... *feels like he is back on dial-up connection*

  1. click [create]
  2. click [load]
  3. click [edit]
    1. DEFAULT, a table... local_oc is created.
    2. we can edit the local_oc table if wanted (ready set go for basic simple plugin)
  4. [View original] [View edited] [New table][New table from MySQL][View SQL code][View PHP code][Back to main]
    1. we are intrested in [new table from mysql] so click that.
  5. from the drop down menu, you can select, database tables already in the moodle database it would seem.
    1. selecting, "local_oc_attribute"
  6. the after table... i have not figured out yet, i assume it is there, so code shows up in a certain order in the.... www.mysite.org/moodle/local/oc/db/install.xml  file
  7. click "create"

==============================

STEP D:

this is were things become problematic... moodle XMLDB editor, hates it if there is no "KEY",   oh it will let you save it it, and add new fields, etc... but if you leave this page with out creating a "KEY",  you are in trouble... if you do leave this page then....

or

  1. write down the name for the "primary / unquie / ID column for this table" in this case it is...
    1. attribute_id
  2. [View original] [View edited][New field][New key][New index]
    1. click [new key]
  3. NAME: = PRIMARY
    1. READ, name = PRIMARY, for initial first unquie id, from what i have figured out so far. if you put name as anything else, you will get problems. and errors, when you go to save your work, or go back and edit things
    2. and it needs to be in CAPS, and not in lower case it would seem.
  4. COMMENT: = empty or anything you like
  5. TYPE: = PRIMARY
  6. FIELDS: = attribute_id
    1. from step 1.1.  above,
    2. column/field name that is unique/primary,   most initial field names in database tables are named ID, 
    3. click "change"

===================================

STEP E:

  1. at this point... you should be safe, and able to to click [save]
    1. [View SQL code][View PHP code][Save][Back]
  2. click [back]
    1. [View SQL code][View PHP code][Back]
  3. click [back to main]
    1. [View original] [View edited] [New table][New table from MySQL][View SQL code][View PHP code][Back to main]
  4. click [unload]
  5. local/oc/db[Create][Load][Edit][Save][Doc][XML][Revert][Unload][Delete]
you should now have a www.mysite.org/moodle/local/oc/db/install.xml 


i am not sure what the "load" and "unload" stuff is all about. and why you need to load stuff up, before you can edit stuff. but *shrugs* playing it safe. for now...


In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

needing to deal with guessing 50 plus opencart tables and converting them over to moodle. i need to cheat, and looks like a lot of "manual" typing and/or copy/pasting into install.xml file.  do to issues with XMLDB editor

i already did last post, so now....

  1. site admin menu -> delevoper -> xmldb editor 
  2. scroll down to "local/oc/db"  click [load]
  3. click [edit]

from this point on. i will not be able to do above. errors will show up, and prevent me from clicking [edit], so once i get done with next few steps, it will be all manual editing of www.mysite.org/moodle/local/oc/db/install.xml 

other words i will be manually typing in the "xml" for keys for each table in the install.xml file.

*stretches fingers* time to multi task... 

  1. [View original] [View edited] [New table][New table from MySQL][View SQL code][View PHP code][Back to main]
    1. right click on [new table from mysql] and choose open in new tab
    2. i need to do this about 50 times, so "right click, and then pressing T key"  T key = short cut key for opening in new tab
  2. CREATE TABLE: = select table you want to import into moodle, 
  3. DO NOTE click "create button"  WAIT!!! till you got all of the database tables you want chosen in "tabs"

once you have enough "new tabs" opened up to "new table from mysql"  then you can go back through each tab and click the "create button"

might as well save this post... it will take a few plus minutes for all the tabs to load up...  and waits for someone to post something easier and quicker...

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

random thoughts, as i await for XMLDB editor pages to load/finish

foreign key, soft delete, hard delete, keeping records of someone paying for something. and not have a course delete / restore / backup, or an activity or resource, or block. go back and destroy / hard delete the info for buying this or that.

were is a line drawn. so finical data is protected... reading up on various ways to handle "soft delete"

for performance, having a second set of database tables is suggested from what i been reading. it keeps the main database smaller. and would let the second database / second tables. get bloated. not really matter. (within reason), the issue was getting data back from, second database tables, and put back into primary. and the extra complex sql strings that would be needed. 

is there a way to edit, the database layer / abstraction layer. ((xmldb))  so that entire moodle, and/or basic plugin types, worked. without need to edit each and every plugin. 

----say if sql string noted an update in it, then... change "update" to "insert" and change database names to "soft delete tables", then run the string on main database tables.

---say if sql string noted a "delete" in it, then... change delete to, insert and change database names to "soft delete tables", then run the string on main database tables, to delete the given row or rows. 

guessing retrieval "going to recycling bin" and choosing undelete. would be a nightmare to code, but just enough for admin's to be able to go back and retrieve data. or to generate reports from. 

i realize "events" are short cut of above per say and only giving min info, and most likely gives good logging, and high performance, but hhmmsss...

============

other issue, is "order history" going to any given company website, ya purchased from, and going to your orderhistory, and pulling up date of what you purchased. some give very min amount of info, "plain title and cost per item", others give a bit more. i would like to see more. but most likely out of scope of this initial start of this project. 

will each module (resource / activity) need something basic from it?  such as a title and pulling a description from it? guessing most modules have there own dedicated table they store this info in. to pull "order history" xxxx title bought... xxx description of it.

====================

looks like country / state info for time zones to geo_ip, to other. are in txt files. or in a php file vs in a database table in moodle vs opencart and info is in a database table, hhhmssss.... taxes :/ and tax zones...

i suppose a file might be better for security vs database. being able to turn off write access to the file. one less database query, and taxes not calculated a whole lot, exception during checkout. meh... see what happens when it comes time to redo functions and sql statements. if a hacker gained access to db, they have it all anyways. most likely easier to connect to third party software if info was in a database. vs having to make a second function just to call up a file and do a cross reference. 

not finding much of "pre loading" anything in moodle database tables. now that i search for "insert" across all files of moodle. hhhmsss.... why is that? database = stuff that changes, and info that is static, is static long enough it does not matter? and just include it in a version upgrade? so say a file compare utility or diff, will show changes. vs rummaging over database tables trying to find the difference?


=============================

=============================

=============================

=============================

ok.... 

  • opencart2.sql 
    • phpmyadmin export / sql dump of opencart database
    • and then search/replace oc_ to mdl_local_oc_
    • then imported into moodle database
  • install.xml
    • see previous 2 posts. this is result before changing anything...
  • moodle initial install.xml 
    • for reference
  • lisence.txt
    • opencart lisense.txt not sure of sql dump counts or not, but making sure.
  • install.xml.xmldb_editor_errors.txt
    • site admin menu -> developer -> xmldb editor -> local/oc/db -> [load]
    • these are errors i get, that prevent me from clicking on [edit], and fixing the errors directly through xmldb editor. 
    • looks like i have "to long of names" 30 cc limit? i assume cc = character limit?
    • looks like i have some CAPS / camel casing of tables and field names, everything needing to be lower case.
    • looks like i need to check "reserved words" i don't see and error of such from skimming the errors.
In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

site admin menu -> devloper -> xmldv editor -> local/oc/db -> [load]

takes a red pin and crosses out *[load]*

inserts in a bubble beside it. *lets test install.xml file for errors function so you hand code everything vs being able to use [edit]*

sorry, some frustration showing up is all.  the [load] thing does work. to work out the errors!!! it may be extreme basic. but it works!

time to start splitting stuff out into there seperate install.xml files. and getting a generic version.php going for everything. getting closer to getting prep work done. before work begins. WOOT! WOOT! WOOT!

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

been kicking the can around, trying to figure out how to handle "payment gateways" more to the point... PCI DSS compliant.

if you do not store any credit card info, much easier to pass PCI DSS, as soon as you store or any info is obtained on your servers. then PCI DSS compliance goes up rather fast, in how much extra security you need in place.  security not via moodle / commerce thing. but rather physical access to the server, and keeping records, and more to it, keeping things up to date "security wise" hardware, operating system, apache, php, moodle, commerce, etc... 

looking over different payment gateways...

  • some use an IFRAME, 
  • some completely direct customer off your website and onto their website. 
  • some allow you to take info on your website, but never actually stores any info. (cache is disabled)
  • some allow you to store min amount of info, perhaps last 4 digits of credit card number, issueing bank number, billing / shipping address.  (no info for ccv / security number on back of card, or start/expire date, or full credit card number.)
  • some allow full info of credit card to be saved. (within limits of rules / regulations / laws)

======================

re-occurring billing is also an issue.   kinda like gas company, eletrical company, phone company, etc... you get your monthly bill.  these would be re-occuring bills per say.  but going a step further "re-occuring payment",  more likely club fee, or magazine fee, netflix fee, website fee, web server fee.

  • some payment gateways. do not even offer this. 
  • some payment gateways hold all the credit card info on there servers. ((easier PCI / DSS compliant)) 
  • some if you hold data on your own servers. you can auto bill directly through your own server through some payment gateways.

======================

PCI DSS compliance with hardware. (credit card scanners) is a bit different.  and possibly a different "merchant account" can be had, vs using online internet payment gateways. but still same like rules apply about how much credit card info is stored on your own servers.

======================

====================

======================

with above i am trying to figure out a way. of how to describe the payment gateway, for PCI / DSS compliance. when you goto... site admin menu -> plugins -> manage payment gateways,  the table that shows up... (like if you went to filters, auth, enrol, etc...)  looking for some sort of CODE or number system, that i can drop into the table. and then give extra detail through a "help icon" or display info above / below the table. 

bit masks. might work. but i do not really want to flood moodle with a bunch of extra bit masks.  

yes "price" always come into things. of how much X will charge over X.  but thought i might drop in a "warning" sign.  so non tech folks, when they go in and look over payment gateways and choosing something... they see a warning... with thoughts of "HEY, if your non geek, and do not know how to keep things up to date and secure,  this type is bad idea, due to possibly some *evilhacker* hacking of your server, and folks credit card info being stolen, due to credit card info is stored on your server.  vs all credit card info being stored on the payment gateway servers. 

to above, yes a bitmask will most likely be created for "roles / Capabilties" warning of possibly finical info being edited/added/deleted. but above is more of a "warning" and trying to figure out KISS (keep it simply stupid), which may mean, nothing at all. but perhaps maybe a little more?

===========================

green, yellow, red icons?   (go, caution, stop) as in street lights (go, caution, stop) green = no info is saved on your servers, yellow = some info, red = as much info as possibly is saved on your servers. 

meh... gotting ahead of myself...back to the grind stone to getting basic commerce done. 

===========================

===========================

===========================

re-occurring billing / re-occurring payment.

have received a couple messages of folks asking about this... at moment, it is on the "want list" but most likely will wait till "accounting" back end comes around. 

there is a few payment gateways that due support re-occurring billing / payment. but i am most likely going to approach payment gateway plugins. like opencart, zencart, oscommerce, oscmax, etc... and let the plugins dictate how to handle that.  until... accounting back end is done. so that late fees, and like can be done, along with "user accounts" ya go in buy this big expensive course with books. and pay the debt off of the course of so many days/weeks, etc...  or simply sign a contract or paper, and then get a bill Y days later, and need to be paid X days.  this will most likely have bank transfers more coded in. along with re-occurring billing / payment more fully supported.

============================

with above said...  i am looking at... 

www.yoursite.com/moodle/checkout as being a plugin manager. to handle different types of checkout. pay before you get access/item is shipped, re-occurring billing, re-occurring payment, POS (point of sale) cash drawer, POS smartphone, user account, guest checkout, create account before purchasing, etc...


www.yoursite.com/moodle/ordertot = plugin manager to handle "receipt notations" vouchers, discounts, shipping costs, tax, sub total, overall total, group discount, etc....

www.yoursite.com/moodle/paygate = plugin manager for payment gateways (paypal, twocheckout, skrill, *brain going blank from all of them*)

www.yoursite.com/moodle/prodinfo = plugin manager for (stock levels, SKU numbers, tags, etc...)

www.yousite.com/moodle/shipping = plugin manager for usps, ups, dhl, fedex, freight, flat rate, etc... shipping plugins.

www.yoursite.com/moodle/storeinfo = plugin manager = different physical store locations / different shipping locations, were to pickup (class room 2A, other school front office, etc...) store name, address, contact info.

www.yoursite.com/moodle/block/cart = shopping cart block.  also doubles for inserting menu items into user menu, possibly navigation menu

www.yoursite.com/moodle/block/wishlist = wishlist block. 

..............

www.yoursite.com/moodle/garbage crud = stuff i been sorting around and still have not gotten to and/or will not port over to moodle.

............

i am unsure were to place, "orders / sales / returns",  they are reports, but they are not, due to add/edit/delete of orders/sales, (updating payment (say from check cleared, to has shipped, has tracking number,etc..), to dealing with return from single item out of entire bunch of stuff that was bought and like. along maybe needing manager approval before something is returned.

thinking about going with....

www.yoursite.com/moodle/pos/ = point of sale manager.  and for now...  www.yousite.com/moodle/pos/webpos to handle basic (orders, sales, returns),  and then latter doing pos/smartphone,  or pos/cashdrawer or like. 

---errr  www.yousite.com/moodle/checkout  handles most of that... is POS more of "employeed staff" screens? or rather front end for them? do i need to move... checkout from root folder, to pos/checkout folder. and treat web checking out, more as a selfweb (self website checkout), kinda like self checkout counters at various stores, checking out online, is just that self checkout in a sense, but stuff is shipped to you.

thinking about it more... creating a few functions. might prove better long run. going with the  www.yoursite.com/moodle/pos  and then dropping in returns.php, sales.php, orders.php and like files into the "pos" folder...or perhaps www.yoursite.com/moodle/pos/manager/returns.php, orders.php, etc..

hhmmmsss seems i am still confused. of what to do about this...

===============

returns, orders, sales... what about a course format for each one? or a module (resource / activity?)  for each type?  setup a course and only enrol X folks into it... upgrade role from student to teacher, for more functionality... rename roles if wanted form student to cashier,  teacher cashier/returns,  or some such...  setup groups if wanted. each person there own group... and a different cash drawer. or different location. a different activity for "out on businesses trip at some conference, and selling a few goods with cell phone or with laptop. 

===============

taking a break and coming back to it for checkout and/or pos.. still no good. i guess sleep on it for another night... and work on getting the other plugin managers going.  was hoping to see about getting a github going tommorw, but that may be held off.

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

MDL-48712 tracker for commerce... a commerce package for moodle.

https://github.com/boggen/commerce_for_moodle

adding github finally. simple copy/paste and search and replace, and search and rename has been done. no actual functions / classes coded. at moment just showing off the "plugin managers"  located in site admin menu -> plugins.  (they are not finished out, just roughing out location of plugin managers for commerce, "prep work").

==============

to see plugin managers, it requires a full fresh install of above. it will be assume that edit of core files of moodle will be need to happen before it is all over with

==============

next on TODO list. is roughing out area for 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

www.yourite.com/moodle/availability/condition/purchase

  • not able to "copy/paste and then search/replace" it would seem, to create a place holder and still have functionality still there. something is happening within the javascript side. and causing a <textarea> to show up that is blank vs having buttons to add restrictions :/ 

going through the conditions that come with moodle along with....

it would seem there is a bit more to the javascript / YUI  that is going on. resulting in the javascript to not to work. going to leave this hanging for now.  needing to get class/functions written, before getting to this any how.

====================

additional print screens in roughing things out within moodle. of were to add "product information, and store information" to sell categiories, courses, and activities / resources.  ((see above note about not displaying activities/resources better))

EDIT: moodle.org was reducing pictures to an un-readable size. result. removed pictures and placed them into zip files.


In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

address book....

multi language errr multi country functionality.... every country is different in format of the address.  some countries / government bodies have different way of describing things, but in a different order.  some things are required in one country, but is not required in another. 

other words... i simply can not hard code the following text fields / drop down menus...

  • first name
  • last name
  • street address 1
  • street address 2
  • street address 3
  • street address 4
  • city
  • state
  • zip
  • country

due to another country may have the following order of how information is displayed on there envelops / packaging slips.

  • street address 1
  • first name
  • last name
  • street address 2
  • zip code
  • country 
  • building code

opencart does have "address format" that is assigned to various countries but skimming over the entries per country, not many are filled out. only a hand full if that. 

=======================

another issue.... a person could have multi addresses assigned to them... 

  • kid/user signed in, but using mom's credit card name/billing address
  • kid/user signed in, but using dad's credit card name/billing address
  • physical address of were they live
  • physical address of were they live every other week (parents divorce'd or some such)
  • items were shipped to another location
  • -----------------
  • other types of addresses
  • -----------------
  • manufacture address (billing)
  • manufacture address (there shipping department)
  • manufacture address (there shipping department in another warehouse)
  • store locations (class room 101A, classroom 204B, etc...)
  • store locations (store has multi brick/mortar locations errr physical store fronts in different cities)
  • anti fraud... (when user types in there address, info is sent to an anti fraud online service, and anti fraud sends an address back either corrected (captial letters or like), or re-word for correct street name.  and needing to capture that address. so who ever is printing out package slips or manager, could click and double check what to do...

===============

i was wanting to assign a "type" to address information...  beyond user id, such as billing, shipping,store,parent, anti fraud. etc... so the same address book (code and database tables) could be used. over and over again. 

  • some addresses may never be assigned to an actual "user id" 
  • some types should never show up to "actual user"
  • some should never show up in certain places.  "some block within moodle, de-noting other store locations"  example enter your zip code, to find nearby stores.  another block, for sorting out parents to child.  another block/report for sorting out multi shipping (person ordered multi things in same order but shipped to different locations, using different shipping companies)

=================

*rubs chin* looks like another simple database table. "type" = text input,  would suffice and then using the "number" from drop down menu that it builds... and assign it to one of the fields in the addressbook table.  

hhhmsss.... address formats for multi countries...  

  • field required, and 
  • sort order (displaying to user as they input information, and
  • if displayed or not... 
  • and what line information is displayed on the shipping label. and...
  • if all CAPS is required or if "camel case" is needed (capitalizing first letter of each word)

===============

need to look into moodle "user profile code" more. to see if i can create empty usernames, first/last names, email address, etc... so certain information that can be inputted in a user profile, and then could be tied into an address book entry, so as to reduce duplication of information. **doh** create a "dummy" authentication type.  

  • authentication type "dummy manufacture", 
  • authentication type "dummy store location"
  • authentication type "dummy parents address"
  • authentication type "dummy etc..."
  • this would allow "user creation!" and more to the point "user profile information"!! 

ok... so how do i take advantage of doing something like above?  

other words user profiles can easily be made into "address book" add a few extra fields... and then create a bunch of additional user profiles... for different address book types... but how would that impact moodle... do i really want jane doe, showing up 2 to 20 plus times... when going to assign jane doe to a given role type or enroling them into a course? do i want to edit a bunch of core code... and defining a specific user type / authentication type, so as to limit what is shown?

=============================

taking a different approach.... creating a couple functions... that "create" additional profile fields every time an addtional address was needed..  for user profile fields. meh.. that would grow the custom_field and custom_field description, custom_field_type tables out of proportion....

=============================

an ideal situation would be... taking... site admin menu -> plugins -> *pick a plugin* -> plugin manager (page) were there is a "table across top of that page. and then some options to edit/delete, a row in table. and a button to add another row to the table.   but putting this into a 'user profile page'. and a few other locations.  with some hard coding of "address type" pending on were things are listed / were information is entered.  

i think i am still going to need to create "dummy authentication plugin type and/or types" so as to create dummy accounts. meh.. still do not like idea of dummy authentication plugin.

simply creating a "manual" account. and then create a "role" say "store" or "manufacture", or "billing address" meh... still do not like that.. either. would need to find every piece of code that pulls a list of users... and "define" a type. so information is not displayed. errr i suppose setting field to "hidden".... and/or profile to hidden?  meh "hide email address from everyone" and not hide profile from everyone option...

=============================

KISS (keep it simply stupid),  removing user profiles from equation. hard code some "types" for addressbook type entries... but still use a database table for types.  so additional types can be added. but just hard code what types can display were and how in various locations. if something needs to pulls data from a user profile, then will leave it at developer in how to create a user / user profile. and/or create an addition field for the address book.  assumption some information may get duplicated. between user profiles, and addressbook. 

=============================

time to go searching on google. hopefully google will return some better results for me now. and decide to stay with opencart addressbook, or go with another software, and porting it over to moodle. 

In reply to ryan sanders

Re: open source e-commerce for moodle

by ryan sanders -

that search ended quickly, and staying with opencart setup... for address book. but adding a "type" into the mix. it should be easy enough for folks in other countries to adjust mail format... if i hold to opencart and how it currently handles address formats. 

http://www.columbia.edu/~fdc/postal/#oz

http://en.wikipedia.org/wiki/Address_%28geography%29#Mailing%5Faddress%5Fformat%5Fby%5Fcountry


some issues, i have not seen brought up. beyond the crazy amount of address formats. 

if in united states, i put in my return address,  then put in a send to address to france...  i am not seeing a "double" sent to address one for originating country (so locals in that country can read address), but also, a second send to address, so locals in other country can read the address. i could see issue of someone not knowing other language... and not knowing how or what to do with a given send to address.

just simple looking at information i can find... it would not surprise me, to start seeing GPS coordinates start showing up as a universal standard across the world for shipping to/from physical addresses/locations for international shipping of items. leaving it up to local delivery companies to figure things out from there...

========================

i guess i will just drop addressbook into... www.yoursite.com/moodle/address

looking at...

below is from.. https://docs.moodle.org/dev/Plugin_types

User profile fieldsprofilefield/user/profile/fieldAdd new types of data to user profiles

and looking at code in www.yoursite.com/user/*  


it looks like i would need to do near a full copy of the user folder (files and sub folders) to address folder.  to keep it KISS (keep it simply stupid)  duplication of a lot of functions.. and doing a search and replace on them... 


In reply to ryan sanders

Re: open source e-commerce for moodle

by Brian Ellis -

I tried to read through everything but for all of this wouldn't it have just been easier to integrate Woocommerce and Moodle. Took 30min for two fresh installs and 20hrs total dev time for a site with over 300 scorm files. SSO and auto-enrolment were done at the start of the build.