Create custom Product Properties
-
Hi, I am trying to add field ids (called short codes in the plugin) to the list of product properties in the window where I am asked to select an attribute. This after clicking the magnifying glass in the list of feed attributes under edit profile. see screenshot in the link https://1drv.ms/i/s!AjKqbrKOcXEmluETtcAa4pzJ3NxUxA?e=otUtXz. I have added fields in the product data area in woocommerce, but they don’t automatically show up in the list.
Thanks,
Christopher
-
Hi @clembke
Thanks for contacting support.
Are those global product attributes in Woocommerce or custom product attributes created in the edit product page?
WP-Lister only supports global product attributes, which you can learn more about if you are unfamiliar here: https://rextheme.com/create-global-product-attribute-woocommerce/
Kind regards
Thank you for your response. As you can see from the screen shot it is not Attributes I am referring to, but “Product Properties”, as they are defined as in the plugin. Please look at the screen shot I link to in the original post to see what I mean. Thanks,
Hi @clembke
Thanks for that information, but those cannot be modified. Those are out of the box fields in WP-Lister as well as Woocommerce.
If you want to provide custom values they need to be from either a product attribute or from a custom meta field.
Kind regards,
John
How do I create a custom meta field? I thought that is what I was doing by putting the code below in the Functions file:
// Display Fields
add_action(‘woocommerce_product_options_general_product_data’, ‘woocommerce_product_custom_fields’);
// Save Fields
add_action(‘woocommerce_process_product_meta’, ‘woocommerce_product_custom_fields_save’);
function woocommerce_product_custom_fields()
{
global $woocommerce, $post;
echo ‘‘;
// Dosage
woocommerce_wp_text_input(
array(
‘id’ => ‘dosage_form’, ‘placeholder’ => ‘Capsules, pills, powder, etc.’, ‘label’ => (‘Dosage for Amazon’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); //Unit count woocommerce_wp_text_input( array( ‘id’ => ‘_unit_count’, ‘placeholder’ => ‘Unit Count’, ‘label’ => (‘Unit Count’, ‘woocommerce’), ‘type’ => ‘number’, ‘custom_attributes’ => array( ‘step’ => ‘any’, ‘min’ => ‘0’ ) ) ); // Ingredient 1 woocommerce_wp_text_input( array( ‘id’ => ‘_ingredient_one’, ‘placeholder’ => ‘Ingredient’, ‘label’ => (‘Ingredient 1’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Ingredient 2 woocommerce_wp_text_input( array( ‘id’ => ‘_ingredient_two’, ‘placeholder’ => ‘Ingredient’, ‘label’ => (‘Ingredient 2’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Ingredient 3 woocommerce_wp_text_input( array( ‘id’ => ‘_ingredient_three’, ‘placeholder’ => ‘Ingredient’, ‘label’ => (‘Ingredient 3’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Key Product Features 1 woocommerce_wp_text_input( array( ‘id’ => ‘_key_product_features_one’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => (‘Key Product Features 1’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Key Product Features 2 woocommerce_wp_text_input( array( ‘id’ => ‘_key_product_features_two’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => (‘Key Product Features 2’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Key Product Features 3 woocommerce_wp_text_input( array( ‘id’ => ‘_key_product_features_three’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => (‘Key Product Features 3’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Key Product Features 4 woocommerce_wp_text_input( array( ‘id’ => ‘_key_product_features_four’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => (‘Key Product Features 4’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Key Product Features 5 woocommerce_wp_text_input( array( ‘id’ => ‘_key_product_features_five’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => (‘Key Product Features 5’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); //Directions For Use woocommerce_wp_textarea_input( array( ‘id’ => ‘_directions’, ‘placeholder’ => ‘Directions for use’, ‘label’ => (‘Directions for use’, ‘woocommerce’) ) ); // Flavour woocommerce_wp_text_input( array( ‘id’ => ‘_flavour’, ‘placeholder’ => ‘Flavour’, ‘label’ => (‘Flavour’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Intended Use 1 woocommerce_wp_text_input( array( ‘id’ => ‘_intended_use_one’, ‘placeholder’ => ‘Intended Use’, ‘label’ => (‘Intended Use 1’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Intended Use 2 woocommerce_wp_text_input( array( ‘id’ => ‘_intended_use_two’, ‘placeholder’ => ‘Intended Use’, ‘label’ => (‘Intended Use 2’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Intended Use 3 woocommerce_wp_text_input( array( ‘id’ => ‘_intended_use_three’, ‘placeholder’ => ‘Intended Use’, ‘label’ => (‘Intended Use 3’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Intended Use 4 woocommerce_wp_text_input( array( ‘id’ => ‘_intended_use_four’, ‘placeholder’ => ‘Intended Use’, ‘label’ => (‘Intended Use 4’, ‘woocommerce’), ‘desc_tip’ => ‘true’ ) ); // Intended Use 5 woocommerce_wp_text_input( array( ‘id’ => ‘_intended_use_five’, ‘placeholder’ => ‘Key Product Features’, ‘label’ => _(‘Intended Use 5’, ‘woocommerce’),
‘desc_tip’ => ‘true’
)
);Hi @clembke
We don’t provide coding level support to lite users, only pro users.
But to answer your question, it depends.
If this is in regard to custom meta fields for variations, there is a section at the bottom of the advanced settings page of WP-Lister labelled ‘Custom Variation Meta’. Insert your label for the field in the ‘Field label’ then insert the meta key, which would just be the field label but all lowercase and hyphens for spaces, then save.
After doing that, that label will show up as a field in each variation of the edit product page. Simply insert the proper values in each field within each variation.
After that, browse to the listing profile in WP-Lister, locate the field you wish to provide the values for, click the magnifying glass to the right of the field, then select the custom meta option. That will insert the meta shortcode into the field of the listing profile. Then all you need to do is edit the shortcode to include your field label name.
If you simply want to create custom meta fields, that can be done right inside WordPress/Woocommerce.
With a plugin: https://docs.metabox.io/tutorials/add-custom-fields-woocommerce/
Or manually: https://www.cloudways.com/blog/add-custom-product-fields-woocommerce/
Kind regards,
John
Thanks John. I is the last link there that I used to create the code in the “functions.php” file. If I put in those “short codes” in the feed in the project, will the plugin pick up on them? I don’t have any variations on individual products so I am not sure the attributes would be a good option for me.
Hi @clembke
Sorry, I am not sure I follow your question.
Are you asking if the last link I provided can be used for simple listings and not variations? If yes, then the answer to that question is yes.
Kind regards,
John
Hi, I tried adding custom fields to the product post type. They show up in the post editing view, but do not show up in the list of “Product Properties” shortcodes available to use in the “profiles”, how can I tell the “WP-Lister Lite for Amazon” plugin to pick up these extra custom fields in the Woocommerce product post?
I am going to post my answer I provided in your new thread here as well in case others come across this thread.
If you are using ACF plugin, you can pull ACF fields by directly using the field names with a shortcode like [meta_brand] if your field was labelled “Brand”, [meta_manufacturer], if the field was “manufacturer”, etc… Please give that a try, it should work.
Kind regards,
John
- The topic ‘Create custom Product Properties’ is closed to new replies.