Charging a fee for Personalization using a TextBox.

Post feature requests to this forum and a pre-configured poll will automatically be created for you.
Post Reply
Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Charging a fee for Personalization using a TextBox.

Post by Mike718NY » Wed Jul 29, 2009 8:05 am

If I add a Textbox template (in Catalog, Product Templates)
there is no way I can charge a fee for this.

If a customer wants some Personalization (engraving, custom printing, etc, . .)
they are usually charged for this.
But the Textbox just appears and there is no way to apply a charge for it if it is used.

I would think this would be a very popular and useful feature.

The website I'm converting over to AC7 uses Engraving on most items and
I know I need this feature right now before I purchase this product again:
viewtopic.php?f=42&t=11853

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Charging a fee for Personalization using a TextBox.

Post by ZLA » Wed Jul 29, 2009 9:16 am

This is not out of the box but the following customization might work.

Add an option for No Engraving / Engraving (+ $9.99) and add a product template field for the personalization text.
Then in BuyProductDialog conlib and / or ProductHelper.cs, put in code that adds javascript to the Engraving drop down that enables / disables the personalization text field. (It should probably blank out the field if no engraving is selected.)

Even better (though I'm not sure where), you can probably create some global javascript routine to add the necessary javascript routine on any product page so you wouldn't even need to modify the code behind. Just add a javascript routine at the bottom of every page to search for the necessary Engraving dropdown and matchin personalization.

You need to worry about element id naming and existence of elements but I think this is pretty doable. Good Luck!

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: Charging a fee for Personalization using a TextBox.

Post by Mike718NY » Wed Jul 29, 2009 9:35 am

Thanks ZLA, . . that's a good idea.
I'm far from a JavaScript wizard though, . . that's why I was looking server side.

ZLA
Commodore (COMO)
Commodore (COMO)
Posts: 496
Joined: Fri Mar 13, 2009 2:55 pm

Re: Charging a fee for Personalization using a TextBox.

Post by ZLA » Wed Jul 29, 2009 9:52 am

If you go with my concept you'll still need some javascript. But injecting it from code behind means you'll know the correct element ids to use.

Here's a link on the javascript side of it: http://www.webmasterworld.com/javascript/3193661.htm. I would suggest the following:
  • put a javascript routine into the HEAD section of the product pages defined something like this:

    Code: Select all

    function popupProductHTML(textboxClientId) {
    // disable code goes here
    }
    
  • In the code behind, add code to the dropown's onchange event to call the function something like this:

    Code: Select all

    mydropdown.Attributes("onchange")="popupProductHTML('" + mytextbox.ClientId + "')";
    
I hope this helps.

User avatar
NC Software
AbleCommerce Partner
AbleCommerce Partner
Posts: 4620
Joined: Mon Sep 13, 2004 6:06 pm
Contact:

Re: Charging a fee for Personalization using a TextBox.

Post by NC Software » Wed Aug 05, 2009 12:41 pm

Neal Culiner
NC Software, Inc.

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: Charging a fee for Personalization using a TextBox.

Post by Mike718NY » Wed Aug 05, 2009 1:49 pm

Thanks Neal, . .
That really is the only option, but, . . there is a problem if the person doesn't check the box.
Not all people work on the "honor system" :roll:

Plus if some people forget to check the box you have to notify them and then charge an additional amount.

It took a long time to figure out, but I was able to
check for text in the textbox and then these condition:

1. Engraving has text but was not selected - add charge.
2. Engraving was selected but no text entered - remove charge.

I basically made it "idiot proof".

User avatar
NC Software
AbleCommerce Partner
AbleCommerce Partner
Posts: 4620
Joined: Mon Sep 13, 2004 6:06 pm
Contact:

Re: Charging a fee for Personalization using a TextBox.

Post by NC Software » Wed Aug 05, 2009 2:04 pm

I agree, we just have to monitor the orders as there is no way to validate it without the javascript as suggested. Amazingly I haven't had anyone miss it yet having been live since July 1st.
Neal Culiner
NC Software, Inc.

Mike718NY
Commodore (COMO)
Commodore (COMO)
Posts: 485
Joined: Wed Jun 18, 2008 5:24 pm

Re: Charging a fee for Personalization using a TextBox.

Post by Mike718NY » Wed Aug 05, 2009 3:14 pm

>> no way to validate it without the javascript as suggested.

I did it all in the code-behind. Not JavaScript. I'm not good at JavaScript, or care to be.
It's safer in the code-behind too - it's validated on the server.

User avatar
igavemybest
Captain (CAPT)
Captain (CAPT)
Posts: 388
Joined: Sun Apr 06, 2008 5:47 pm

Re: Charging a fee for Personalization using a TextBox.

Post by igavemybest » Tue Aug 18, 2009 2:13 pm

Why dont you just addit as a seperate varient and have them leave it in the notes section after checkout?

Post Reply