Add to Cart Not Working!

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
princeatapi
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Thu Jul 16, 2009 4:30 am

Add to Cart Not Working!

Post by princeatapi » Wed Sep 02, 2009 3:23 am

Hello ALL !

Ive done some layout modification with my product description page! now Add To Cart Button not working :( what are all the check list i have to ensure inorder to make the Add To Cart Work ? Am i missing any dependencies ? PLease help me out !

Thanks
Prince M. Premnath

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Add to Cart Not Working!

Post by William_firefold » Wed Sep 02, 2009 6:26 am

post the code you modified plz

princeatapi
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Thu Jul 16, 2009 4:30 am

Re: Add to Cart Not Working!

Post by princeatapi » Wed Sep 02, 2009 6:41 am

I didn't made any modification to the code, just workin with the default ConLib Controls , if i click the add to cart button,it didn't get processed , no post back nothing . What are all the possible cases will bring this issue !

-Prince

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Add to Cart Not Working!

Post by AbleMods » Wed Sep 02, 2009 6:55 am

You obviously changed something. But without showing us what you've changed, how can we help you?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Add to Cart Not Working!

Post by William_firefold » Wed Sep 02, 2009 6:56 am

princeatapi wrote: Ive done some layout modification with my product description page!
The addtocart control uses javascript to function, so if you have added or changed javascript on the page or possibly even if you left some open or broken tags, this could affect the button. really it could be one of a million things though.

princeatapi
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Thu Jul 16, 2009 4:30 am

Re: Add to Cart Not Working!

Post by princeatapi » Wed Sep 02, 2009 7:00 am

Here is the code , please review and let me know if any issues there !

<!--
<Description>
Displays a product, including description and reviews (if enabled).
</Description>
-->

<script>
function show_news_events_articles(tab, divheight)
{
//alert(divheight);
if(tab == 'events_details')
{

document.getElementById("events_highlight").style.display="inline";
document.getElementById("events_link").style.display="none";
document.getElementById("paper_highlight").style.display="none";
document.getElementById("paper_link").style.display="inline";

document.getElementById("paper_details").style.display="none";
document.getElementById("events_details").style.display="inline";

document.getElementById("slider1").style.height= eval(divheight)+'px';
document.getElementById("slider2").style.height= '0px';

}

if(tab == 'paper_details')
{

document.getElementById("events_highlight").style.display="none";
document.getElementById("events_link").style.display="inline";
document.getElementById("paper_highlight").style.display="inline";
document.getElementById("paper_link").style.display="none";

document.getElementById("events_details").style.display="none";
document.getElementById("paper_details").style.display="inline";
document.getElementById("slider1").style.height= '0px';
document.getElementById("slider2").style.height= eval(divheight)+'px';
}
}

</script>


## NO CONTENTS IF PRODUCT IS NULL
#if($Product)
[[ConLib:CategoryBreadCrumbs HideLastNode="False"]]
<div class="pageHeader"><h1>$Product.Name</h1></div>

<div class="stWrapper">
<div style="" class="DescriptionWrapper">
<div class="stProductBox">
<div class="stWrapper1">
[[ConLib:ProductImage ShowImage="Image"]]<br />
#if($Product.Images.Count > 0)
<a href="#" onclick="window.open('ProductImages.aspx?ProductId=$Product.ProductId', 'productImages', 'status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=yes,scrollbars=1,height=650,width=850')">
More Images
</a>
#end
</div>
<div class="stWrapper1" style="">
<div style="width:100%;" align="center">
<div style="width:400px;border:0px solid;">
[[ConLib:Custom\StridaProductDiscountDialog]]
[[ConLib:Custom\StridaBuyProductDialog]]

</div>
</div>
</div>
</div>
<div class="stProductDetailBox">
<div class="stProductDetailBoxText">
#if ($Product.ManufacturerId != 0)
Other products by <a href="Search.aspx?m=$Product.ManufacturerId">$Product.Manufacturer.Name</a><br />
#end
#if($store.Settings.ProductReviewEnabled != "None")
#if($store.Settings.ProductReviewEnabled == "Registered")
#if($customer.IsAnonymous == false)
[[ConLib:ProductRatingImage]] <a href="#reviews">reviews</a>
#end
#end
#if($store.Settings.ProductReviewEnabled == "Anonymous")
#if($customer.IsAnonymous == true)
[[ConLib:ProductRatingImage]] <a href="#reviews">reviews</a>
#end
#end
#if($store.Settings.ProductReviewEnabled == "All")
[[ConLib:ProductRatingImage]] <a href="#reviews">reviews</a>
#end
#end
</div>
<div class="stProductTabBox">
<table width="310px" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="left"><div id="newsEvents">
<table align="left" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td align="left" valign="top"><a href="javascript:;" onclick=" show_news_events_articles('events_details', '100');"> <img id="events_link" style="display: none;" src="App_Themes/Strida Theme/images/news_tab_r1_c1.jpg" alt="News and Events" border="0" /></a><a href="#" > <img src="App_Themes/Strida Theme/images/news_tab_r1_c1_f2.jpg" alt="News and Events" name="events_highlight" width="130" height="21" border="0" id="events_highlight" style="display: inline;" /></a> </td>
<td align="left" valign="top"><a href="#" ><img src="App_Themes/Strida Theme/images/news_tab_r1_c3_f2.jpg" id="paper_highlight" style="display: none;" alt="Articles" border="0" /></a> <a href="javascript:;"><img src="App_Themes/Strida Theme/images/news_tab_r1_c3.jpg" alt="Articles" name="paper_link" width="130" height="21" border="0" id="paper_link" style="display: inline;" onclick="show_news_events_articles('paper_details', '100');" /></a> </td>
</tr>
</tbody>
</table>
<div class="slider" id="slider1" style="">
<div class="slidercontent" id="event_slider">
<div id="events_details" style="display: inline;">
<a name="desc"></a>
[[ConLib:Custom\StridaProductDescription ShowCustomFields="true"]]
</div>
</div>
</div>
<div style="height: 0px;" class="slider" id="slider2">
<div class="slidercontent" id="paper_slider">
<div id="paper_details" style="display: none;">
Second TabSecond TabSecond TabSecond Tab
Second TabSecond TabSecond TabSecond Tab
Second TabSecond TabSecond TabSecond Tab
Second TabSecond TabSecond TabSecond Tab
Second TabSecond TabSecond TabSecond Tab
Second TabSecond TabSecond TabSecond Tab
</div>
</div>
</div>
</div></td>
</tr>
</table>
</div>

</div>
<div class="stMoreDetails">
[[ConLib:Custom\StridaProductMoreDetails ShowCustomFields="true"]]
</div>
<div class="stReviewWrapper">
#if($store.Settings.ProductReviewEnabled != "None")
<a name="reviews"></a>
<div class="section">
<div class="header"><h2>Reviews</h2></div>
<div class="content">[[ConLib:ProductReviewsPanel]]</div>
</div>
#end
[[ConLib:MoreCategoryItems Caption="More Items in $Category.Name" Orientation="Horizontal" MaxItems="4" DisplayMode="Sequential"]]

</div>
</div>
<div class="stCategoryRight">
<!-- [[ConLib:MiniBasket AlternateControl="PopularProductsDialog.ascx"]]
[[ConLib:ProductAssets]]
[[ConLib:RelatedProducts Orientation="HORIZONTAL" Columns="1"]]
<br />
[[ConLib:ProductTellAFriend]] -->
[[ConLib:MiniBasket]]
[[ConLib:RecentlyViewed]]
</div>
</div>

<!--Content Area Starts Here-->


<!--#if($store.Settings.ProductReviewEnabled != "None")
<a name="reviews"></a>
<div class="section">
<div class="header"><h2>Reviews</h2></div>
<div class="content">[[ConLib:ProductReviewsPanel]]</div>
</div>
#end
[[ConLib:MoreCategoryItems Caption="More Items in $Category.Name" Orientation="Horizontal" MaxItems="4" DisplayMode="Sequential"]]
#end -->


Thanks
-Prince

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Add to Cart Not Working!

Post by William_firefold » Wed Sep 02, 2009 7:09 am

my first thought is that the problem is in this section

Code: Select all

<td align="left" valign="top"><a href="javascript:;" onclick=" show_news_events_articles('events_details', '100');"> <img id="events_link" style="display: none;" src="App_Themes/Strida Theme/images/news_tab_r1_c1.jpg" alt="News and Events" border="0" /></a><a href="#" > <img src="App_Themes/Strida Theme/images/news_tab_r1_c1_f2.jpg" alt="News and Events" name="events_highlight" width="130" height="21" border="0" id="events_highlight" style="display: inline;" /></a> </td>
<td align="left" valign="top"><a href="#" ><img src="App_Themes/Strida Theme/images/news_tab_r1_c3_f2.jpg" id="paper_highlight" style="display: none;" alt="Articles" border="0" /></a> <a href="javascript:;"><img src="App_Themes/Strida Theme/images/news_tab_r1_c3.jpg" alt="Articles" name="paper_link" width="130" height="21" border="0" id="paper_link" style="display: inline;" onclick="show_news_events_articles('paper_details', '100');" /></a> </td>
maybe try removing it and see if it fixes things.

also, it looks like you are using a different version of the buyproductdialog
[[ConLib:Custom\StridaBuyProductDialog]]
if it is modified, try using a stock version and see if you have any luck.

princeatapi
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Thu Jul 16, 2009 4:30 am

Re: Add to Cart Not Working!

Post by princeatapi » Wed Sep 02, 2009 7:14 am

If i Try with ur First option Application Crash with the Familiar error message OOPS ....

[[ConLib:Custom\StridaBuyProductDialog]] is just a duplicate of the original [[ConLib:BuyProductDialog]] ive have done nothing with the control , the control was as it as Original

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Add to Cart Not Working!

Post by William_firefold » Wed Sep 02, 2009 7:20 am

the next thing i would do is try a stock version of the product page to see if the problem is just on the page or if it is somewhere else.
then I would remove all custom javascript from the product page, including the functions and any links with javascript in them. If that works, you can add them back one by one until it break, and then you know where the problem is.
If removing all javascript doesnt work, im out of ideas.

princeatapi
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 23
Joined: Thu Jul 16, 2009 4:30 am

Re: Add to Cart Not Working!

Post by princeatapi » Wed Sep 02, 2009 8:11 am

the strategy what u have suggested won's !!! Thanks a lott i think ive missed #end nVelocity script .
now its working , thanks for ur support

-Prince

Post Reply