Bloody hell Bruce, what's going on, you guys are releasing features and you've already thought about what's required. Outrageous behaviour .
Announcement
Collapse
No announcement yet.
Don't like new Real Time Stock value
Collapse
X
-
We did have some internal debate on how many options should be provided.
In the end, we settled on the fairly straight-forward way it now works. The effort went into making the whole thing run as fast as possible. After all and as discussed above, with JS and variables you can achieve pretty much every effect that you want to.
It's worth re-inforcing Bruce's points and adding a little more:
- stock checking at the web site is true real time. It doesn't require a synchronisation with the desktop to decrement the available stock.
- the synchronisation between web site and desktop achieves synchronisation across channels i.e. MOTO and EPOS. Also, a side effect is that you get continuous auto-download of orders
- the stock level is checked dynamically every time a page is displayed, including otherwise static HTML pages
As far as I'm aware this makes Actinic the only out-of-the-box ecommerce product that synchronises stock across ecommerce, MOTO and EPOS. If the connection breaks it will self recover as soon as the connection is available again.
Chris
Comment
-
Bruce, Chris et al. Without seeming to back-pedal... It's a great new feature. As Chris said, it is simple. My reservation is just about the figures shown online.
Originally posted by olderscot View PostI'm not sure what you think the problem is.I'm thinking that people are going to be expecting to be able to order 15 items. Then when they do, with next day delivery you're going to look like a tit when you have to phone and tell them you've actually only got five on the shelf.
Originally posted by olderscot View PostSome retailers have no stock and might use a drop shipper to supply the goods. Others might have a 20 items in stock but know their local distributor has 200 they can drop off in the afternoon if needed.In which case, they're unlikely to bother with an accurate stock indicator unless it's one provided by their shipper and includes the information on their actinic page as it loads from the suppliers website.
Originally posted by olderscot View PostIf someone wants to track stock in RT but not disable ordering, then if they use -100 for the stock suspend level, all they have to do is adjust the stock message javascript for the extra 100 that's been added to the total.Great idea!
Backordering just needs to work based on the value entered in stock suspend level on each product. This can already be set globally of course.
In an ideal world this is how I would see stock control working.
Stocklevel shown online is accurate and is the actual number of items sat on the shelf ready to go.
Option to display "n in stock" or just "in stock" as currently offered.
It would be good to have the option to display "more than n in stock" where n could be set globally e.g. n=10. John Lewis do this and ebay have started too. It's a good way to stop competitors figuring out your stock profile.
If stocklevel was 0 and stocksuspendlevel is set as a value < 0, the stock indicator would say available in n days, where n is a value e.g. "1-2 days" chosen at the product from a list type variable. I expect uploading this information would be undesirable with the current perl setup and slow everything down. But it would be something to consider when actinic eventually php-ups the checkout.
A stock indicator either graphic or numerical would be included in the basket.
The actual stocklevel at the time of ordering would be downloaded and saved with each orderline. In the cases where the full stock quantity is not available, e.g. 2 in stock, 4 ordered and stocksuspend set to -6 actinic would prompt to automatically create a backorder for 2. Crucially, the customer would know from the checkout indicator that the full quantity was not immediately available.
Alternatively, the backorder could be setup in the basket as a separate (and deletable) orderline and be marked as a backorder. This would make it very obvious for the customer. Then when the order is downloaded the backorder is created automatically on the desktop using the existing backorder feature. If the backorder were setup in the basket, the shipping could also be addressed. Options such as:
Ship when order complete
Ship backorders when available (additional shipping applies)
Ship backorders with next order
Comment
-
Originally posted by olderscot View PostI suspect this can all be done in the current implementation.
- javascript can be used to display the message and adjust the stock quantity displayed.
- Different layouts can be used for when this is wanted / not wanted.
- A user variable can be used to define whather the messages says '2-3 days', '1-2 weeks', etc.
Mike
When stock reaches the lower limit (in this case -999) the perl scripts reject the order when it is added to the cart.
For a demo take a look here http://actinic-beta.toddesigns.co.uk...g/Cameras.html, the real stock level is currently -2 and the lower limit on all items is set to -999 .
Now all I need to do is pass the lower limit into the script to make it more adaptable.
Comment
-
Here is the javascript to deal with the suspend level being negative. This script adjusts the displayed value to remove the extra stock added by actinic.
Assumptions
All stock has the same negative stock level in this case -999
Code:/*********************************************************************** * * getSectionStockSuspend - Call our server script to determine the real time stock * levels of the products in the given section * When the page is previewed from the desktop (within EC) we do not want to make * server calls for RTS levels. Therefore in this case we are passing in the * list of stock monitored products and their offline stock level in sProdRefs and * sStockList parameters. * * Input: sURL - the ajax script URL to call * sSID - the section ID list to be passed in to the ajax script * sProdRefs - list of the products with stock monitoring on in this section * sStockList - the stock level of the products in the list above * sSuspendLevel - current suspend offset of the products in the list * * Actinic handle negative suspend levels by adding them to the stock level * this code removes the compensation from the displayed value. In order to handle * multiple negative suspend values, this code accepts an array of suspend levels. * * The suspend levels always come from the page not from the server. * ************************************************************************/ function getSectionStockSuspend(sURL, sSID, sProdRefs, sStockList, sSuspendLevel) { var mapStockByRef = {}; var mapStockByLevel = sSuspendLevel; // // In case of preview use passed in data // if (sURL.indexOf("file://") == 0) { var arrProds = sProdRefs.split("|"); var arrStock = sStockList.split("|"); for (var i = 0; i < arrProds.length; i++) { var aRef = arrProds[i].split("!"); var sKey = aRef[aRef.length - 1]; mapStockByRef[sKey] = arrStock[i]; } updateStockDisplayLevel(mapStockByRef,mapStockByLevel); } else { var ajaxRequest = new ajaxObject(sURL); ajaxRequest.callback = function (responseText) { mapStockByRef = responseText.parseJSON(); updateStockDisplayLevel(mapStockByRef,mapStockByLevel); } ajaxRequest.update("ACTION=GETSECTIONSTOCK&SID="+sSID, "GET"); } } /*********************************************************************** * * updateStockDisplayLevel - dynamically update the DOM tree depending on stock levels * * Input: mapStockByRef - product ref to stock level map * mapStockByLevel - offeset to compensate for suspend setting * ************************************************************************/ function updateStockDisplayLevel(mapStockByRef,mapStockByLevel) { // // For each product reference set the stock level and enable/disable // the controlling DIV tags in the page source // var arrStockElems= getStockNodes(); for (var nIndex = 0; nIndex < arrStockElems.length; nIndex++) { var aRef = arrStockElems[nIndex].id.split("_"); var sProdRef = aRef[aRef.length - 1]; var sIDStart = arrStockElems[nIndex].id.substring(0, arrStockElems[nIndex].id.length - sProdRef.length - 1); if (mapStockByRef[sProdRef] != null) { // single value passed from web page. var iStockLevel = mapStockByRef[sProdRef] - mapStockByLevel; // // The stock level // if (sIDStart == 'StockLevel') { if ( iStockLevel <= 0) { iStockLevel = 0; } arrStockElems[nIndex].innerHTML = iStockLevel; } // // Out of stock // if (sIDStart == 'EnableIfOutOfStock') { if (iStockLevel <= 0) { arrStockElems[nIndex].style.visibility = "visible"; arrStockElems[nIndex].style.display = "inline"; } else { arrStockElems[nIndex].style.visibility = "hidden"; arrStockElems[nIndex].style.display = "none"; } } if (sIDStart == 'RemoveIfOutOfStock') { if (iStockLevel <= 0) { arrStockElems[nIndex].innerHTML = ""; } } // // In stock // if (sIDStart == 'EnableIfInStock') { if (iStockLevel > 0) { arrStockElems[nIndex].style.visibility = "visible"; arrStockElems[nIndex].style.display = "inline"; } else { arrStockElems[nIndex].style.visibility = "hidden"; arrStockElems[nIndex].style.display = "none"; } } if (sIDStart == 'RemoveIfInStock') { if (iStockLevel > 0) { arrStockElems[nIndex].innerHTML = ""; } } // // Generic flag to indicate ajax call went fine // if (sIDStart == 'EnableIfStockOk') { arrStockElems[nIndex].style.visibility = "visible"; arrStockElems[nIndex].style.display = "inline"; } } } }
To use the new functions change the code in the 'Display Stock Quantities' layout or generate a new layout.
Code:<actinic:block if="%3cactinic%3avariable%20name%3d%22RealTimeStockEnabled%22%20%2f%3e%20%26%26%20%3cactinic%3avariable%20name%3d%22DisplayRealStockLevel%22%20%2f%3e" > <span id="RemoveIfOutOfStock_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" > <span id="EnableIfStockOk_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" style="visibility: hidden; display: none;"> <span id="StockLevel_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" style="display: inline;"></span> in stock. </span> </span> <span id="EnableIfOutOfStock_<actinic:variable name="ProductReference" selectable="false" />" class="ActinicRTS" style="visibility: hidden; display: none;"> <strong><span class="actrequired"><br /><Actinic:Variable Name="OutOfStock"/></span></strong> </span> </actinic:block>
Code:<script language="javascript" type="text/javascript"> function displayStock() { var sProdRefs = ""; var sStockList = ""; var sSuspendLevel = "1000"; <actinic:block if="%3cactinic%3avariable%20name%3d%22IsPreviewMode%22%20%2f%3e" > sProdRefs = "<actinic:variable name="RTSProductsInThisSection" selectable="false" />"; sStockList = "<actinic:variable name="RTSStocksInThisSection" selectable="false" />"; </actinic:block> getSectionStockSuspend('<actinic:variable name="StockScriptCGIURL" selectable="false" />', '<actinic:variable name="SectionID" selectable="false" />', sProdRefs, sStockList,sSuspendLevel); } AttachEvent(window, "load", displayStock); </script>
I did it this way as it is possible to generate a complete list of all stock suspend levels automatically and pass them as an array from the html page itno the javascript. If anyone wants to use variable suspend levels then it can be done.
Finally to stop the button being disabled when stock goes below zero (real stock) I went into the 'Add to Cart Button With Cart Icon' Layout and changed the span id from 'RemoveIfOutOfStock_..' to 'DoNotRemoveIfOutOfStock_..'
The web site in the previous post is still live and you can make changes to the stock by running a purchase, it uses 'invoice with order' so no money changes hands , but the stock levels change.
Comment
Comment