Looking for an interesting project; look no further!
The problem - our commerce store sells a lot of product and we often hit zero stock levels. We have a back-ordering system - The main issue is that manufacturers rarely provide stock levels upon request.
What I envision is adding some additional product attributes "Stock Track Enabled (yes/no)", "Stock URL", "Search 1", "Search 2", "End String", "Available Backorder QTY". From there the program will do this:
- cycle through each SKU with "Stock Track Enabled"
- download the URL HTML page
- inspect HTML and retrieve product availability data
- display a result report that allows user to see failures
- user can select checkboxes for which items will be updated (select all option available)
- user clicks a button and the "Available Backorder QTY" attribute is updated for selected products
Product SKU = ABCD1234
URL = http://au.mouser.com/ProductDetail/Maxim-Integrated-Products/MAX232ACSE+/?qs=sGAEpiMZZMvbyeSUH4qH%2fD3ugxyWmRKX
(go ahead and view the page .. inspect the html and see the attached document that has HTML search strings)
Search String 1 = 'see attachment' ... this search sets the start point for the next search to eliminate duplicated HTML data
Search String 2 = 'see attachment'
End String = 'see attachment'
Available Backorder QTY = the value between "Search String 2" and "End String" converted to whole number (no commas etc)
At the time of writing the result would be 3142
If something goes wrong the report needs to detail the failure (unable to find string, invalid value detected etc). The user can see this and deselect the failed item, click the update button and all of the selected items will be updated.
Admin panel needs to have the following functions:
- Enabled/disable cron
- Define cron interval (X days)
- Automated run success contact (select Magento default contact)
- Automated run failure contact (select Magento default contact)
- Manual run button
- Display a report post manual run which shows failures; and allows user to select/deselect SKUs to update
- SKU field in the report needs to be hyper-linked to the admin product view page
- Needs to be an "installable" magento extension that adds the additional product attributes to the default attribute set
- Needs to have tidy resources (removes old data, reports, etc)