Home › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Conditional Fields are not working
- This topic has 14 replies, 3 voices, and was last updated 3 years ago by JOSÉ.
-
AuthorPosts
-
May 26, 2019 at 3:56 am #12378Zhan HaoParticipant
Hi,
I’ve followed your video guide to create conditional fields but I realized that it is not working.
I have a conditional field (Select Input) set with 2 options: A and B. However, I noticed that the moment I navigate between tabs from “Conditions” to “Fields”, the condition that I have set previously set for the conditional field automatically defaults to the first option which is incorrect (correct should be 2nd option).
After Saving Settings, the conditional field is also not set to the correct option.
Also, on the frontend of the site, both fields are being displayed, when the conditional field is selected. When it is deselected, both fields are hidden.
Can you kindly assist?
May 26, 2019 at 12:08 pm #12381nmediaKeymasterHi,
can you please share your product page URL?
May 26, 2019 at 3:25 pm #12389Zhan HaoParticipantHi there,
My Product Page URL is: https://www.tag.com.sg/product/adjustable-table-with-single-motor/
There are currently 2 options for “Surface Type”: Wooden Surface or Solid Colour. I have configured the conditions to show “Table Top Surface Wood” when Wooden Surface is selected, and show “Table Top Surface Colour” when Solid Colour is selected.
But you can see that the solid colour doesn’t appear when I select the option. It simply just hides the Wood options.
Appreciate if you can help ASAP as my website is currently running live.
May 27, 2019 at 2:26 am #12393Zhan HaoParticipantHi there,
Can I please get a reply on this asap?
Thank you.
May 27, 2019 at 1:02 pm #12399nmediaKeymasterZhan, I see your product and found that conditions not properly set. Can you please create new PPOM Meta and create conditions again? Some extra keys are being added in your conditions.
May 29, 2019 at 4:01 pm #12428Zhan HaoParticipantHi,
I have checked my conditions and they are set correctly, but not saved correctly. I think your plugin is giving some bugs. After I update the field to the correct option, it does not get saved as the correct field. I have tried to create new PPOM Meta and create the conditions again, and this time it finally worked.
Another issue that I have: How can I customise the display in the cart page and checkout page? The display is inconsistent with my theme and I would like to change the text. How can I do this?
- This reply was modified 5 years, 4 months ago by Zhan Hao.
May 31, 2019 at 1:28 am #12443Zhan HaoParticipantHi,
Can I get your reply on this ASAP?
Thank you.
June 1, 2019 at 5:45 am #12452nmediaKeymasterZhan, good to see that you manage to fix conditional fields issue.
What do you mean inconsistent view? can you please share Shope/Product page URL?
June 1, 2019 at 1:42 pm #12462Zhan HaoParticipantHi,
Please visit the following URL to view the product that I have currently setup your plugin for: https://www.tag.com.sg/product/adjustable-table-with-single-motor/
Try adding the item to cart and take a look at the following UIs:
1) Cart Page
2) Cart (Right Side Bar)
3) Checkout PageThe UIs doesn’t look at all, and I would like to customise the display to just show the selected options in text (without images). Is that possible?
June 5, 2019 at 1:43 am #12477Zhan HaoParticipantHi there,
Can I please get a reply to the above? Need the CSS fix ASAP…
Thank you.
June 9, 2019 at 2:50 pm #12511nmediaKeymasterHi,
you need make two changes in your side, first you need add following line inside inc/functions.php near line 499:
$meta_data_field = apply_filters('ppom_meta_data_field_new', $meta_data, $key, $field_meta, $product_id, $value);
before
$ppom_meta[$key] = $meta_data_field;
Now add following script inside your themes’ function.php file:
add_filter('ppom_meta_data_field_new', 'ppom_disable_image_on_cart', 99, 5); function ppom_disable_image_on_cart($meta_data, $key, $field_meta, $product_id, $value) { if( $field_meta['type'] == 'image') { $image_titles = array(); foreach($value as $id => $images_meta) { $images_meta = json_decode(stripslashes($images_meta), true); $image_url = stripslashes($images_meta['link']); $image_titles[] = $images_meta['title']; } $meta_data['value'] = implode(',', $image_titles); } // ppom_pa($meta_data); return $meta_data; }
June 10, 2019 at 5:33 am #12523Zhan HaoParticipantHi there,
Where can I find this inc/functions.php that you are referring to? I’m unable to locate it, and neither do I find any file with the line
$ppom_meta[$key] = $meta_data_field;
Please kindly assist. Thank you.
June 10, 2019 at 2:20 pm #12529nmediaKeymasterThis file is in woocoomerce-product-addons/ directory.
October 15, 2021 at 4:17 pm #120891JOSÉParticipantGreetings, I currently made the following metadata, but I do not know how to call the sheet of the google Sheet:
add_filter( ‘manage_edit-product_columns’, ‘esl_new_order_column’ );
function esl_new_order_column( $columns ) {
$columns[‘marca’] = ‘Marca’;
$columns[‘proveedor’] = ‘Proveedor’;
$columns[‘msrp_2’] = ‘Precio del MSRP 2’;
$columns[‘msrp_1_link’] = ‘MSRP 1 Link’;
$columns[‘msrp_1’] = ‘Precio del MSRP 1’;
$columns[‘msrp_2_link’] = ‘MSRP 2 Link’;
$columns[‘flete’] = ‘Flete’;
$columns[‘subcategoria’] = ‘Subcategoria’;return $columns;
}
// Mostrar el valor del campo comentarios en la columna
add_action( ‘manage_product_posts_custom_column’, ‘esl_add_new_column_content’ );
function esl_add_new_column_content( $column ) {
global $post;
if ( ‘proveedor’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘proveedor’, true );
echo $nuevocampo;
}if ( ‘msrp_2’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_2’, true );
echo $nuevocampo;
}if ( ‘msrp_1’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_1’, true );
echo $nuevocampo;
}if ( ‘marca’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘marca’, true );
echo $nuevocampo;
}if ( ‘msrp_1_link’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_1_link’, true );
echo $nuevocampo;
}if ( ‘msrp_2_link’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_2_link’, true );
echo $nuevocampo;
}if ( ‘flete’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘flete’, true );
echo $nuevocampo;
}if ( ‘subcategoria’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘subcategoria’, true );
echo $nuevocampo;
}}
function dcms_caracteristicas_producto(){
if (function_exists(‘get_field’)){
echo “<p>Marca: “. get_field(‘marca’).”</p>”;October 15, 2021 at 4:20 pm #120892JOSÉParticipantGreetings, currently I made the following metadata, but I don’t know how to call it in google Sheet:
add_filter( ‘manage_edit-product_columns’, ‘esl_new_order_column’ );
function esl_new_order_column( $columns ) {
$columns[‘marca’] = ‘Marca’;
$columns[‘proveedor’] = ‘Proveedor’;
$columns[‘msrp_2’] = ‘Precio del MSRP 2’;
$columns[‘msrp_1_link’] = ‘MSRP 1 Link’;
$columns[‘msrp_1’] = ‘Precio del MSRP 1’;
$columns[‘msrp_2_link’] = ‘MSRP 2 Link’;
$columns[‘flete’] = ‘Flete’;
$columns[‘subcategoria’] = ‘Subcategoria’;return $columns;
}
// Mostrar el valor del campo comentarios en la columna
add_action( ‘manage_product_posts_custom_column’, ‘esl_add_new_column_content’ );
function esl_add_new_column_content( $column ) {
global $post;
if ( ‘proveedor’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘proveedor’, true );
echo $nuevocampo;
}if ( ‘msrp_2’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_2’, true );
echo $nuevocampo;
}if ( ‘msrp_1’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_1’, true );
echo $nuevocampo;
}if ( ‘marca’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘marca’, true );
echo $nuevocampo;
}if ( ‘msrp_1_link’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_1_link’, true );
echo $nuevocampo;
}if ( ‘msrp_2_link’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘msrp_2_link’, true );
echo $nuevocampo;
}if ( ‘flete’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘flete’, true );
echo $nuevocampo;
}if ( ‘subcategoria’ === $column ) {
$order = wc_get_order( $post->ID );
$nuevocampo = get_post_meta( $post->ID, ‘subcategoria’, true );
echo $nuevocampo;
}}
function dcms_caracteristicas_producto(){
if (function_exists(‘get_field’)){
echo “<p>Marca: “. get_field(‘marca’).”</p>”; -
AuthorPosts
- You must be logged in to reply to this topic.