Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Paypal Custom Field With System Generated Data
- This topic has 10 replies, 2 voices, and was last updated 14 years, 5 months ago by amin007.
-
AuthorPosts
-
May 25, 2010 at 2:23 am #1252studiousMember
I have a template that I made that hides the add to cart button until a set of questions are answered and terms agreed to.
I need a way to record that data against the purchase for legal reasons. Is there a way of pushing my own data into the custom field so that the IPN returns with it?
I don’t care where it is store I just need a record
Regards,
Stuart
May 25, 2010 at 8:35 am #20931amin007ParticipantYou just have to append it to the product name when the form gets submitted using JavaScript.
The name of the product is stored in a hidden field called “product” so you will need to append the text to the value of that field and it will get recorded as it will stay with the product name.
May 27, 2010 at 1:51 pm #20932studiousMemberWhich form should I modify?
Do I add it to the add to cart button? I started to do that but then realised when I looked at the shopping cart that the name I had added didn’t seem to make it through, but I don’t know if it should or shouldn’t show there.
I need to make sure I am adding it only if they have agreed to all the questions (I submit the form back on itself, validate, then show the add cart button using a filter on the_content)
Thanks
May 28, 2010 at 12:20 am #20933amin007ParticipantYou don’t have to modify any code on the eStore. The “Add to Cart” button is a form. This form has a hidden input field called “product” which holds the value of the product name.
When your form gets submitted you need to have a JavaScript that you attach to the onSubmit method of your form. This JavaScript needs to do something smart and change the value of the “product” field on this page to append a text.
June 1, 2010 at 4:05 pm #20934studiousMemberThanks Amin.
I did understand about using javascript and not modifying your files.
What’s the difference between ‘product’ and ‘product_name_tmp1’?
If I alter ‘product_name_tmp1’ using javascript I see the name in the shopping cart and in paypal. If I alter ‘product’ I don’t see evidence of it being recorded or passed anywhere even in source view, I also don’t see it in the database.
The only place I need to see anything is in the admin area against the purchase but I don’t see an ‘orders’ panel. (I kinda missed the bit where your product was meant only for digital downloads, I was kinda hoping for an orders pane with the ability to see all the items to ship and also be able to check off when the order was shipped. In that pane I would have liked to have seen the record of whether the customer had agreed or not.)
To sum up, is it correct that right now I can only change the name using ‘product_name_tmp1’ and that the client will also see this name in the interface?
Kindest regards,
Stuart
June 2, 2010 at 6:11 am #20935amin007Participant“product_name_tmp1” is just a temporary variable that has it’s usage. You need to change the value of the “product” input field. If you can change it then when they add the product to the shopping cart, the cart will have this new name.
For example if the name of the product is “Test Product” then the value of the “product” field will be “Test Product”. Now if you modify it and give it the following name
“Test Product (some custom text)” then when you add the product to the cart it will use this new name.
June 3, 2010 at 7:04 am #20936studiousMemberAha,
I had to trace your javascript. ReadForm1 takes product_name_temp1 and adds other things together then places that in product
I was setting product before ReadForm1 and it was getting overridden with a regular product_name_temp1. So if I set product_name_temp1 to my value (as I do now) then product gets set correctly inside ReadForm1.
Phew, I couldn’t work out why it was working opposite to what you were saying. I was setting it before submission.
Regards,
Stuart
June 13, 2010 at 7:30 am #20937studiousMemberI’ve noticed that the name ‘product’ value is not recorded in the database and is only used in the emails, it looks like only the product_id is recorded.
I know this is more a feature request but are you looking at providing an ‘order management’ page? For my client I would like to see a whole order (including ‘product’ name) in one place, nice and easy.
I was thinking of making a plugin to make my own view of the data but first and foremost the IPN data is treated in WPeStore and without the modified ‘product’ name being recorded it wouldn’t entirely suit my purposes for legal records. If you were to record at least that data in the customer table I could view by TXN and show each cart item (with modified name) nicely.
Regards,
Stuart
June 14, 2010 at 4:05 am #20938amin007ParticipantI am expanding the customer’s database to add the “Product Name” and “Customer’s address” so once I am done with this you should be fine (I should have it implemented in a few days)
June 14, 2010 at 11:38 am #20939studiousMemberThat’s awesome!!!
June 15, 2010 at 2:00 am #20940amin007ParticipantI have added this to the plugin so please request an update and you should have it.
-
AuthorPosts
- You must be logged in to reply to this topic.