advanced-custom-fields

Display product ACF value in Woocommerce admin email notifications

徘徊边缘 提交于 2019-12-11 07:57:27
问题 Trying to get an advanced custom field in a woocommerce product to pass to the new order email for the admin. It's only there for the admin reference and is specific to each product. I have tried and this gets it to the backend but not in the email. add_action( 'woocommerce_before_order_itemmeta', 'product_size', 10, 3 ); function product_size( $item_id, $item, $product ){ // Only in backend Edit single Order pages if( current_user_can('edit_shop_orders') ): // The product ID $product_id =

WooCommerce: Get Json data in multi-dimensional array matching ACF custom field

坚强是说给别人听的谎言 提交于 2019-12-11 07:44:24
问题 I am trying to get data from this json file, but I need the data that matches the advanced custom field I setup. $str = file_get_contents('http://gold.explorethatstore.com/wp-content/themes/divi-ETS-child-theme/run_results_bgasc.json'); // decode JSON $json = json_decode($str, true); // default value $coinPrice = "Not Available"; $vendorName = get_field('bgasc_vendor_name'); // loop the json array foreach($json['coin'] as $value){ // check the condition if($value['coin_name'] == $vendorName){

Bootstrap Modal and AFC Repeater field

主宰稳场 提交于 2019-12-11 07:01:02
问题 I have a client logo area on my website coming from an Advanced Custom Fields repeater, when clicked, I would like a modal window to pop up with the rest of the info I included in the repeater fields. Each client has a logo, title, case study and testimonial. I have managed to get the logos to display in a nice grid, but I'm having some trouble with the modal popping up on click... Here's my code: <div style="background-color:#ffffff;width:100%;"> <div class="container margin-top-20" > <div

ACF - Display image from Custom Post Type custom Category

岁酱吖の 提交于 2019-12-11 05:42:02
问题 I have a problem and I believe the answer lies here: https://www.advancedcustomfields.com/resources/get-values-from-a-taxonomy-term/ But I cant figure out how to apply it to my code... I have used Advanced Custom Fields to add an image field inside the categories of a custom post type. My custom post type is call Short Courses, and the category name is Course Types. Here's the loop: <?php $customPostTaxonomies = get_object_taxonomies('short_courses'); if(count($customPostTaxonomies) > 0) {

Display product custom fields in cart next to each item name in Woocommerce

无人久伴 提交于 2019-12-11 05:26:33
问题 I have a store where each product has different delivery date. I have this date stored in a custom field called shpng using ACF. What I'm trying to achieve is to display appropriate field next to each product in cart. What I tried so far is that I tested approximately 10 solutions listed on SOF (example) and on the other sites, but none of them seems to work. I know how to display this data, I just don't know how to display it for each product below product title. I'm looking for someone to

Woocommerce: Customizing the availability of a category

血红的双手。 提交于 2019-12-11 05:20:55
问题 I have many products nested within parent categories in WooCommerce. I want to be able to apply a custom field where I can specify a time availability for categories as a admin feature only in Back end. Theory: Back end - On each parent category I will have this custom field where I can type or choose a time frame : for example 11:00-17:00 . Front end: During this time frame , users will be able to browse all the products within that category. Outside of this time frame all the products

Development flow - Wordpress Advanced Custom Fields

血红的双手。 提交于 2019-12-11 01:47:02
问题 Just wondering what are peoples development flow when using the Advanced Custom Fields plugin for Wordpress? I have my local dev, a staging site and production. What is the best way to add the fields I created locally to staging and eventually production. Adding them via the interface on staging and production seems a hassle. I've looked at exporting field groups - but is there a chance that the field_ids will get out of sync? thanks. 回答1: Create a folder in the root of your WordPress theme

add_row in ACF Pro isn't saving repeater values

本小妞迷上赌 提交于 2019-12-11 00:18:38
问题 My Situation I'm using Advanced Custom Fields Pro to store metadata for a post in wordpress. My posts are created dynamically (not through the administrative interface), which means that I explicitly need to populate metadata using field keys, not field names. One of my fields is a repeater field with a single text area and another is a standard text area. My Code The following code is what I call (once per post). The post is created using wp_insert_post() earlier. // Populate "Name" update

How to get Advanced Custom Field choice value from another Advance Custom Field?

断了今生、忘了曾经 提交于 2019-12-10 22:15:54
问题 I have created two custom fields using Advanced Custom Field plugin. I want it to behave like when I insert value in one text field, it should be filled in the another field which is a choice field. This image is an example where I am inserting Name value and slug value. I want it to return this. 回答1: To auto populate select fields in ACF, you can use the load_field function - see more here: http://www.advancedcustomfields.com/resources/acfload_field/ So, let's say your select field name was

How to display an acf field from a user profile?

岁酱吖の 提交于 2019-12-10 19:09:08
问题 I currently have an advanced custom field setup in the user's profile with a field name of author_title . This would display what the user does at the company blog. I currently have the following working but the title only updates for first user and all users get that title instead of being able to use their own. Updated <?php $current_user = wp_get_current_user(); ?> <h3><?php the_field('author_title', 'user_' . $current_user->ID); ?></h3> 回答1: Try to get user ID in another way. Now you get