Forcing item to be sold in multiples
Forcing item to be sold in multiples
We have a group of products that we only sell in multiples of 12 due to customization. I cannot find in AC Gold R6 that this is possible, and on the forum I only found a method for AC7 (via manipulating files and scriptlets, which AC Gold does not appear to use). Has anyone managed this with Gold R6, or can offer insight on how to go about this?
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Forcing item to be sold in multiples
You can try two things here. First from admin edit product page set the minimum purchase quantity for product to 12. This will make sure when some one will add product from category listings it will have a quantity of 12. Secondly on product details page where you can change product quantity it will be initialized with value 12 and won't let you put any thing less then it. In order to make sure value is always multiple of 12 you can use ASP.NET custom validator with some javascript to make the happen.
Edit Website/ConLib/BuyProductDialog.ascx file and locate following location
and then update it like
Hopefully that will help.
Edit Website/ConLib/BuyProductDialog.ascx file and locate following location
Code: Select all
<asp:PlaceHolder ID="QuantityLimitsPanel" runat="server" EnableViewState="false"></asp:PlaceHolder>
Code: Select all
<script type="text/javascript">
function validateMultiples(source, arguments) {
if (arguments.Value % 12 == 0) {
arguments.IsValid = true;
} else {
arguments.IsValid = false;
}
}
</script>
<asp:CustomValidator ID="MultipleQuantityValid" runat="server" ControlToValidate="Quantity" ClientValidationFunction="validateMultiples" ValidationGroup="AddToBasket" Text="*" ErrorMessage="Quantity must be multiple of 12."></asp:CustomValidator>
<asp:PlaceHolder ID="QuantityLimitsPanel" runat="server" EnableViewState="false"></asp:PlaceHolder>
Re: Forcing item to be sold in multiples
How about creating a kit of 12? Customer orders 2 kits they get 24, ect.
Hope this helps.
Hope this helps.
Re: Forcing item to be sold in multiples
Thank you, Mazhar. Will we need to create a new Product.ascx and .cs page, and a new BuyProductDialog.ascx and .cs file so that only certain products are forced to purchase in multiples of 12?
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Forcing item to be sold in multiples
That is a good idea, Chip. I will look at both options and decide.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Forcing item to be sold in multiples
Actually you can make one more small code update to make this happen. Edit Website/ConLib/BuyProductDialog.ascx.cs file and locate following codeBrewhaus wrote:Thank you, Mazhar. Will we need to create a new Product.ascx and .cs page, and a new BuyProductDialog.ascx and .cs file so that only certain products are forced to purchase in multiples of 12?
Code: Select all
if (Quantity.MinValue > 0) Quantity.Text = Quantity.MinValue.ToString();
Code: Select all
if (Quantity.MinValue > 0) Quantity.Text = Quantity.MinValue.ToString();
MultipleQuantityValid.Visible = _Product.MinQuantity > 0 && _Product.MinQuantity == 12;
Re: Forcing item to be sold in multiples
Thank you, Mazhar. I will test this out later today when I get the time.
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot
Re: Forcing item to be sold in multiples
Your solution worked perfectly, Mazhar. Thank you again!
Rick Morris
Brewhaus (America) Inc.
Hot Sauce Depot
Brewhaus (America) Inc.
Hot Sauce Depot