Skip Navigation

[Resolved] Split: Issues with Popupmaker Plugin – check conditional field

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by michaelA-13 5 years, 12 months ago.

Assisted by: Minesh.

Author
Posts
#1155992

Hi Minesh,

thanks for the first code work nice 🙂

I can't figure out the other myself... I am not able to evaluate if the mulitday checkbox is checked or not. And the value that is returned always says array rather then 0 or 1.


function func_format_2nd_date_price( $atts ) {
  global $post;
  if ( get_post_meta($post->ID,'wpcf-multi-day',true) != 0) {
  $multi = get_post_meta($post->ID,'wpcf-multi-day',true);
  echo "Is Multi " . $multi;
  }
}
add_shortcode('format_2nd_date_price', 'func_format_2nd_date_price');

In addition I noticed something odd...

If a - minus/hyphen is placed between two shortcodes it becomes an – en-dash in the popup.

hidden link

No issue on a page:

hidden link

Michael

#1155993

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - regarding checking the field conditionally, I've adjusted the code you shared as given under:

function func_format_2nd_date_price( $atts ) {
  global $post;
  $multi_day = get_post_meta($post->ID,'wpcf-multi-day',true);
  
  if ( $multi_day == 1) {
     $price = get_post_meta($post->ID,'wpcf-price-2-day',true);
  return $price;
  }
  return 0;
}
add_shortcode('format_2nd_date_price', 'func_format_2nd_date_price');

As you added the above shortcode at the following page:
=> hidden link

If field "multi-day' is checked then it will return the "price-2-day" value otherwise it will return 0. Please feel free to adjust the code as needed.

#1161500

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Could you please close the ticket.

#1161501

My issue is resolved now. Thank you!