Special instructions field
I created a new field for my products called category and I set up my test site's order page as a view that displays all items from a particular category in a table:
View:
Table:
I'm trying to find a way to add a button that pops up a text field that the customer can enter any special instructions they may want the store owner to know about that particular item (engraving instructions ect.)
Anyone have any idea where to start?
Thanks!
=>switch<=
Comments
Commerce Product Options may
Commerce Product Options may help you setting up a field for collecting further informations/instructions.
-> http://drupal.org/project/commerce_option
But I don't know how to pop it up on "Add to Cart" klick.
Field on line item
That's a field on the line item. Just use the interface to add a field and mark it as something to be displayed with the add-to-cart field. If you're using a custom line item, you'll currently need http://drupal.org/node/1284236 with views. See http://www.drupalcommerce.org/node/973#comment-2102.
Thanks guys
Very helpful, still learning the ins and outs of this.
got the jquery working too...
Here are my steps:
1. Configure store>Line item types>manage fields
2. Add new field>Label:Special instructions Field name:instructions field type: Long text
3. Check the Add to cart form setting box on the next screen
4. Created a .js file to have that field be hidden at the start and toggle on and off when the Special instructions label is clicked with the following code:
(function ($) {
// Store our function as a property of Drupal.behaviors.
Drupal.behaviors.mySpecialFeature = {
attach: function (context, settings) {
// Your jQuery code here
$(".field-name-field-instructions .form-textarea-wrapper").hide();
$(".field-name-field-instructions label").addClass("special-instructions-jquery");
$(".special-instructions-jquery").click(function() {
$(this).next(".field-name-field-instructions .form-textarea-wrapper").toggle("slow");
});
}
};
}(jQuery));
5. Called that .js file in the theme's .info file (this case mysite>themes>bartik>bartik.info) by placing the following line of code a the bottom of the .info file:
scripts[] = the-name-of-my-jquery-file.js
just realized i wrote intructions...
Could you give me access to change my original posts on the forum or fix that for me Randy?
Thanks!
Granted the "edit own" privilege
I just granted the "edit own forum posts" privilege to auth users, so you should be able to fix anything you want. Thanks!