E-junkie Ecommerce Forums » E-junkie Discussions
Tag Cloud for this topic: | |
| |
|
vizioneer member Posts: 5 |
My shopping cart needs to collect two text fields (call them txt1 and txt2) when any item is ordered. To do this, I have a custom "add to cart" button for each item which pops up a new window when clicked, in which I collect txt1 and txt2. This data is then submitted to the e-junkie shopping cart appended to the necessary URL. The cart comes up fine (not an overlay but OK), and I can process orders. However, I haven't been able to get "View Cart" to work with your standard code. I've put it (and its code) on the same page as the "add to order" buttons, but the cart always comes up empty even if I put items in it. I think this is because the view cart button and code aren't in the same window as the add to cart code. Am I right? If so, is there any way I can still display the cart contents? # POSTED ON: January 13, 2012 @ 20:56 GMT -7 |
|
E-junkieNinja E-Junkie Crew Posts: 753 |
Can you post the URL of your sales page so we can take a look at the code? # POSTED ON: January 14, 2012 @ 11:22 GMT -7 |
|
vizioneer member Posts: 5 |
I've duplicated and exdplained the problem on a simple test page at http://www.mindsparkinc.com/buttons_test.html Thanks for taking a look. # POSTED ON: January 14, 2012 @ 18:51 GMT -7 |
|
E-junkieGuru E-Junkie Crew Posts: 4349 |
The usual way of passing text values to the cart as product options would use our Variations feature to put text fields next to the Add to Cart button itself: http://www.e-junkie.com/ej/help.variants.htm That said, the specific issue you're seeing is that your custom script is adding the item to a cart without invoking our View Cart box.js script, so the cart is displaying in a full window under the e-junkie.com domain in that case. When the View Cart code including our box.js script is present in the page source, our standard Add to Cart and View Cart button codes display the cart as an overlay "inside" your page, under your own domain. These two versions of the cart display necessarily get treated as separate carts because we set a cookie in the buyer's browser to keep track of their cart contents, and cookies must be set as associated with a specific domain. # POSTED ON: January 15, 2012 @ 20:13 GMT -7 |
|
vizioneer member Posts: 5 |
Thanks. Makes sense. I'll use the standard Variations approach instead. Is there any way I can integrate a description of the required text input, like I do in my current scheme, by modifying your script? If not, that would be a nice feature on your end. # POSTED ON: January 16, 2012 @ 07:14 GMT -7 |
|
E-junkieGuru E-Junkie Crew Posts: 4349 |
You could simply include the descriptive text on your site's page wherever you paste the Add to Cart button code, or you could use the initial Add to Cart button image to make a simple link to another page where the description would be posted along with the real Add to Cart button code with Variations fields. # POSTED ON: January 16, 2012 @ 18:13 GMT -7 |
|
vizioneer member Posts: 5 |
One more question - I have been trying to implement validation of my two variation text fields, to make sure they both have entries when the form is submitted to e-junkie. The button code e-junkie gives me is: <form action="https://www.e-junkie.com/ecom/gb.php?c=cart&i=G2G-DW-1YR&cl=101445& ejc=2" target="ej_ejc" method="POST" accept-charset="UTF-8"> <input type="hidden" name="on0" value="Desktop User Name"/> Desktop User Name:<br/> <input type="text" name="os0" maxlength="200"/> <br/> <input type="hidden" name="on1" value="Registration Email"/> Registration Email:<br/> <input type="text" name="os1" maxlength="200"/> <br/> <input type="image" src="http://www.e-junkie.com/ej/ej_add_to_cart.gif" border="0" alt="Add to Cart" class="ec_ejc_thkbx" onClick="javascript:return EJEJC_lc(this.parentNode);"/> </form> I then add form name="myForm" onSubmit="return validateForm()" in the form code. I also add validateForm() script which returns False if either text field is blank or null: function validateForm() { var x=document.forms["myForm"]["os0"].value; if (x==null || x=="") { alert("Desktop Name can't be blank!"); return false; } var x=document.forms["myForm"]["os2"].value; if (x==null || x=="") { alert("Registration Email can't be blank!"); return false; } } I would expect the onSubmit code to terminate the submit if either text field is blank. However, it seems like the e-junkie submit listener doesn't respond, and instead, the shopping cart displays (with blank text fields). Can you tell me what I'm doing wrong here? Should the validation code be able to terminate the e-junkie server before the cart displays? # POSTED ON: January 16, 2012 @ 19:12 GMT -7 |
|
E-junkieGuru E-Junkie Crew Posts: 4349 |
Unfortunately, help with custom javascript is beyond the scope of support we can provide. If you'd like to hire some help with that, we can recommend the competent, E-junkie-experienced developers listed in our directory: http://www.e-junkie.com/ej/developer-directory.htm # POSTED ON: January 17, 2012 @ 13:33 GMT -7 |
You must be logged in to make a post. Please click here to login. | |






