logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
IDAutomation  
#1 Posted : Tuesday, July 30, 2019 8:57:06 AM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
On our previous version of Able7, we were able to disable and hide the quantity field for our software products because it is not needed and confusing to our customer when we have already created variants/options to select and add to cart.

How can I disable other than setting the max quantity purchase to 1 in the additional settings section? I need to have the - 1 + box above the add to cart button to not appear on certain products. We do still need it to appear on other products.

remove quantity

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shari  
#2 Posted : Tuesday, July 30, 2019 10:32:58 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi IDAutomation,

You need to update the following lines of code to hide the Quantity box in this case.

1- Please open the file \Website\Code\BuyProductDialog\PrepareBuyProductDialogDataAttribute.cs in a editor of your choice.
2- Find for these lines

else
{
hideAddToBasket = false;
hideRowQuantity = false;

}


and replace with the following lines of code


else if (product.MinQuantity == 1 && product.MaxQuantity == 1)
{
hideAddToBasket = false;
hideRowQuantity = true;

}
else
{
hideAddToBasket = false;
hideRowQuantity = false;

}




This will require a recompile in Visual Studio after you make the change, but the only file that will need to be updated is the /bin/AbleCommerce.dll file to the live website.

Thanks
thanks 1 user thanked shaharyar for this useful post.
IDAutomation on 7/30/2019(UTC)
IDAutomation  
#3 Posted : Tuesday, July 30, 2019 10:58:52 AM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
While I can make the change, I'm not a developer, so I don't understand what I'm recompiling if I'm only changing the .cs file?
MikeR  
#4 Posted : Tuesday, July 30, 2019 11:04:11 AM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hello,

Download Visual Studio Developer

https://visualstudio.mic...m/free-developer-offers/

Open the ac9.sln file, make the changes per the prior post. Select rebuild solution. Then copy the /bin/AbleCommerce.dll file to your development site.

2019-07-30_12-03-32.png (38kb) downloaded 0 time(s).

Edited by user Tuesday, July 30, 2019 11:08:28 AM(UTC)  | Reason: Not specified

Thank you for your support!
Mike Randolph
AbleCommerce.com
thanks 1 user thanked MikeR for this useful post.
IDAutomation on 7/30/2019(UTC)
IDAutomation  
#5 Posted : Tuesday, July 30, 2019 11:36:11 AM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: MikeR Go to Quoted Post

Open the ac9.sln file, make the changes per the prior post. Select rebuild solution. Then copy the /bin/AbleCommerce.dll file to your development site.


Mike, the only .sln I see is AbleCommerce_WAP.sln?

Edited by user Tuesday, July 30, 2019 11:36:50 AM(UTC)  | Reason: Not specified

MikeR  
#6 Posted : Tuesday, July 30, 2019 12:05:49 PM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
That's the correct one.
Thank you for your support!
Mike Randolph
AbleCommerce.com
IDAutomation  
#7 Posted : Tuesday, July 30, 2019 12:21:14 PM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
opened that file, made the change, recompiled and now I have 3128 error and 54 warnings... that can't be right :(

UserPostedImage

I changed that line of code back and rebuilt and still have that many errors?

Edited by user Tuesday, July 30, 2019 12:25:25 PM(UTC)  | Reason: Not specified

MikeR  
#8 Posted : Tuesday, July 30, 2019 12:26:38 PM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
During the compile that's pretty normal, especially with an unconfigured Visual Studio. Backup the AbleCommerce.dll, put the new one in place and give it a test.

Thank you for your support!
Mike Randolph
AbleCommerce.com
IDAutomation  
#9 Posted : Tuesday, July 30, 2019 1:20:31 PM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
Mike,
I ignored the errors and I see the date change of the .cs file, but the AbleCommerce.dll file date never changed after recompiling? I searched the drive and I do have 4 copies but all the same date and time back from July 17th.

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

I just cannot get it to work/update for me :(
IDAutomation  
#10 Posted : Tuesday, July 30, 2019 2:21:01 PM(UTC)
IDAutomation

Rank: Member

Groups: Authorized User, Developers
Joined: 11/13/2018(UTC)
Posts: 23

Thanks: 16 times
Was thanked: 1 time(s) in 1 post(s)
Started over from scratch and noticed that I had a different .NET Framework build 4.6.1, downloaded 4.6.2 and made the changes and the compile worked without any errors.

Uploaded the new DLL and it looks like it worked... (but I have that original dll safely tucked away)
MikeR  
#11 Posted : Tuesday, July 30, 2019 2:31:15 PM(UTC)
MikeR

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, System, Admin
Joined: 10/18/2018(UTC)
Posts: 183

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
Hello,

Thanks for the update, I'm glad you were able to get it sorted out!
Thank you for your support!
Mike Randolph
AbleCommerce.com
Users browsing this topic
Guest (9)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.