Hello, sorry its us again!
In the site http://www.roksportdarts.co.uk/...
Were encountering another problem, where the Add to Cart button is either showing for every product, whether in stock or not....or it is showing as "Out Of Stock". Im not 100% sure but I imagine the problem is with the php code at the top of the page, Im not sure where has_stock is generated from, or what I would need to do to generate it.
The code for the site is (sorry I dont know how to put it in a flashy box!):
<div style="text-align: center;">
<div style="text-align: left; margin: 1em auto; width: 50%;">
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
<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>
</actinic:block>
<!-- Custom code to check stock levels -->
<actinic:block php="true" >
$has_stock = 'false';
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22StockLevel%22%20%2f%3e%20%3e%200" >
<!-- the visible product has stock -->
<actinic:block php="true" >
$has_stock = 'true';
</actinic:block>
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
<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>
</actinic:block>
<div class="rok_product_brief">
<div class="topproductarc"><a name="<Actinic:Variable Name="EncodedProductAnchor"/>"><h5><actinic:variable formatting="font(Name|Arial),bold" encoding="actinic" name="ProductName" /></h5></a></div><br/>
<div class="rok_product_brief_content">
<div class="rok_product_brief_price"><actinic:variable name="PriceListRetail" /></div>
<actinic:block i7f="%3cactinic%3avariable%20name%3d%22IsProductReferenceVisible%22%20%2f%3e" >
<div><strong>Ref:</strong> <actinic:variable name="ProductReference" /></div>
</actinic:block>
<actinic:variable name="ProductImageLayout" />
<div class="rok_brief_addcart">
<table>
<tr>
<td><actinic:variable name="AttributeList" /> <actinic:variable name="ComponentList" /></td>
<td>
<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>
</td>
</tr>
<tr>
<td colspan="2" >
<!-- ROKSPORT CODE TO SHOW/HIDE Add to Cart based on stock -->
<actinic:block php="true" >
if ($has_stock == 'false') {
echo "<span style=\"font-weight: bold; font-size: 8; color: green;\">SORRY OUT OF STOCK</span> <div style=\"display: none;\">";
}
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e">
<actinic:variable name="AddToCartButton" />
</actinic:block>
<actinic:block php="true" >
if ($has_stock == 'false') {
echo '</div>';
}
</actinic:block>
</td>
</tr>
<tr><td><actinic:variable name="ExtendedInformationLinks" /></td></tr>
</table>
<actinic:variable name="CartError" />
</div>
</div>
</div>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
</form>
</actinic:block>
</div>
</div>
Could anyone shed any light on what could be causing it to not work properly?
I know the page currently looks a bit rubbish btw, Im just trying to perform all the functions before I tidy it all up.
edit: I forgot to add the cart code is currently commented out on the uploaded website!
thanks Mike
In the site http://www.roksportdarts.co.uk/...
Were encountering another problem, where the Add to Cart button is either showing for every product, whether in stock or not....or it is showing as "Out Of Stock". Im not 100% sure but I imagine the problem is with the php code at the top of the page, Im not sure where has_stock is generated from, or what I would need to do to generate it.
The code for the site is (sorry I dont know how to put it in a flashy box!):
<div style="text-align: center;">
<div style="text-align: left; margin: 1em auto; width: 50%;">
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
<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>
</actinic:block>
<!-- Custom code to check stock levels -->
<actinic:block php="true" >
$has_stock = 'false';
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22StockLevel%22%20%2f%3e%20%3e%200" >
<!-- the visible product has stock -->
<actinic:block php="true" >
$has_stock = 'true';
</actinic:block>
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
<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>
</actinic:block>
<div class="rok_product_brief">
<div class="topproductarc"><a name="<Actinic:Variable Name="EncodedProductAnchor"/>"><h5><actinic:variable formatting="font(Name|Arial),bold" encoding="actinic" name="ProductName" /></h5></a></div><br/>
<div class="rok_product_brief_content">
<div class="rok_product_brief_price"><actinic:variable name="PriceListRetail" /></div>
<actinic:block i7f="%3cactinic%3avariable%20name%3d%22IsProductReferenceVisible%22%20%2f%3e" >
<div><strong>Ref:</strong> <actinic:variable name="ProductReference" /></div>
</actinic:block>
<actinic:variable name="ProductImageLayout" />
<div class="rok_brief_addcart">
<table>
<tr>
<td><actinic:variable name="AttributeList" /> <actinic:variable name="ComponentList" /></td>
<td>
<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>
</td>
</tr>
<tr>
<td colspan="2" >
<!-- ROKSPORT CODE TO SHOW/HIDE Add to Cart based on stock -->
<actinic:block php="true" >
if ($has_stock == 'false') {
echo "<span style=\"font-weight: bold; font-size: 8; color: green;\">SORRY OUT OF STOCK</span> <div style=\"display: none;\">";
}
</actinic:block>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsAddToCartButtonShown%22%20%2f%3e">
<actinic:variable name="AddToCartButton" />
</actinic:block>
<actinic:block php="true" >
if ($has_stock == 'false') {
echo '</div>';
}
</actinic:block>
</td>
</tr>
<tr><td><actinic:variable name="ExtendedInformationLinks" /></td></tr>
</table>
<actinic:variable name="CartError" />
</div>
</div>
</div>
<actinic:block if="%3cactinic%3avariable%20name%3d%22IsProductFormUsed%22%20%2f%3e">
</form>
</actinic:block>
</div>
</div>
I know the page currently looks a bit rubbish btw, Im just trying to perform all the functions before I tidy it all up.
edit: I forgot to add the cart code is currently commented out on the uploaded website!
thanks Mike
Comment