Jump to content

Troubleshooting Error Message


Guest Manic056
 Share

Recommended Posts

Guest Manic056

Anyone fancy having a go at lending a hand with this one?

www.manicglow.com - all mod conflicitons have finally been resolved, although now when you attempt to buy an item that is out of stock, or a product option that is out of stock, a blank error appears on screen, I was hoping to fill this with a message such as "Out of Stock, please attempt another product selection that has items avaliable."

Link to comment
Share on other sites

You might want to get the latest version of my custom add to cart messages

(its less buggy)

but as for your checkstock javascript

look in the javsacript you put here

for

else if (stockLevel == 0) {

alert("");

return false;

and type a message between ""

function checkStock() {

var stockInfo = {  '47' : [ 12, "" ], '49' : [ 0, "" ] };var e = [];

					 e[0] = document.getElementsByName('productOptions[]');

					 e[1] = document.getElementsByName('productOptions_5');

					 e[2] = document.getElementsByName('productOptions_5[]');

				 var a = gv(e);

				 var index = getIndex(a);

				 var stockLevel = -1;

				 if(stockInfo[index] != undefined) {

				 stockLevel = stockInfo[index][0];

				 }

				 else if(index == '') {

				 stockLevel = 0;

				 }

				 if (stockLevel > 0) {

					 return true;

				 }

				 else if (stockLevel == 0) {

					 alert("");

					 return false;

				 }

				 else {

					 alert("");

					 return false;

				 }

		}

Link to comment
Share on other sites

  • 2 weeks later...
Guest Manic056

else if (stockLevel == 0) {

alert("");

return false;

and type a message between ""

Cheers, I'll have a look now.

Sorry, just went to check it, what file should I be looking in here? I can't find the area you are talking about.

Link to comment
Share on other sites

Guest Manic056

Try in styleTemplates/content/viewprod.tpl...

Theres nothing of the sort there, I've got this:

<!-- BEGIN: view_prod -->

<!-- start mod: Stock Levels for Product Options -->

<!-- by Estelle and DanV - http://cubecart.expandingbrain.com -->

{STOCKOPTION_SCRIPT}

<!-- end mod: Stock Levels for Product Options -->

<!-- BEGIN: prod_true --><div class="boxContentd"> <strong>{LANG_DIR_LOC}</strong> {CURRENT_DIR}

<form action="{CURRENT_URL}" method="post" name="addtobasket" target="_self">

<p class="txtContentTitle"><strong>{TXT_PRODTITLE}</strong></p>

<div class="boxContentb">

<div><img src="{IMG_SRC}" alt="{TXT_PRODTITLE}" border="0" title="{TXT_PRODTITLE}" />{TXT_OUTOFSTOCK}{SALE_PRICE}</div>

<!-- BEGIN: more_images -->

<div style="text-align: center;"><a href="java script:openPopUp('extra/prodImages.php?productId={PRODUCT_ID}', 'images', 548, 455, 0);" class="txtDefault">{LANG_MORE_IMAGES}</a></div>

<!-- END: more_images -->

</div>

</div>

<p>

<strong>{LANG_PRODINFO}</strong>

<br />

{TXT_DESCRIPTION}

</p>

<div class="boxContentc">

<!-- BEGIN: prod_opts -->

<div style="float: left; position: realtive; width: 270px; text-align; right;">

<strong>{TXT_PROD_OPTIONS}</strong>

<table border="0" cellspacing="0" cellpadding="3" align="right">

<!-- BEGIN: repeat_options -->

<tr><td><strong>{VAL_OPTS_NAME}</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td><select name="productOptions[]" onChange="{JS_UPDATE_PRICE}

{JS_UPDATE_STOCK_LEVEL}"><!-- BEGIN: repeat_values --><option value="{VAL_ASSIGN_ID}">{VAL_VALUE_NAME}<!-- BEGIN: repeat_price -->{VAL_OPT_SIGN}{VAL_OPT_PRICE})

<!-- END: repeat_price -->

</option>

<!-- END: repeat_values -->

</select>

</td>

</tr>

<!-- END: repeat_options -->

</table></div>

<!-- END: prod_opts --> <p>

<strong>{LANG_PRICE}</strong> {TXT_PRICE}

<span class="txtSale">{TXT_SALE_PRICE}</span>

</p>

<ul>

<li class="bulletLrg"><a href="index.php?act=taf&amp;productId={PRODUCT_ID}" target="_self" class="txtDefault">{LANG_TELLFRIEND}</a></li>

</ul>

<br />

<strong>{LANG_PRODCODE}</strong><br /> <span id="prodCode">{TXT_PRODCODE}</span>

<div id="stock">

<span id="inStock">{TXT_INSTOCK}</span><span id="outOfStock" style="font-size: 12px; font-weight: bold; color: #FF0000;"></span>

<!-- BEGIN: buy_btn -->

<div>{LANG_QUAN}

<input name="quan" type="text" value="1" size="2" class="textbox" style="text-align:center;" /><br /><br/>

<a href="java script:{JS_VERIFY_STOCK} addtocart('addtobasket','{TXT_PRODTITLE}');" class="txtButton" style="line-height: 20px";>{BTN_ADDBASKET}</a>

<!-- END: buy_btn -->

</div></div>

<div></div>

<input type="hidden" name="add" value="{PRODUCT_ID}" />

</form>

<div id="question" style="display:none; cursor: default;padding:20px">

<p>You have added {TXT_PRODTITLE} what would you like to do next?<p>

<input type="button" id="stay" value="Keep Shopping" />

<input type="button" id="cart" value="Checkout" />

</div>

<!-- END: prod_true -->

<!-- BEGIN: prod_false -->

<p>{LANG_PRODUCT_EXPIRED}</p>

<!-- END: prod_false -->

</div>

<!-- END: view_prod -->

Link to comment
Share on other sites

sorry - was just a guess because I could see the script in the source code on the product page but not on the index page.

Best email the mod author to find out where they have placed the script.

Link to comment
Share on other sites

Guest Manic056

sorry - was just a guess because I could see the script in the source code on the product page but not on the index page.

Best email the mod author to find out where they have placed the script.

Good idea, he uses the other cubecart forums. Better head on over.

Link to comment
Share on other sites

Guest Manic056

OK I sent a mail to Anthony and he said he might be able to help sometime next week, although anyone who could help now would be greatly appreciated.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...