When I try to add an advanced custom field with checkboxes the values disappear upon saving.
I add a new field, choose the Checkbox option, enter some data (blue : Blue, red : Red etc..) and then hit Update. But when I do, all the data is removed. Other types like Radio button, Select and True / False works perfectly. See the example below:
Example
Any ideas?
ACF version: v3.5.8.1
WP version: 3.5.1
Problem was solved by downloading the latest version from Github.
Related
I am managing an existing site, with working ACF - there are several field groups set up, one of which is for Team Members- We want to add an additional field to the custom fields for Team Members for an alternate image.
I have set the new image field up - as shown in this screenshot:
But when I attempt to add/edit a new team member, the new fields do not appear in the editor - as shown in this screenshot:
Does anyone have any idea why this could be happening? I have disabled other plugins and reactivated them, I have updated to the latest ACF also, nothing seems to make the new fields appear in the editors.
ACF settings can actually be overwritten by code added to the functions.php file using a combination of built in filters for ACF such as acf_load_listing_type_source and acf_add_local_field_group.
Anyone running into this issue should confirm that this is not the case. It happened to me as I am editing a client's website and I did not actually create the theme, so was unaware of the code overriding the ACF settings.
Is it possible to set default value in WPForms dropdown box taken from Url param value, given the dropdown has a fixed list of options?
So let's say I set this values for WPForm (either statically or dynamically):
apple
pear
plum
now if I run page with the form by url ...&fruit=plum I want 'plum' to be pre-selected option
I ended up installing jQuery in Posts plugin and adding small jQuery script to the page, reading 'fruit' param value, selecting the dropdown by id and setting its value from script. Not very elegant solution, but at least it works. Does not look like WPForms let you do it out of the box, you can do it for textbox though, but WPForms developers forgot to implement similar feature for dropdown.
We can handle the WP Forms fields using hooks. By using the wpforms_field_data hook we can Preselect the dropdown field based on our conditions. Sample code available in https://gist.github.com/akhileshpv/2671d6be15f75cc780617cb4c9efcc8b
I have a WooCommerce store that has products with attributes that are associated with variations. When I save products, the attributes disappear (and therefore the associated variations do, too). When I re-add the attributes and save the product again, the variations come back as they were. (Note that this means attributes don’t always disappear - only when they’re not manually added before saving. )
No errors are logged.
I'm looking for some insight as to why this would happen.
I had the same issue since I use Ozisti theme for my site, too.
The workaround was to do NOT USE "Save attributes" button on product page. To save attributes changes USE "Update" (product page - on the top/right of the page).
The problem has been solved with Ozisti ThemeREX support team. They sent me new files:
wp-content/plugins/trx_addons/components/api/woocommerce/woocommerce-extended-attributes.php
wp-content/plugins/trx_addons/includes/plugin.wp.php
and now it works fine.
Regards, Jacek
I think I had a similar problem.
WordPress 5.1.1
WooCommerce 3.5.7
Ozitsi 1.0.2 Theme by ThemeRex (here was the problem)
Solution summary: Add attribute, add options, press SAVE ATTRIBUTES (attribute row folds) -> UNFOLD IT immediately - if you don't see options inserted a second ago into the Comboselect field read on.
In my case plugin ThemeREX Add-ons (shipped with Ozisti theme) was the issue. It added extra attribute types, so I could turn variations between dropdown select, image, color and button types.
After few hours of debugging I noticed that when attribute was set to one of the new types, UPDATING PRODUCT did erase all added attributes -> and by extension variations.
After ADDING ATTRIBUTES again (without SAVE ATTRIBUTES button - just adding attributes and UPDATING product) all was back in place.
Notice: when you SAVE ATTRIBUTES the row with options closes, the variations become available. But when I opened the attribute row after all AJAX saving was done it turned out that there were no OPTIONS placed in this Wordpress combo select of attribute I just edited.
So on UPDATING PRODUCT WooCommerce saved empty attribute options into DB.
This might not be perfect solution but I solved this by modifying WooCommerce's meta-boxes-product.js
I commented out line 465 and added another line to close the row:
$( '.product_attributes' ).html( response.data.html );
$( '.product_attributes .woocommerce_attribute.open .handlediv' ).trigger('click');
I didn't trace everything to the roots but makinkg it work for this single project is good enough for me at this point.
You probably use other plugins then me, but maybe they do something similar to my case.
So try to SAVE ATTRIBUTES and then immediately open attribute row again and check if selected options are inserted.. if not.. try my solution.
This Happen to me This Year. I was debugging my store for 3 days.
Solution:
I load a css file on Wordpress back office with these lines:
.save_attributes, .save-variation-changes {
display:none !important;
}
This makes WooCommerce Hide 2 buttons.
Save Attribute and Save Variation. So clients will be forced to use the update button in the product page. I'm still not sure if this is a Woocommerce bug or other plugin but for some reason, if I pressed one of these 2 buttons I would lose all my variations.
I have similiar solution with #Maciej Dejewski using Woocommerce v3.6.5.
On file /plugins/woocommerce/assets/js/admin/meta-boxes-product.js or /plugins/woocommerce/assets/js/admin/meta-boxes-product.min.js (depends on your admin page calling the javascript - you can check it via inspect element)
But instead adding line
$( '.product_attributes .woocommerce_attribute.open .handlediv' ).trigger('click');
Just commented out this
$( '.product_attributes' ).html( response.data.html );
Working fine for me
Here's the screenshot
Hope this would help!
After debugging for a hour, it turns out that my variations only disappear when not each attribute is selected. However, some of my product's attributes have between 10 and 150 entries..so that is the downside when using this method.
I'm using the Wordpress Contact Form Manager plugin. If I set a dropdown's element Default drop down value to some value that value does appears selected as I've set it. The problem is when I click on the dropdown to expand it, the additional Select option appears as shown on the image, and I can't seem to find where could I customize this. I went through their FAQ and googled but no help.
As it seems the option to edit this really doesn't exist via the plugin admin panel and in order to remove the additional Select option you have to edit the create-contact-form.php starting on line 1006 and comment the code out:
if($formElementDetail->client_view_multi_select_drop_down != 1){
//$replace = $replace.'<option value="">Select</option>';
}
You can of course comment (or remove) the whole if case. Hope this will help someone.
I need to display the "add to cart button" without choosing default selection values with variations.
A customer can select the variable from the dropdown variations and reset the values back and the "single_variation_wrap" should always be visible.
I tried to remove "display:none" under variables.php but it didn't do the trick.
Could anyone help?
See the answer here
"WooCommerce: always showing add-to-cart button even before variation is selected"
This should work:
You can deregister the current add to cart variation Javascript, copy and paste this script into your theme directory and enqeue this new one. Here you can remove the slidedown feature and it will always show.
Caveat
When woocoomerce push a new release, you will have to check the changlog to see if anything has changed inside add-to-cart-variation.min.js