How to add properties to Woocommerce account? - wordpress

I would like to add some properties to my accounts in woocommerce (ie: eyes color)
In the codex, I've found solutions to add fields into checkout but I do not need these informations in checkout, I want them editable into the account page.
Is there a programmatically solution (or a plugin) ?

You need to create custom user field using update_user_meta function . Please read
https://codex.wordpress.org/Function_Reference/update_user_meta
or read this
https://support.woothemes.com/hc/en-us/articles/203182373-How-to-add-custom-fields-in-user-registration-on-the-My-Account-page

Related

How to add text field in custom post without plugin and without using custom field

I'm new to WordPress and doesn't much about it. I am making property listing plugin for WordPress I want to add Price field/(numeric type)
.I don't want to use plugin and custom fields. I want the field as shown
You can use a metabox to add a new box to the Admin Frontend. If its done, you need a filter to handle the inputs value for the backend. For more detailed helped, you need to provide more informations about your plugin.
See: https://developer.wordpress.org/reference/functions/add_meta_box/

How to add attributes for a Simple Product on Checkout Page?

Been trying to figure out how to add attributes... for example the size of a product on the checkout page of woocommerce for wordpress. Seems simple enough, but all searches I do on this point me to how to add custom fields to woocommerce using hooks. But I don't want a custom field. I just want to add in the size attribute for Simple Products on the checkout page only so people are reminded of the size... can someone point me in the right direction please?
You can add attributes from admin side. There is no need to use any hooks for this. In admin side go to products->products and edit the product for which you want to add attribute. There below the product description you will find attributes tab there you can add your custom product attribute.
And you can also create common attribute for all the products from Products->Attributes. Here Add New Attribute and after saving it click on configure terms button to add attribute value

Restrict editing some post custom fields - wordpress

In my website there is a master admin and some editors.
Each editor can edit and fill some custom fields too (meta boxes added by Meta Box plugin APIs) but I need to restrict editing and showing some custom fields to that group but didn't found anything related to this topic.
any help will be appreciated.
There are two free plugins that will work together to accomplish this, and more...
The first plugin is Advanced Custom Fields: http://wordpress.org/plugins/advanced-custom-fields/
Advanced Custom Fields lets you create and assign groups of custom fields to specific user roles or post types.
The second plugin is the Members plugin which extends and allows customization/creation of user roles: http://wordpress.org/plugins/members/ .
How it works. Use the Members plugin to create a new user role with the same (or whatever you like) permissions as Editor, call them 'Editors Plus'. Then use Advanced Custom Fields to create a custom field group that only 'Editors Plus' can access. IE: Show this field group if: 'User', 'is equal to', 'Editor Plus'. All of it happens via easy GUIs.
Register a new role with help of this link:
http://codex.wordpress.org/Function_Reference/add_role
and then apply authentication to this whatever you want.
thanks.

WooCommerce: Add meta on checkout (for the product)

I have a question regarding WooCommerce.
In the last step of the checkout, I want to add some meta information to the product. Basically, at the end of the checkout process the user can choose to offer the product to a friend. He will enter fields such as friend's email, name...
I want to be able to retrieve this information in the admin panel when I click on the details of the order, in the "product" block.
... And I have to idea how to do that. I found some information on how to add custom fields to the order, but how do I add information to the product in the order and not the order itself?
Thank you. I'm in a bit of a blur right now.
Mike Jolley posted the complete code you can insert in your theme's functions.php
I recently used it and works like a charm.
https://gist.github.com/mikejolley/1604009
I think the Woothemes Product Add-ons plugin may be exactly what you are looking for. You can use it to add custom fields of nearly any type to your individual products. It will display them on the cart page and save them in your admin.
Woocommerce allow some hooks and filters to add fields on checkout pag, but yes it requires strong php knowleget. However there is plugin available here: Checkout option manager plugin

Wordpress: add a custom field option that's available to all posts

As part of my theme install, I'd like to add a set of custom field options to the wordpress database that would be available to all posts as long as my theme is active.
For example, I'd like to add these fields:
custom-image-1
custom-image-2
custom-image-3
And also these
custom-image-1-link
custom-image-2-link
custom-image-3-link
And then when a user goes to add or edit a post, they can insert values for each of these fields if they choose to...
You simply have to create a post and add these custom fields once to have them proposed for every next posts (in the custom fields part of the form).
If you need to create a more integrated interface for these extra fields, you might be better off creating a plugin or looking for existing ones, such as this one.
Use the add_meta_box function that comes with WordPress.
https://developer.wordpress.org/reference/functions/add_meta_box/

Resources