How to add Engraving option and Price for it
How to add Engraving option and Price for it
About 2,000 products have "Engraving Available".
The charge is $9.99 for it.
So when someone chooses Engraving, I need to charge $9.99 for it.
How do I set this up in AC7?
I played around with Product Templates and Options and Variants but can't figure it out?
The charge is $9.99 for it.
So when someone chooses Engraving, I need to charge $9.99 for it.
How do I set this up in AC7?
I played around with Product Templates and Options and Variants but can't figure it out?
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: How to add Engraving option and Price for it
Out of the box, you would have to add an option- no fun for that many products.
Or you would have to custom code a template to do that. You would have to change code on the product page, the basket page, wishlist page.
Or you would have to custom code a template to do that. You would have to change code on the product page, the basket page, wishlist page.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: How to add Engraving option and Price for it
thanks Judy,
>> Out of the box, you would have to add an option - no fun for that many products.
If I add a product Option, the user would have to select it, otherwise $9.99 won't be charged
if I just have a textbox displayed (from a Product Template).
If I added an "Engraving" item product for $9.99, . .
is it possible to check for an empty string in the textbox, and if not empty,
add the "Engraving" to the cart?
>> Or you would have to custom code a template to do that.
Not sure where to even begin with that.
>> Out of the box, you would have to add an option - no fun for that many products.
If I add a product Option, the user would have to select it, otherwise $9.99 won't be charged
if I just have a textbox displayed (from a Product Template).
If I added an "Engraving" item product for $9.99, . .
is it possible to check for an empty string in the textbox, and if not empty,
add the "Engraving" to the cart?
>> Or you would have to custom code a template to do that.
Not sure where to even begin with that.
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: How to add Engraving option and Price for it
Yes, that would work in a product template, but you would have to change the code when it gets added to the basket and wishlist and a move from wishlist to basket.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Re: How to add Engraving option and Price for it
I think I might need to add an "Engraving" field to the Products table.
Then in BuyProductDialog:
if (_Product.Engraving)
{
pnl1.Visible = true;
}
<asp:Panel runat="server" ID="pnl1" Visible="false">
ENGRAVING AVAILABLE
Then add a button for "Add Engraving" and then show a
text box and add some code to flag it somehow to charge $9.99
</asp:Panel>
Then in BuyProductDialog:
if (_Product.Engraving)
{
pnl1.Visible = true;
}
<asp:Panel runat="server" ID="pnl1" Visible="false">
ENGRAVING AVAILABLE
Then add a button for "Add Engraving" and then show a
text box and add some code to flag it somehow to charge $9.99
</asp:Panel>
Re: How to add Engraving option and Price for it
I just posted a purely javascript idea in a thread linked to this one: viewtopic.php?f=45&t=11879&p=51060#p51060. My idea uses an option field and a product template text field and javascript to enable / disable the text box. I did not write the code or implement this. It is just a concept at this point. HTH.
Re: How to add Engraving option and Price for it
I found a possible way to do this but I don't know how to check for it.
When adding the product to the Cart, I can check for the Product Template
"Personalization" (ID 4 in the database):
I need to somehow check to see if the TextBox is NOT empty. If it is not,
I would need to add another product, the $9.99 for the Engraving charge, to the Cart.
I know this can be done because if you add a product with Personalization (a TextBox)
to the Cart and you DON'T add text to it, it will increase the Quantity of that same product
if it is already in the cart. But if there is text, it will be a different item with a Quantity of one.
The name of the Product Template is shown in the Cart like: "Personalization:", . .
so there has to be some way to check for the contents of that textbox.
I'll need the help of AbleCommerce developers here because this code is kind of complicated.
I really need to solve this because it is holding me back. Thanks
When adding the product to the Cart, I can check for the Product Template
"Personalization" (ID 4 in the database):
Code: Select all
if (_Product.ProductTemplateId == 4)
{
// find the TextBox when adding to cart and check if
// it is not empty
// If TextBox has text:
// add a product : "Engraving - $9.99" to cart
}
I would need to add another product, the $9.99 for the Engraving charge, to the Cart.
I know this can be done because if you add a product with Personalization (a TextBox)
to the Cart and you DON'T add text to it, it will increase the Quantity of that same product
if it is already in the cart. But if there is text, it will be a different item with a Quantity of one.
The name of the Product Template is shown in the Cart like: "Personalization:", . .
so there has to be some way to check for the contents of that textbox.
I'll need the help of AbleCommerce developers here because this code is kind of complicated.
I really need to solve this because it is holding me back. Thanks
Re: How to add Engraving option and Price for it
I think this might do it (in ProductHelper.cs):
I tried using a Session variable but they are not working here.
Gave "Object not found" when I tried to read it. I even tried this:
System.Web.HttpContext.Current.Session["Engraving"] = itemInput.InputValue.Trim();
I need someway of flagging this and then adding "Engraving $9.99" to cart.
Any ideas?
Code: Select all
public static void CollectProductTemplateInput(OrderItem item, Control container)
{
.....
ProductTemplate template = item.Product.ProductTemplate;
if (template != null)
{
......................
//SEE IF WE CAN LOCATE THE CONTROL
WebControl inputControl = (WebControl)PageHelper.RecursiveFindControl(container, input.UniqueId);
if (inputControl != null)
{
OrderItemInput itemInput = new OrderItemInput();
itemInput.Name = input.Name;
itemInput.InputValue = input.GetControlValue(inputControl);
********* ADDED ***************************************
if (product.ProductTemplateId == 4)
{
if (itemInput.InputValue.Trim() != "")
{
// **** NEED TO SET A FLAG TO ADD "ENGRAVING $9.99" TO CART
// Session[Engraving] == "True";
}
}
item.Inputs.Add(itemInput);
}.........
Gave "Object not found" when I tried to read it. I even tried this:
System.Web.HttpContext.Current.Session["Engraving"] = itemInput.InputValue.Trim();
I need someway of flagging this and then adding "Engraving $9.99" to cart.
Any ideas?
Re: How to add Engraving option and Price for it
I think you wantMike718NY wrote:Code: Select all
********* ADDED *************************************** if (product.ProductTemplateId == 4) { if (itemInput.InputValue.Trim() != "") { // **** NEED TO SET A FLAG TO ADD "ENGRAVING $9.99" TO CART // Session[Engraving] == "True"; } } item.Inputs.Add(itemInput); }.........
Code: Select all
Session["Engraving"] = "True";
Code: Select all
System.Web.HttpContext.Current.Session["Engraving"] = "True";
Also, you will need to watch the type of value. You're assigning a string "True" as opposed to the boolean value of true.
Re: How to add Engraving option and Price for it
thanks ZLA, . . I actually had the code right, . . I just made a typo in the post with the " = =" and the missing "".
Re: How to add Engraving option and Price for it
This is not going to work after all.
I figured out how to add the "Engraving $9.99" product to the cart when the Personalization template is used (detected), but the user could just delete it from the cart and that would be a problem.
I'm stuck now. I can't go any further with this new cart.
The Engraving feature is a must with this cart.
I figured out how to add the "Engraving $9.99" product to the cart when the Personalization template is used (detected), but the user could just delete it from the cart and that would be a problem.
I'm stuck now. I can't go any further with this new cart.
The Engraving feature is a must with this cart.