Tara wrote:Thank you for your detailed response, I do hope to resolve this. All of this thread concerns Products that have Attributes and my objective is to remove the Add To Cart button only on the /Category Product List page. My comments are preceded by **.
>> Most surprising is that when adding the Visible="false" in the .ascx page - there was no effect.
Setting the Visible property to false won't have any effect if you don't also modify the code behind files (files ending in ascx.cs) and recompile the solution.
**I did so according to the earlier post for 1.60 code changes.
**I edited the file Modules\ProductBox2.ascx.cs and commented out line 84 and added the code that was in the post. I did the same for ProductBox1.ascx.cs.
**I am using Visual Studio 2010 Express and 4.0. After making the code changes to the code behind files as well as the .ascx pages I built the NopCommerceStore website and ran it and there was no change to the Add To Cart button behavior. I did this several times. In version 1.50 I did see that the Add to Cart button was not displayed after using similar code from an earlier post for 1.50.
After building, are you running the website on a web server or through the development server? If on a web server, ensure you are copying the new files (NopCommerceStore.dll) to the web server to see the changes. If you are using the built in development web server, and the changes aren't showing up, then the NopCommerceStore project may not be getting recompiled. Have you checked the Modified Date for the NopCommerceStore.dll (in /bin) after making a change and compiling the solution? Have you set NopCommerceStore as the 'StartUp Project'? Have you tried to build it from Solution Explorer (right-click on the NopCommerceStore project in Solution Explorer and select Build)?
To see if the project is getting built, make another change (temporarily -remove before publishing your site) to the code behind and add some static text. For Modules\ProductBox2.ascx.cs (line 76)
change from:
lShortDescription.Text = product.ShortDescription;
to:
lShortDescription.Text = product.ShortDescription + "TEST";
This change will append the text "TEST" to categories using the category template "ProductsInLines1". Build the solution and see if the change is present for categories using the "ProductsInLines1" template.
Tara wrote:
The code behind will set the visibility to true (overriding your change) if the product's first product variant has their "Disable buy button" property set to false (unchecked).
** I do not want to disable the buy button, as that will remove it entirely from all pages. Please advise, it sounds like the code solution in the post is overridden (visible set to true) unless the Disable buy button is checked. Since the Disable buy button setting checkbox is at the Product level, the result is that the product cannot be purchased.
To recompile the solution, you will need the source version of NopCommerce (1.60) and either Visual Studio 2008 or Visual Web Developer 2008 Express Edition.
** As 1.60 is 4.0 are you sure I could be using my VS 2008?
Version 1.60 only requires .Net 3.5 SP1; version 1.70 requires .Net 4.0. If you have opened your version 1.60 with VS2010, it probably has been converted for VS2010 and VS2008 probably won't be able to open the solution intended for a newer version of VS.
.