Announcement

Collapse
No announcement yet.

Out of Stock message problems.. please help! :[

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Out of Stock message problems.. please help! :[

    I think it is easier first showing you what the problem is http://www.bossecomputers.co.uk/acat...o_ACE_712.html ,
    if you press F5 you will notice the msg goes from in stock then gets the stock level from the server and changes it to out of stock and disables the add to cart button??

    I used the "JavaScriptFunctions" and "Javascript Section Stock Query" that I read from the forum (I think) to determine the stock level. I wonder how i can fix this problem so it only shows out of stock and with add to cart disabled as soon as i'm into the product page. Attached is full layout code for my "Includes Add to Cart Button" layout

    Any help / solutions / direction appreciated! Billion thanks!!!

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
       <title><actinic:variable name="PageTitle" /></title>
    
       <actinic:variable name="BaseHref" />
    
    	<actinic:variable name="MetaTags" />
    
       <actinic:block if="%3cactinic%3avariable%20name%3d%22IsP3PPolicyUsed%22%20%2f%3e"><link rel="P3Pv1" href="<actinic:variable name="P3PFullPolicyLink" />"></actinic:block>
    
       <link href="actinic.css" rel="stylesheet" type="text/css">
    
       <style type="text/css">
    	body {
    		background-color: <actinic:variable name="Palette3" />;
    	}
       </style>
    
    	<actinic:variable name="JavaScriptFunctions" />
    	<actinic:variable name="JavascriptSectionStockQuery" value="Javascript Section Stock Query" />
    	
    <script language="JavaScript1.3" type="text/javascript" src="tabbeddescriptions.js"></script>
    <link rel="stylesheet" type="text/css" href="<actinic:variable name="TabberStyle" />" />
    
    </head>
    
    <body onload="<actinic:variable name="OnLoadScript" value="PreloadImages" />">
    
    <div id="silver-shadow-left">
    <div id="silver-shadow-right">
    <div id="silver-container">
    
    <div id="silver-header">
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Brochure%22">
    			<actinic:variable name="BrochureLogoImage" />
    		</actinic:block>
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%21%3d%20%22Brochure%22">
    			<actinic:variable name="CompanyLogoImage" />
    		</actinic:block>
    		<div id="silver-login-terms">
    			<p><Actinic:NOTINB2B><a href="<actinic:variable name="LoginPageURL" />"><actinic:variable name="LoginText" /></a>&nbsp;|&nbsp;</Actinic:NOTINB2B><a href="<actinic:variable name="SendMailPageLink" />"><actinic:variable name="SendMailText" /></a></p>
    		</div>
    		<div id="silver-cart-checkout">
    			<p><a href="<actinic:variable name="CartLinkText" />" class="silver-cart-link"><actinic:variable name="CartText" /></a>&nbsp;|&nbsp;<a href="<actinic:variable name="OrderLinkText" />"><actinic:variable name="CheckOutText" /></a>&nbsp;|&nbsp;<actinic:variable name="ShoppingCartSummary" value="Shopping Cart Summary In A Line" /></p>
    		</div>       
    </div>
    
    <div id="silver-nav-bar">
    		<div id="silver-quick-search-container">
    		<div id="silver-quick-search">
    		<div id="silver-quick-search-field">
    			<form name="simplesearch" method="get" action="<actinic:variable name="OnlineScriptURL" value="Search Script URL" />">
    			<input class="silver-search-field" name="SS" type="text" value="Search the Site" onfocus="this.value='';"/><input class="silver-search-button" type="image" name="ACTION" src="silver-search-button.gif" />
    			<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
    			<!-- Hidden field when in trial mode -->
    			<input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
    			</actinic:block>
    			<input type="hidden" name="page" value="search" />
             <input type="hidden" name="PR" value="-1" />
             <input type="hidden" name="TB" value="A" />
    			</form>
    		</div>
    		</div>
    		</div>
    		<div id="silver-nav-bar-left">
    			<ul>
    				<li><actinic:variable name="NavigationIcon" value="Home Basic Link" /></li>
    				<li><actinic:variable name="NavigationIcon" value="Enter Shop Basic Link" /></li>
    				<actinic:block if="%3cactinic%3avariable%20name%3d%22PageType%22%20%2f%3e%20%3d%3d%20%22Section%22" >
    				<actinic:block if="%3cactinic%3avariable%20name%3d%22SectionLevel%22%20%2f%3e%20%3e%200" >
    					<li><actinic:variable name="NavigationIcon" value="Up A Level Basic Link" /></li>
    			   </actinic:block>
    				</actinic:block>
    				<li><actinic:variable name="NavigationIcon" value="Terms Basic Link" /></li>
    				<li><actinic:variable name="NavigationIcon" value="Search Basic Link" /></li>
    				<li><actinic:variable name="NavigationIcon" value="Contact Us Basic Link" /></li>
    				<li><actinic:variable value="Sitemap Basic Link" name="NavigationIcon" /></li>
    			</ul>
    		</div>
    </div>
    
    <div id="silver-main">
    	<div id="silver-sidebar-left">
    
    		<div class="silver-sidebar-list">
    		<div class="silver-sidebar-list-bottom">
    		<div class="silver-sidebar-list-top" id="silver-section-list">
    			<h1>Product Sections</h1>
    			<ul>
    			<actinic:block type="TopLevelSectionList" ><li><a href="<actinic:variable name="SectionPageName"/>"><actinic:variable name='SectionName'/></a></li></actinic:block></ul>
    			<div style="clear: both;"><img src="theme_shim.gif" height="1" alt="spacer"/></div>
    		</div>
    		</div>
    		</div>
    
    		<div class="silver-sidebar-list-separator"><img src="theme_shim.gif" height="10" alt="spacer"/></div>
    
    		<div class="silver-sidebar-list">
    		<div class="silver-sidebar-list-bottom">
    		<div class="silver-sidebar-list-top" id="silver-brochure-list">
    			<h1>Store Information</h1>
    			<ul>
    			<actinic:block type="BrochurePagesList" ><li><actinic:variable name="BrochurePageLink" value="Simple Brochure Page Link" /></li></actinic:block></ul>
    			<div style="clear: both;"><img src="theme_shim.gif" height="1" alt="spacer"/></div>
    		</div>
    		</div>
    		</div>
    
    		<div class="silver-sidebar-list-separator"><img src="theme_shim.gif" height="10" alt="spacer"/></div>
    
    		<actinic:variable name="NewProductListSidebar" value="Silver New Products List" />        
    
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22CaptureCoupon%22%20%2f%3e">
    		<div style="padding-bottom: 10px;">
    		<actinic:variable value="Sidebar Coupon Field" name="CouponEntryField" if="%3cactinic%3avariable%20name%3d%22CaptureCoupon%22%20%2f%3e" />
    		</div>
    		</actinic:block>
    
    	</div>
    	
    	<div id="silver-bulk">
    	<div id="silver-bulk-bottom">
    	<div id="silver-bulk-top">
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22IsNotPreviewMode%22%20%2f%3e" >
    		<!-- When logged in, this gives the company name, username and a login link -->
    		<actinic:variable name="NowServing" /><actinic:variable name="CurrentAccount" /><actinic:variable name="LogoutSimple" />
    		</actinic:block>
    
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22HeaderText%22%20%2f%3e%20%21%3d%20%22%22"><div style="text-align: center;"><actinic:variable name="HeaderFooter" value="Header Text" /></div></actinic:block>
    
          <form method="post" action="<actinic:variable name="OnlineScriptURL" value="Shopping Cart Script URL" />"> 
             <input type="hidden" name="SID" value="<Actinic:Variable Name="SectionID"/>" />
             <input type="hidden" name="PAGE" value="PRODUCT" />           
             <input type="hidden" name="PAGEFILENAME" value="<actinic:variable name="SectionPageName" />" />
             <Actinic:SECTION BLOB='<Actinic:Variable Name="SectionCatFile"/>'/>
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">
                <!-- Hidden field when in trial mode -->
                <input type="hidden" name="SHOP" value="<Actinic:Variable Name="HiddenFields"/>" />
             </actinic:block>
    
    <table width="100%" cellspacing="0" cellpadding="10" border="0">
    <tr>         
    <td width="50%" align="left" valign="top">
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsExtendedImageSpecified%22%20%2f%3e">
                <actinic:variable name="ExtendedInformationImage" />
             </actinic:block>
    
    </td>
    <td width="50%" align="left" valign="top">
    	       <a name="<Actinic:Variable Name="EncodedProductAnchor"/>">
             <b><Actinic:Variable Name="ProductName"/></b></a>
    			</actinic:block>
             
             <br/><b>Ref:</b> <actinic:variable name="ProductReference" /> <br/>
    
                <a href="<Actinic:Variable Name="ProductLinkInfo"/>">
                   <Actinic:Variable Name="ProductLinkText"/>
                </a>
             </actinic:block>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCustomerMessageUsed%22%20%2f%3e">
                <br />
                <Actinic:PRICE_EXPLANATION PROD_REF="<actinic:variable Name="ProductID" />" COMPONENTID=-1><Actinic:Variable Name="RetailCustomerMessage"/></Actinic:PRICE_EXPLANATION>
             </actinic:block>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22PriceIsEnabled%22%20%2f%3e">
    				<b>
    				<Actinic:PRICES PROD_REF="<actinic:variable Name="ProductID" />" RETAIL_PRICE_PROMPT="<Actinic:Variable Name="ProductPriceDescription"/>">
    
                </Actinic:PRICES>
                </b>
             </actinic:block>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22DiscountDescriptionIsShownForProducts%22%20%2f%3e">      
                <br /><actinic:variable name="DiscountList" value="Standard Discount List" />
             </actinic:block>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOtherInfoPromptShown%22%20%2f%3e">
                <br />
                <span class="actrequired"><Actinic:Variable Name="OtherInfoPrompt"/></span><br />
                <input type="text" name="O_<Actinic:Variable Name="ProductID"/>" size="40" maxlength="1000" value="" />
             </actinic:block>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsDatePromptShown%22%20%2f%3e">
                <br />
                <span class="actrequired"><actinic:variable name="DatePrompt"/></span><br />
                <actinic:variable name="DayList" /><actinic:variable name="MonthList" /><actinic:variable name="YearList" />
             </actinic:block>
             
             <actinic:variable name="AttributeList" />
             <actinic:variable name="ComponentList" />
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsQuantityPromptShown%22%20%2f%3e">
                <br />
                <span class="actrequired"><Actinic:Variable Name="QuantityPrompt"/></span>
                &nbsp;
                <input type="text" name="Q_<Actinic:Variable Name="ProductID"/>" size="4" value="<Actinic:Variable Name="DefaultQuantity"/>" />
             </actinic:block>
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsQuantityPromptHidden%22%20%2f%3e">
                <input type="hidden" name="Q_<actinic:variable Name="ProductID"/>"  value="<actinic:variable name="DefaultQuantity"/>" />
             </actinic:block>
    
             <br /><actinic:variable name="CartError" />
    			<br /><actinic:variable name="RealTimeStockDisplay" /><br />
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e">
                <br /><actinic:variable name="AddToCartButton" />
             </actinic:block>
    	
    </td>
    </tr>
    </table>
    
             <actinic:variable name="TabbedDescription" value="TabbedExtendedInfoText" />
    			</td>
    			</tr>
             
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsOutOfStockShown%22%20%2f%3e">
                <br /><br /><strong><span class="actrequired"><br /><Actinic:Variable Name="OutOfStock"/></span></strong>
             </actinic:block>
    
             <actinic:block if="%3cactinic%3avariable%20name%3d%22IsCatalogSuspendedShown%22%20%2f%3e">
                <br /><br /><strong><span class="actrequired"><Actinic:Variable Name="CatalogSuspended"/></span></strong>
             </actinic:block>
             
             <actinic:variable name="ProductAlsoBoughtList" />
             
             <actinic:variable name="ProductRelatedProductsList" />
    
    			<actinic:block if="%28%28%3cactinic%3avariable%20name%3d%22RecentlyViewedListIsEnabled%22%20%2f%3e%20%3d%3d%20True%29%20AND%20%28%3cactinic%3avariable%20name%3d%22AddRecentFromExtInfoIsEnabled%22%20%2f%3e%20%3d%3d%20True%29%29" >
    				<actinic:variable name="SaveRecentProducts" />
    			</actinic:block>
          </td>
       </tr>
    </table>
    
          </form>
             <actinic:block if="%3cactinic%3avariable%20name%3d%22RecentlyViewedListIsEnabled%22%20%2f%3e%20%3d%3d%20True" >
                  <actinic:variable name="RecentProducts" />
             </actinic:block>
             
             <actinic:variable name="FeefoSiteLogo" />
             
             <actinic:variable name="FeefoSiteFeedback" />
    
    		<actinic:block if="%3cactinic%3avariable%20name%3d%22FooterText%22%20%2f%3e%20%21%3d%20%22%22" ><div style="text-align: center;"><actinic:variable name="HeaderFooter" value="Footer Text" /></div></actinic:block>
    
    		<actinic:variable name="ReferrerLink" />
    	</div>
    	</div>
    	</div>
    
    	<div style="clear: both;"><img src="theme_shim.gif" height="1" alt="spacer"/></div>
    
    </div>
    
    <div id="silver-footer">
    <div id="silver-footer-left">
    <div id="silver-footer-right">
    	<div class="silver-address-box">
    		<actinic:variable name="CompanyName" /><br /><actinic:variable name="Address1" /><br /><actinic:block if="%3cactinic%3avariable%20name%3d%22Address2%22%20%2f%3e%20%21%3d%20%22%22"><actinic:variable name="Address2" /><br /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22Address3%22%20%2f%3e%20%21%3d%20%22%22" ><actinic:variable name="Address3" /><br /></actinic:block><actinic:block if="%3cactinic%3avariable%20name%3d%22Address4%22%20%2f%3e%20%21%3d%20%22%22" ><actinic:variable name="Address4" /> </actinic:block><actinic:variable name="PostalCode" />
    	</div>
    	<div class="silver-address-box">
    		Tel: <actinic:variable name="Phone" /><br /><actinic:block if="%3cactinic%3avariable%20name%3d%22Fax%22%20%2f%3e%20%21%3d%20%22%22">Fax: <actinic:variable name="Fax" /><br /></actinic:block><a href="<actinic:variable name="SendMailPageLink" />">Click here to email us</a>
    	</div>
    	<div class="silver-copyright-info">
    		<actinic:variable name="Copyright Message" />
    	</div>
    </div>
    </div>
    </div>
    
    </div>
    </div>
    </div>
    
    <div id="silver-page-bottom-rounded"><img src="theme_shim.gif" height="8" alt="spacer"/></div>
    
    <actinic:variable name="GoogleAnalyticsMarkup" value="Google Analytics Tracking Code" />
    </body>
    
    </html>

    #2
    There are only 2 ways I see possible because the JS has to load to know whether a product is IS or OOS and this happens after page load. You need a fast loading template with no surplus code and most importantly a good quality hosting package. You will not get rid of the pause while it finds out I suspect, but the above measures will ensure that the timeframe is so small it is hardly if not at all noticeable.

    In short you cannot stop the process, all you can do is make it as quick as possible.

    Comment


      #3
      I can see the problem you're describing. I'm not sure why it's happening though. The code that controls it is:

      <span id="EnableIfOutOfStock_ACE-712" class="ActinicRTS" style="visibility: hidden; display: none;">
      <strong>
      <span class="actrequired"><br />OUT OF STOCK</span>
      </strong>
      </span>

      <span id="EnableIfInStock_ACE-712" class="ActinicRTS" > In stock</span>

      <br /><br />

      <span id="RemoveIfOutOfStock_ACE-712" class="ActinicRTS" >
      <input type="image" src="button_viewcart_highlight.gif" name="_ACE-712" alt="Add to Cart" />
      </span>
      It looks to me as if the cause could be that the 'out of stock' text is hidden by default until the javascript gets a chance to kick in and alter the visibility.

      You could try removing the style="visibility: hidden; display: none;" bit to see if that does it, or even apply the style to the in stock text (although this might break the display entirely).

      Mike

      Edit: or possibly have both bits hidden by default until the javascript kicks in and makes one visible.

      Edit2: Note that hiding 'in stock' and the buy button by default means people without javascript will be unable to buy. Probably why it's set up the way it is.

      Edit3: Last one. Hiding the 'in stock' text is probably OK. The Buy button would be the no-no.
      -----------------------------------------

      First Tackle - Fly Fishing and Game Angling

      -----------------------------------------

      Comment


        #4
        Thanks for replies!
        I understand how the nature of javascript causes this problem.. :| .. though changing the host doesn't seem feasible at the moment.

        olderscot: Thanks for suggestions. Although i tried removing the style of hiding both doesnt really do a great job. Removing it basically shows both IS and OOS before the JS finished the query, hiding both shows nothing but the as you said those without javascript won't see a thing..

        Is there any alternative method I can use to show stock level & disable cart button on the extended info pages?

        Comment


          #5
          I don't see how you can do anything to the display until you know the stock status, however you do not know the stock status until the JS is loaded. Your only options are therefore to get the JS loaded as fast as possible, which only streamlining and lightning hosting will do for you.

          Comment


            #6
            You can optimise your page a fair bit.
            The actinic.css file is 79kb.
            You have a quite a few images that can be reduced in size.
            I see that you have jquery but couldn't see any need for it on your site.
            You are also js doc writing the page names for your products in the left sidebar - that's more script that needs to run.

            It all adds up.
            Attached Files

            Comment


              #7
              Originally posted by drounding View Post
              You can optimise your page a fair bit.
              The actinic.css file is 79kb.
              You have a quite a few images that can be reduced in size.
              I see that you have jquery but couldn't see any need for it on your site.
              You are also js doc writing the page names for your products in the left sidebar - that's more script that needs to run.

              It all adds up.
              Thanks! Will need to figure out compressing the images then..
              I didn't notice that jquery bit.. I don't really know what it is for, how can i find out lol?
              Hmm the doc writing scripts are the ones used for the new product list to redict it into extended info pages.. (I think), so i don't think i can take it off :\

              Comment


                #8
                The jquery may be required by some add-in you've got.

                Comment


                  #9
                  It looks like you are using the silver theme - did you remove the code at the bottom of your actinic stylesheet as per the attached image? (Bakup first mind)
                  Attached Files

                  Comment


                    #10
                    Originally posted by drounding View Post
                    It looks like you are using the silver theme - did you remove the code at the bottom of your actinic stylesheet as per the attached image? (Bakup first mind)
                    I had a look think that jquery is used by one of my addon so yeah.
                    Do i just delete the themes from the actinic.css file on my server?

                    P.S. Just checked the actinic.css file on the server. Actually those themes were already removed.

                    Comment


                      #11
                      I'd probably just hide both using the inline style. That way everyone with javascript will just see the relevant text while anyone without javascript won't see any potentially misleading text.

                      Mike
                      -----------------------------------------

                      First Tackle - Fly Fishing and Game Angling

                      -----------------------------------------

                      Comment


                        #12
                        Originally posted by Lewis323 View Post
                        I used the "JavaScriptFunctions" and "Javascript Section Stock Query" that I read from the forum (I think) to determine the stock level. I wonder how i can fix this problem so it only shows out of stock and with add to cart disabled as soon as i'm into the product page. Attached is full layout code for my "Includes Add to Cart Button" layout

                        Any help / solutions / direction appreciated! Billion thanks!!!
                        The stock control system works using javascript and AJAX thus there is always a delay before the page shows the correct information based on the time it takes for the perl scripts on the host to find the stock information. By default it only looks in one section for stock detaisl so is usually pretty quick.

                        By default the stock system is designed to display the same information as you would get without stock control on, this means that you see the Add to Cart button by default. You can easily redesign the page to disable the button but you will also have to modify the javascript to work in reverse, I will post the code to do this later this evening for you.

                        Remember that this means if someone visits the page with javascript disabled they will not be able to order anything so a warning notice that javascript is required might be a good idea.

                        Malcolm

                        SellerDeck Accredited Partner,
                        SellerDeck 2016 Extensions, and
                        Custom Packages

                        Comment


                          #13
                          Originally posted by Lewis323 View Post
                          ...
                          P.S. Just checked the actinic.css file on the server. Actually those themes were already removed.
                          Are you sure?
                          I see references to lots of themes in your css file.

                          Comment


                            #14
                            Originally posted by malbro View Post
                            I will post the code to do this later this evening for you.
                            Here is the standard stock control code in the layout
                            Code:
                             	<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>&nbsp;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>
                            There are four span id's that the javascript code uses to control what is displayed. 'RemoveIfOutOfStock', 'EnableIfStockOK', 'StockLevel' and 'EnableIfOutOfStock'. There is no method in the javascript to 'HideIfInStock', which is what you will need to hide the out of stock message if you enable this by default. So having first changed the code on the out of stock message so that it displays by default:-

                            First change the EnableIfOutOfStock to HideIfInStock, leave the rest of the line as this is neccessary for multiple products on one page.

                            Now all you need is to modify the Stock javascript to add a method to HideIfInStock.

                            Inside the funtion updateStockDisplay() in actinic extras add the following code just in front of the line 'if (sIDStart == 'RemoveIfIfInStock')'

                            Code:
                            			if  (sIDStart == 'HideIfInStock') {
                            				if (mapStockByRef[sProdRef] > 0) {
                            					arrStockElems[nIndex].style.visibility = "hidden";
                            					arrStockElems[nIndex].style.display = "none";
                            				} else {
                            					arrStockElems[nIndex].style.visibility = "visible";
                            					arrStockElems[nIndex].style.display = "inline";
                            				}
                            			}
                            The out of stock will then be displayed until the stock levels are read and then it will be hidden if necessary.

                            Malcolm

                            SellerDeck Accredited Partner,
                            SellerDeck 2016 Extensions, and
                            Custom Packages

                            Comment


                              #15
                              Originally posted by drounding View Post
                              Are you sure?
                              I see references to lots of themes in your css file.
                              Ahha I will need to double check ..

                              Originally posted by malbro View Post
                              Here is the standard stock control code in the layout
                              ...
                              Thanks for the help! I will try it and see how it works, if it doesn't upset anyone using the website I think this might be the best way to do it then

                              Comment

                              Working...
                              X