Stock Integration Project.
Our website software is CS CART, PHP and SMARTY based coding.
Project Overview:
Our website current displays stock levels in DUBLIN (our own stock levels controlled by CS CART as normal), stock levels in BARCELONA (via WSDL call) on the product page. A new supplier now provides an API for stock levels of products held in Holland which can be displayed on our own website product pages.
Current Situation:
Stock levels in Dublin and BARCELONA are already displayed on our product pages and examples can be seen below.
https://marineparts.ie/yanmar-6ly2-a-st-p-utp-seawater-pump-119574-42502-replacement/
https://marineparts.ie/rec703-48230-14/
How it Currently Works:The stock display on a product page will ALWAYS show the stock levels in our store as DUBLIN STOCK. These stock levels are controlled by the normal quantity control via the CS CART administration panel.IF the product being viewed is supplied by our Spanish supplier then it will call for the SUPPLIER stock level and display as stock in BARCELONA WAREHOUSE.IF the product being viewed is NOT supplied by our Spanish supplier then there will be NO stock level displayed for BARCELONA.
Project Requirement:To integrate the stock levels from our new supplier in Holland into the same stock display. The supplier has provided the API documentation, and this is provided as part of the project information. The suppliers in BARCELONA and HOLLAND will NEVER supplier the same product. This project must provide the ability to do the following:1 – Take the part number from our website2 – Check to see if the part number is provided by the new supplier in Holland3 – IF NOT, then stop4 – IF YES, then the current stock level from the supplier is to be returned and displayed on the product page.
Conditions:The supplier product code is always 8 digits in length. It can start with a zero, a double zero or no zero.Example001234560123456712345678
Our own website prefixes the product code with L.ExampleL00123456L01234567L12345678
The request from our website will need to drop the L, keep any leading zeros, and return the answer with the L prefix again. Example
L00123456Script will check to see if the product code exists with our supplier as 00123456IF YES, the script will return the answer to the website for part number L00123456
Below are some screenshots to show visual examples
NO ACTION REQUIRED FOR PROJECT
1 – Only Stock in Dublin (controlled by CS CART normal quantity levels)
Note only one stock level is showing
2 – Stock in Ireland and also from Barcelona Supplier
Note that two stock levels are now showing
ACTION REQUIRED FROM THE PROJECT
Note that the stock level from Holland is now showing
The stock level for Holland is what is required from this project. API documentation is provided.
For the Barcelona stock levels the affected CS CART templates are:
public_html/design/themes/vivashop/templates/common/product_data.tpl
The stock box disaplyed on the product page is controlled by code contained within
public_html/design/themes/vivashop/templates/blocks/product_templates/default_template.tplThe stock box is inserted onto the product pages by the code contained within
Success story sharing