I trying to add some custom fields to crowdfunding(woocommerce) product.
The first field is called “Estimated Unit profit” and is the estimated unit profit
The second field is “Total Estimated Profit” and is = Product quantity in cart x Estimated profit.
Theses fields have to use woocommerce currencies.
How can I achieve that? Can anyone help
Using the free version
Hello
I try to use function for order by stock status in my store catalog but this code drop ACF get_field() function
when function on, get_field return only ID of post (https://skr.sh/sGyfgZ3GwaP)
and when function off, all right, get_field return array (https://skr.sh/sGyHPC9UUOw)
please help me to find a reason
add_filter( 'posts_clauses', 'order_by_stock_status', 2000 );
function order_by_stock_status( $posts_clauses ) {
global $wpdb;
if ( is_woocommerce() && ( is_shop() || is_product_category() || is_product_tag() || is_product_taxonomy() ) ) {
$posts_clauses['join'] .= " INNER JOIN $wpdb->postmeta istockstatus ON ( $wpdb->posts.ID = istockstatus.post_id ) ";
$posts_clauses['orderby'] = " istockstatus.meta_value ASC, " . $posts_clauses['orderby'];
$posts_clauses['where'] = " AND istockstatus.meta_key = '_stock_status' AND istockstatus.meta_value <> '' " . $posts_clauses['where'];
}
return $posts_clauses;
}
Hello. I have a ACF custom user field with a default value.
My site uses Woocommerce. When a new customer purchases something a new account is created however the default value for my custom field is not auto saved to their profile.
If I view their profile and enter a value in the custom field it saves. Or if I use the add new user via WP it works. Its just via woo account creation it is not working.
Also, would be fantastic if customers could enter their own value for this at the checkout. I could not find documentation anywhere on how to add a custom user field to the woocommerce checkout page? I want it saved to user profile, not their order details.
Hi everyone
I am not an expert in programation and I have a e-commerce using Woocommerce, Elementor Pro and Astra theme. I would like to do something like next page where I can select product options (variations) from a accordiun menu. So, I found that the ACF PRO versium has options like “Image swatches”, “Color Swatches” and “Text Swatches” but I was not able to find any documentation about. So, I appreciate if you know where can I find documentation about those options, to know if I can use these to configurate that I want.
You can see that I want to do in next page: Please, see I can select the colours (from swatches colours options), Size, etc in an accordiun menu.
https://www.weareknitters.es/kits-tejer/rice-jumper
Attached a picture with ACF PRO options (in yellow) that I would like to know details.
Thanks in advance,
BP
I have a few custom fields that need to appear on a single WooCommerce category.
Is there any way of doing this? I was looking at https://www.advancedcustomfields.com/resources/adding-fields-taxonomy-term/ but “Taxonomy Term” (which I was then expecting you could select the individual category, isn’t in my list of Location options.
The following code works for displaying flexible content on standard wordpress posts/pages, but doesn’t show anything for woocommerce product archive pages.
<?php
// Check page_blocks exists.
if( have_rows('page_blocks') ):
echo '<div class="blockContent">';
// Loop through page_blocks rows.
while ( have_rows('page_blocks') ) : the_row();
// check text row layout
if( get_row_layout() == 'plain_text' ):
while( have_rows('plain_text_group') ): the_row();
$background_colour = get_sub_field('background_colour');
$spacing_before = get_sub_field('spacing_before');
$padding_before = get_sub_field('padding_before');
$text_alignment = get_sub_field('text_alignment');
$max_width = get_sub_field('max_width');
$plain_text = get_sub_field('plain_text');
endwhile;
if($plain_text):
//Do something with the plain text
endif; //if( $plain_text )
endif; //if( get_row_layout() == 'plain_text' )
// End loop.
endwhile; // while have_rows('page_blocks')
echo '</div><!--/.blockContent-->';
endif; // if have_rows('page_blocks')
?>
Is there something obvious I’m missing?
I’ve been researching the heck out of this, but can’t get the answer.
I am trying to add CSS background images to a bunch of container classes on an archive page (Shop), by calling on an image field I have set up in each product (ie. different image for each product).
I don’t want to touch the PHP theme files, so I am simply trying to find a way I can call a CSS background from whatever post IDs the ACF field is associated with (via inline head styles or functions).
As I understand it, this cannot be done by simply editing the usual CSS stylesheet, and I must use inline CSS.
This is what I have so far:
<style type="text/css">
.woocommerce .products .grid-common-col.post-32
{background-image: url(<?php the_field('my_image'); ?>);}
</style>
Of course, this doesn’t work. It at least needs to specify which post to get this from, since it is on an archive page, and not the post page to which the image field is uploaded. Even then, perhaps I have it all wrong and it still won’t work.
When ACF shortcodes are used, for instance, a (post_id=”32″) can be set. How do I specify the equivalent in this situation?
Either: inline CSS inserted via a code editor into the head, or a functions snippet to filter the PHP to make it possible – but not any solution that requires hard editing of the PHP theme file…
Would really appreciate any help.
I have looked at a lot of tutorials for adding fields to a product and displaying them on the front end. I can do this no problem. The issue I am struggling with is adding them as options and saving when viewing the cart and order pages.
I have a created a field group of Colors for a Tee shirt, I used the type ‘Checkbox’. How do I show the chosen value in the cart when the product is added and in the Order for the admin and emails?
I know that I can use built in WC Attributes for this one, but I will be creating a more robust form that will require more ACF fields. So I am trying to start basic.
Ciao Ragazzi Per un sito di Aste, avrei la necessità di visualizzare campi aggiuntivi.
Li ho creati con acf e nella creazione dell’oggetto vengono visualizzati, ma nel front end NO!
Utilizzo un tema Ibid ed ho provato anche ad agganciarli con un hooks MA NULLA NON SI VISUALIZZANO. Grazie anticipatamente
Hello,
I’ve created some custom fields to be used as product details on my woocommerce store.
I enter them by going on Elementor editor, select text editor > Dynamic tags > ACF Field > and I select the desired custom field. I’ve attached a screenshot of the process. After I click publish the custom fields used to appear on the front end.
However, since yesterday, after publishing, they no longer appear in the front end.
Can you please advice a solution?
Thank you.
Hi all,
I’ve 5 acf custom block.
I’d like to manage “current” wordpress’s blocks displaying if specific plugin is active.
For my first four acf custom block no problem i can manage.
But for the last one i can’t manage it by this code :
function my_allowed_block_types( $block_editor_context, $editor_context ) {
return array(
'core/heading',
'core/image',
'core/paragraph',
'core/spacer',
'core/gallery',
'core/list',
'core/audio',
'core/file',
'core/video',
'core/table',
'core/buttons',
'core/columns',
'core/media-text',
'core/separator',
'core/quote',
'core/html',
'core/embed',
'acf/diaporama',
'acf/prix-services',
'acf/block-line',
'acf/intro',
'acf/custom_btn',
);
}
if(!is_plugin_active('woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php')){
add_filter( 'allowed_block_types_all', 'my_allowed_block_types',10,2);
}
The code for my custom block is :
function register_blocks_btn() {
if( ! function_exists( 'acf_register_block_type' ) )
return;
acf_register_block_type( array(
'name' => 'custom_btn',
'title' => __( 'Call To Action'),
'render_template' => WP_CONTENT_DIR.'/mu-plugins/inc/custom-block/custom_btn/render_template/template_btn.php',
'category' => 'common',
'icon' => 'format-gallery',
'mode' => 'preview',
'keywords' => array( 'call to action', 'cta', 'bouton','lien'),
'post_types' => array('post','page'),
));
}
add_action('acf/init', 'register_blocks_btn' );
function field_btn(){
acf_add_local_field_group(array(
'key' => 'group_62664383cb2be',
'title' => 'Positionnement',
'fields' => array(
array(
'key' => 'field_62664389bf461',
'label' => 'Lien de votre bouton',
'name' => 'lien_de_votre_bouton',
'type' => 'link',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array(
'key' => 'field_62664cf80b5c6',
'label' => 'intitulé du bouton',
'name' => 'btn_txt',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
'location' => array(
array(
array(
'param' => 'block',
'operator' => '==',
'value' => 'acf/custom-btn',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => 0,
));
}
add_action('acf/init', 'field_btn');
function register_blocks_btn() {
if( ! function_exists( 'acf_register_block_type' ) )
return;
acf_register_block_type( array(
'name' => 'custom_btn',
'title' => __( 'Call To Action'),
'render_template' => WP_CONTENT_DIR.'/mu-plugins/inc/custom-block/custom_btn/render_template/template_btn.php',
'category' => 'common',
'icon' => 'format-gallery',
'mode' => 'preview',
'keywords' => array( 'call to action', 'cta', 'bouton','lien'),
'post_types' => array('post','page'),
));
}
add_action('acf/init', 'register_blocks_btn' );
function field_btn(){
acf_add_local_field_group(array(
'key' => 'group_62664383cb2be',
'title' => 'Positionnement',
'fields' => array(
array(
'key' => 'field_62664389bf461',
'label' => 'Lien de votre bouton',
'name' => 'lien_de_votre_bouton',
'type' => 'link',
'instructions' => '',
'required' => 1,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
),
array(
'key' => 'field_62664cf80b5c6',
'label' => 'intitulé du bouton',
'name' => 'btn_txt',
'type' => 'text',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'default_value' => '',
'placeholder' => '',
'prepend' => '',
'append' => '',
'maxlength' => '',
),
),
'location' => array(
array(
array(
'param' => 'block',
'operator' => '==',
'value' => 'acf/custom-btn',
),
),
),
'menu_order' => 0,
'position' => 'normal',
'style' => 'default',
'label_placement' => 'top',
'instruction_placement' => 'label',
'hide_on_screen' => '',
'active' => true,
'description' => '',
'show_in_rest' => 0,
));
}
add_action('acf/init', 'field_btn');
I have this code that removes the cancel button on a WooCommerce subscription based on the product ID. I want to have it work depending on a whether a custom field is true/false. The custom field is: $remove_cancel = get_field(‘remove_cancel’);
The code that works (I’ve tested) using the product ID is:
function eg_remove_my_subscriptions_button( $actions, $subscription ) {
$is_my_product = false;
$specific_products = array( 134 );
if ( sizeof( $subscription_items = $subscription->get_items() ) > 0 ) {
foreach ( $subscription_items as $item_id => $item ) {
$product = $item->get_product();
if ( in_array( $product->get_id(), $specific_products ) ) {
$is_my_product = true;
break;
}
}
}
if ( !$is_my_product ) return $actions;
foreach ( $actions as $action_key => $action ) {
switch ( $action_key ) {
case 'change_payment_method': // Hide "Change Payment Method" button?
// case 'change_address': // Hide "Change Address" button?
case 'switch': // Hide "Switch Subscription" button?
case 'resubscribe': // Hide "Resubscribe" button from an expired or cancelled subscription?
case 'pay': // Hide "Pay" button on subscriptions that are "on-hold" as they require payment?
case 'reactivate': // Hide "Reactive" button on subscriptions that are "on-hold"?
case 'cancel': // Hide "Cancel" button on subscriptions that are "active" or "on-hold"?
unset( $actions[ $action_key ] );
break;
default:
error_log( '-- $action = ' . print_r( $action, true ) );
break;
}
}
return $actions;
}
add_filter( 'wcs_view_subscription_actions', 'eg_remove_my_subscriptions_button', 100, 2 );
Any idea on how to make it work with a custom field the user toggles on the product for true/false?
I am working on a Woocommerce Costumization and am struggling with a Post Object
type field. (Reference here: https://www.advancedcustomfields.com/resources/post-object/).
Basically, in the product creating page I have a custom field that allows me to associate pages objects to a product. The pages should then be displayed as a list inside the product item on the Product Archive Page.
Right now this is the code I have:
functions.php (hooks into content-product.php)
/**
* Adds ACF CUSTOM FIELDS to the Archive Page
*/
add_action('woocommerce_shop_loop_item_title', 'add_module_info', 15);
function add_module_info()
{
do_action('woocommerce_before_shop_loop_item_title');
$modules = get_field('modules');
if ($modules) :
echo '<ul>';
foreach ($modules as $module) :
echo '<li><a href="' . get_permalink($module->ID) . '">' . $module->post_name . '</a></li>';
endforeach;
echo '</ul>';
endif;
}
**The Problem**
What happens is that instead of getting the pages associated with a product, instead I get post objects for all the pages on the website. Which is not at all what I want.
However, if I use the exact same code in the content-single-product.php
it works just fine.
I have tried several different options, namely adding the product ID to the get_field()
query, tried using different alternatives to fetch the field, and also tried different answers on stackoverflow.. but nothing until now managed to solve my problem.
Any light on what I am doing wrong??
Regards,
T.
I’ve created a checkbox field with the ACF plugin so the user could select additional features for the product in the Woocommerce to be displayed after the product description. Choices in the checkbox:
[html_block id="9060"] : Saadaval käetoega
[html_block id="9045"] : Ladustamise võimalus
The additional features are HTML blocks and the checkbox values are the shortcodes for these HTML blocks.
The problem is that the raw text value of the shortcode is displayed on the product page rather than the HTML block itself. Inside the product description there is a [acf field="toote_omadus"]
to call out the ACF input.
I’ve already researched similar issues on this forums but they usually are limited regarding just single text area.
I’ve already tried add_filter('acf/format_value/type=textarea', 'do_shortcode');
in the functions.php file which doesn’t seem to work.
Maybe someone is able to point in the right direction?
Hello everyone, I am struggling with an issue to display a custom field value in product attributes table.
I am running on WordPress 6.0.2 on php 7.3.33 at BlueHost
I am using a child theme, and have created a document in /childTheme/WooCommerce etc.
I have modified WC php code to add a new row in the attributes table, but I can’t get the function the_field(‘field_name’) to work. I also tried get_field. Both attempts returns a valid page but without a value.
This is the code I am using
defined( 'ABSPATH' ) || exit;
if ( ! $product_attributes ) {
return;
}
?>
<table class="woocommerce-product-attributes shop_attributes">
<?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">
<th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
<td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>
</tr>
<?php endforeach; ?>
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-statharas-editing-php">
<th class="woocommerce-product-attributes-item__label">Number of pages</th>
<td class="woocommerce-product-attributes-item__value"><?php the_field('book_number_of_pages'); ?></td>
</tr>
</table>
What I ‘ve done for now (and it’s working) is instead of the_field function I am using the do_shortcode function, but if you are like me, you know that’s not enough; not knowing why it doesn’t work.
defined( 'ABSPATH' ) || exit;
if ( ! $product_attributes ) {
return;
}
?>
<table class="woocommerce-product-attributes shop_attributes">
<?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">
<th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
<td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>
</tr>
<?php endforeach; ?>
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-statharas-editing-php">
<th class="woocommerce-product-attributes-item__label">Number of pages</th>
<td class="woocommerce-product-attributes-item__value"><?php echo do_shortcode( '[acf field="book-number-of-pages"]' ); ?></td>
</tr>
</table>
Could anyone please give me a hand here ?
Hello, in woo products i have added repeater (pasirinkti_datas) and in repeater are datepicker field (keliones_datos). How i can order products first which have datepicker field? Also i need to order products from nearly date to latest. Also one product can have multiple dates.
This is Example what i need:
+Product (2022-12-24)
+Product (2022-12-26)
+Product (2022-12-29)
+Product (without date)
+Product (without date)
….
I have added this code into functions.php
add_filter('woocommerce_get_catalog_ordering_args', 'woocommerce_catalog_orderby');
function woocommerce_catalog_orderby( $args ) {
$args['meta_key'] = 'pasirinkti_datas_0_keliones_datos';
$args['order'] = 'ASC';
$args['orderby'] = 'meta_value_num';
return $args;
}
But it now only shows posts with dates, posts that don’t have dates disappear.
Also, first repeater row is always the earliest date, so i think my meta_key can be ‘pasirinkti_datas_0_keliones_datos’.
Hi. I’m using ACF Pro to add a delivery tracking URL to a WooCommerce order. This field gets included in the ‘order complete’ email sent to the customer. This works okay if the user puts in the tracking URL, saves the order, then marks the order as complete. However, if they add the tracking URL and mark the order as complete in one edit, it seems like the email is sent before the ACF field is saved and it’s therefore blank in the email.
Is there any way I can force the ACF field to update earlier in the save, before the email is sent?
I have set up a Post Object field. Which by default displays as a drop-down selector. It references the Products in Woocommerce.
By default the Post Object field pulls in the post title as the option value and as the text shown in the selector. E.g. <option value="product-title">product-title</option>
In my case many of the items have the same title. So it is impossible to tell them apart.
Is there a function I can set up in functions.php to modify what’s used for the option text?
In this instance at the very least I’d like to include the product ID, and ideally the SKU.
e.g.
<option value="product-title">product-title - PostID - SKU</option>
Is this possible?
Hi folks …
I have set up a custom field using the “Post Object” type. It’s only used in the back-end, on the post editor for the CPT in question.
It is referencing the products in database (from Woocommerce). I have set up a filter to only include those items with publish
post_status
. For that I set up the following function:
function cpt_review_product_filter( $args ) {
$args['post_status'] = array( 'publish' );
return $args;
}
add_filter( 'acf/fields/post_object/query/name=review_product', 'cpt_review_product_filter' );
That worked fine. What I’d like to add to this filter is to exclude items that are in a specific category.
I tried adding the following two (separately) lines, but neither worked. So I am obviously over-looking something.
$args['term_id'] != '562' ;
$args['product_cat'] != 'THE-CATEGORY-TO-EXCLUDE';
My question …
How can I filter out results that have a specific category assigned to them? (keeping in mind, these items are likely in numerous categories, but so long as one of their categories has ID 562 (in my case), I want to exclude it.
Thanks very much …
Jonathan
I explain my problem.
I have imported a list of custom fields (via JSON import tool) from a site to my current site (250) that are related to WooCommerce products. What I would like to do is to display the label and value of each of the filled fields in a characteristic table below each product.
To do this, I used the get_field_objects function with the product id as parameter. I then looped to display the fields normally. Problem : nothing is displayed. On the other hand, if I go back to the product and update it without touching anything, bam, as if by magic, everything is displayed well…. Except that my client is not going to have fun saving 80,000 products by hand…
Here is the code:
add_filter( ‘woocommerce_product_tabs’, ‘wpb_new_product_tab’ );
function wpb_new_product_tab( $tabs ) {
// Add the new tab
$tabs[‘test_tab’] = array(
‘title’ => __( ‘Caractéristiques’, ‘text-domain’ ),
‘priority’ => 1,
‘callback’ => ‘wpb_new_product_tab_content’
);
return $tabs;
}
function wpb_new_product_tab_content() {
global $product;
$id = $product->get_id();
$fields = get_field_objects($id);
if( !empty($fields) ): ?>
<table class=“table”>
<tbody>
<?php foreach( $fields as $field ): ?>
<?php if( $field[‘value’] && $field[‘label’]!=“Pictogrammes” ): ?>
<tr>
<th scope=“col”><?php echo $field[‘label’]; ?></th>
<th scope=“col”><?php echo $field[‘value’]; ?></th>
</tr>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php else : ?>
Pas de données actuellement...
<?php endif;
}
We are trying to figure out why the hover images on our Woocommerce shop page are not displaying anymore. We have no contact with the theme developers anymore but were able to find the following codes in the theme files:
{
"key": "group_5e2871966914d",
"title": "Product",
"fields": [
{
"key": "field_5e2875af54486",
"label": "Hover Image",
"name": "hover_image",
"type": "image",
"instructions": "",
"required": 0,
"conditional_logic": 0,
"wrapper": {
"width": "",
"class": "",
"id": ""
},
"return_format": "array",
"preview_size": "medium",
"library": "all",
"min_width": "",
"min_height": "",
"min_size": "",
"max_width": "",
"max_height": "",
"max_size": "",
"mime_types": ""
}
],
"location": [
[
{
"param": "post_type",
"operator": "==",
"value": "product"
}
]
],
"menu_order": 0,
"position": "normal",
"style": "default",
"label_placement": "top",
"instruction_placement": "label",
"hide_on_screen": "",
"active": 1,
"description": "",
"modified": 1579710438
}
.post-type-archive-product main,
.archive.tax-product_cat main {
margin-top: 80px;
}
.products {
list-style: none;
padding: 0;
width: 100%;
display: flex;
flex-wrap: wrap;
}
.products .product {
width: 33.33%;
padding: 0 1px;
}
.product-img-wrapper {
position: relative;
display: flex;
}
.product-img-wrapper img {
width: 100%;
height: intrinsic;
}
.product-img-wrapper img:last-of-type {
position: absolute;
top: 0;
left: 0;
opacity: 0;
visibility: hidden;
z-index: 1;
transition: all 0.25s ease-in-out;
}
.product-img-wrapper:hover img:last-of-type {
opacity: 1;
visibility: visible;
}
Any help would be much appreciated. This feature stopped working a few weeks ago when we updated to the newest version of WordPress.
Hi!
I am new to Acf and I am not a php expert. I need your help. I have created a custom field with ACF, “Caratteristiche”, which is a checkbox field, as you can see here: https://imgur.com/XdSHxrC
I want to show the field’s values in an unordered list under the product title in the WooCommerce category page (here: https://imgur.com/6oObxh7).
I tried something, but it didn’t work…
All I’m sure about is the WooCommerce hook:
add_action( 'woocommerce_shop_loop_item_title', 'lista_tag', 30 );
Can you please help me?
Thanks!
Hello,
I have created successfully additional three fields for the (woocommerce) Product categories (“Title Zeile 1”, “Title Zeile 2” and “Text Unten”)
But unfortunately those three fields are not visible on Frontend:
Could you please give me PHP code snippet and location file where PHP have to be inserted
If it is needed I can also give you my FTP and access data.
Many thanks for your help,
Milena
Hi all, happy to be part of the community!
We’re currently struggling with the following scenario, and hope to have a valueable discussion here:
We run on Divi, and we have products for our shop in WooCommerce. We use a feed (CSV) that contains all product information which we want to upload (via WP All Import) to get the products created in bulk.
With ACF, we seek to accomplish the follwing:
1) Each product contains 1-n labels which we want to display as an image, like a small icon which should be hyperlinked to the label description page. Which field type should we best use for this (label as image with link)? Is a group with True/False for each label (we have approx. 15 individual labels in total) for each product a good way – or rather a text or something else?
2) Can we import this information via CSV feed as described above?
If yes, how should we map the fields if the name in the CSV file is different than in the ACF group? We cannot change specific values in the feed file prior to upload.
We’re currently stuck and probably running in circles in our thought process. Happy to get your point of views and inputs to see if we should go with ACF / ACF Pro or if a different way serves us more.
I am new to ACF and loving it, but the learning curve is considerable.
I am setting up a website for a client to sell second hand books. Once the site is up I will have to import a large database of over 20K+ books.
I am using ACF to add additional information to the books as woocommerce products, e.g. ISBN, Author, Publisher, Book Condition, etc. The trouble I’ve run into is this:
I am setting up a custom search/filter page and it works however I’ve noticed that searching/filtering in relation to the Author custom filed only works (produces a result) if an EXACT match is entered. E.g. if the author is ‘Douglas Adams’ his books only show up if searching for/filtering with an exact match, but not if ‘Adams’ alone is entered. This is a problem as most customers will likely just type a surname in to find books by an author, not to mention that about 80% of the author names in the database follow a ‘surname, firstname’ convention. E.g Douglas Adams might have been entered into that database as ‘Adams, Douglas’.
Is there a way of modifying this behaviour? What do I do?
Any helps/comments would be much appreciated and like I said, I am a newbie so perhaps I am just missing something obvious?