0

Good evening.

I want to be able to add a note to each item in the cart that is not editable by the customer.

I can get a note to appear in the form of a text box, however they are always writable.

I wondered if there is a way to disable the input on the View/Update cart page.

I am providing the note to the item via a little bit of PHP.

0

Its not foolproof but adding a hidden input would achieve what you seek. < input type=hidden name=note id=note value=yourPHPcode >

Then inject your php code into the value. Or just wrap whatever you like in a hidden div.

PS. You'll need to have a custom field in your orders channel that matches the hidden inputs name.

| improve this answer | |
  • Cheers Stuart, that's what I came up with as well by the end of yesterday, the only concern I have with that approach is that the details are visible in the 'view source code' section, Im not sure if it would cause a security issue with sales through cartthrob, but ill have a play about. :) – springboynick Jun 19 '13 at 9:39
  • As long as your field is set to format=none no script or nasties can be triggered. – stuartmcd69 Jun 19 '13 at 10:27
  • great. another query on this. im trying to pre select an option from a cartthrob item option drop down, but cannot for the life of me get it to do it, seems to always select first optuon .... any ideas? – springboynick Jun 20 '13 at 22:01
  • I recall we employed a simple JavaScript workaround as there's no native CT way to select an option. That being said, you may be able to use an if statement in your template if you know the value in advance. – stuartmcd69 Jun 21 '13 at 2:09
  • you know what im going to ask now. what java workround? does it alter the select? i was thinking of maybe querying the database directly to create my own select and other options then submitting on the fly with the add_to_cart function, not sure if thats possible or potentially a security issue – springboynick Jun 21 '13 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.