Quote:
Originally Posted by lewaff
Looks Good
But Managed to get the first bit of code showing "availablity"
But nothing else
|
Lewis
Unfortunately I would not be able to provide you with the correct information as you don't have the same x-cart version than mine. I know nothing about V4.3
The first bit of code is to create your extra field in admin but in V4.3 I would not know where to place it - Mine is in
skin1/main/product_details.tpl (Not anywhere, it is where I want the extra field to appear when I upload new products)
Code:
{/if}
<tr>
{if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[stock_indicator]" /></td>{/if}
<td class="FormButton" nowrap="nowrap">{$lng.lbl_stock_indicator}</td>
<td class="ProductDetails">
<input type="text" name="stock_indicator" size="2" value="{$product.stock_indicator}" />
</td>
</tr>
The second piece of code is the code that call the extra field and once again I don't know where to place it in V4.3 - Mine is placed in
skin1/customer/main/product.tpl near the bottom so that it will display under my product details under "details"
Code:
{if $product.stock_indicator ge 1}
<span style="color: green; font-size: 12px; font-weight: bold;">{$lng.lbl_product_in_stock_now|regex_replac e:"/<br[^>]*>/iS":" "}</span>
{elseif $product.stock_indicator lt 0}
<span style="color: red; font-size: 12px; font-weight: bold;">{$lng.lbl_discontinued|regex_replace:"/<br[^>]*>/iS":" "}</span>
{else}
<span style="color: orange; font-size: 12px; font-weight: bold;">{$lng.lbl_out of stock|regex_replace:"/<br[^>]*>/iS":" "}</span>
{/if}
The third piece of code also call the extra field and once again I don't know where to place it in V4.3 - Mine is placed in
skin1/customer/main/products.tpl (this code looks different from the second piece of code as I don't need a third condition because products that are discontinued I set to "hidden but available for sale and therefore the third condition would not be needed as Xcart will not display it in the product list in any case - the third condition was only implemented if a search engine directs a customer via a product that is discontinued to my site to prevent them from getting a blank page)
Code:
{if $products[product].stock_indicator ge 1}
<span style="color: green; font-size: 12px; font-weight: bold;">{$lng.lbl_product_in_stock_now}</span>
{else}
<span style="color: orange; font-size: 12px; font-weight: bold;">{$lng.lbl_product_out_of_stock}</span>
{/if}
</td>
You would need to create language vairables
lbl_stock_indicator
lbl_product_in_stock_now
lbl_product_out_of_stock
lbl_discontinued