PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 2.8.16
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v2.8.16
3.13.3 3.13.2 3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 All 261 releases
wpfunnels / includes / core / widgets / elementor / elements / next-step-widget.php

next-step-widget.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 2.8.16, at includes/core/widgets/elementor/elements/next-step-widget.php

842 lines 19.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Next step widget
4 *
5 * @package WPFunnels\Widgets\Elementor
6 */
7 namespace WPFunnels\Widgets\Elementor;
8
9 use Elementor\Widget_Base;
10 use Elementor\Controls_Manager;
11 use Elementor\Group_Control_Border;
12 use Elementor\Group_Control_Box_Shadow;
13 use Elementor\Group_Control_Typography;
14 use Elementor\Group_Control_Text_Shadow;
15 use Elementor\Icons_Manager;
16 use Elementor\Core\Schemes\Color as Scheme_Color;
17 use WPFunnels\Data_Store\Wpfnl_Steps_Store_Data;
18 use WPFunnels\Wpfnl_functions;
19 use Elementor\Controls_Stack;
20 if (!defined('ABSPATH')) {
21 exit; // Exit if accessed directly
22 }
23
24 /**
25 * Funnel sell Reject button
26 *
27 * @since 1.0.0
28 */
29 class Step_Pointer extends Widget_Base
30 {
31
32
33 /**
34 * Register the widget controls.
35 *
36 * Adds different input fields to allow the user to change and Wpvrize the widget settings.
37 *
38 * @since 1.0.0
39 *
40 * @access protected
41 */
42 protected function init_controls() {
43 if ( version_compare(ELEMENTOR_VERSION, '3.1.0', '>=') ) {
44 $this->register_controls();
45 } else {
46 $this->_register_controls();
47 }
48 }
49
50
51
52 /**
53 * Retrieve the widget name.
54 *
55 * @return string Widget name.
56 * @since 1.0.0
57 *
58 * @access public
59 */
60 public function get_name()
61 {
62 return 'wpfnl-next-step';
63 }
64
65 /**
66 * Retrieve the widget title.
67 *
68 * @return string Widget title.
69 * @since 1.0.0
70 *
71 * @access public
72 */
73 public function get_title()
74 {
75 return __('Next Step Button', 'wpfnl');
76 }
77
78 /**
79 * Retrieve the widget icon.
80 *
81 * @return string Widget icon.
82 * @since 1.0.0
83 *
84 * @access public
85 */
86 public function get_icon()
87 {
88 return 'icon-wpfnl next-step';
89 }
90
91 /**
92 * Retrieve the list of categories the widget belongs to.
93 *
94 * Used to determine where to display the widget in the editor.
95 *
96 * Note that currently Elementor supports only one category.
97 * When multiple categories passed, Elementor uses the first one.
98 *
99 * @return array Widget categories.
100 * @since 1.0.0
101 *
102 * @access public
103 */
104 public function get_categories()
105 {
106 return ['wp-funnel'];
107 }
108
109
110 /**
111 * Retrieve the list of scripts the widget depended on.
112 *
113 * Used to set scripts dependencies required to run the widget.
114 *
115 * @return array Widget scripts dependencies.
116 * @since 1.0.0
117 *
118 * @access public
119 */
120 public function get_script_depends()
121 {
122 return ['next-step-widget'];
123 }
124
125 /**
126 * Get button sizes.
127 *
128 * Retrieve an array of button sizes for the button widget.
129 *
130 * @return array An array containing button sizes.
131 * @since 1.0.0
132 * @access public
133 * @static
134 */
135 public static function get_button_sizes()
136 {
137 return [
138 'xs' => __('Extra Small', 'wpfnl'),
139 'sm' => __('Small', 'wpfnl'),
140 'md' => __('Medium', 'wpfnl'),
141 'lg' => __('Large', 'wpfnl'),
142 'xl' => __('Extra Large', 'wpfnl'),
143 ];
144 }
145
146 /**
147 * Get funnel types.
148 *
149 * Retrieve an array of funnel types.
150 *
151 * @return array An array containing funnel types.
152 * @since 1.0.0
153 * @access public
154 * @static
155 */
156 public function get_funnel_types()
157 {
158 $response = array(
159 ' ' => __('Select Type', 'wpfnl'),
160 );
161 $response['checkout'] = __('Next Step', 'wpfnl');
162 $response['url-path'] = __('Go To URL Path', 'wpfnl');
163 $response['another-funnel'] = __('Another Funnel', 'wpfnl');
164
165 return $response;
166 }
167
168 /**
169 * Get all WC products
170 *
171 * @since 1.0.0
172 *
173 * @access protected
174 */
175 protected function get_products_array()
176 {
177 $products = array();
178 if (in_array('woocommerce/woocommerce.php', WPFNL_ACTIVE_PLUGINS)) {
179 $ids = wc_get_products(array('return' => 'ids', 'limit' => -1));
180 if( !empty($ids) ){
181 foreach ($ids as $id) {
182 $title = get_the_title($id);
183 $products[$id] = $title ? $title : '';
184 }
185 }
186 }
187 return $products;
188 }
189
190 /**
191 * Get all wp pages
192 *
193 * @since 1.0.0
194 *
195 * @access protected
196 */
197 protected function get_available_pages()
198 {
199 $data = array();
200 global $wpdb;
201 if (in_array('fluentform/fluentform.php', WPFNL_ACTIVE_PLUGINS)) {
202 $sql = $wpdb->prepare("SELECT id FROM {$wpdb->prefix}fluentform_forms");
203 $results = $wpdb->get_results($sql);
204 foreach ($results as $value) {
205 $sql = $wpdb->prepare("SELECT title FROM {$wpdb->prefix}fluentform_forms WHERE id=$value->id");
206 $title = $wpdb->get_results($sql);
207 $data[$value->id] = $title[0]->title;
208 }
209 }
210 return $data;
211 }
212
213 protected function get_available_steps()
214 {
215 $step_id = get_the_ID();
216 $funnel_id = get_post_meta($step_id, '_funnel_id', true);
217 if (!$funnel_id) {
218 return null;
219 }
220 $data = array();
221 $steps = get_post_meta($funnel_id, '_steps_order', true);
222 if($steps) {
223 foreach ($steps as $step_key => $step_value) {
224 $data[$step_value['id']] = $step_value['name'];
225 }
226 }
227
228 return $data;
229 }
230
231 public function get_prev_next_link_options()
232 {
233 $associate_funnel_id = get_post_meta(get_the_ID(), '_funnel_id', true);
234 $steps_array = [
235 'landing' => 'Landing',
236 'checkout' => 'Checkout',
237 'custom' => 'Custom',
238 'upsell' => 'Upsell',
239 'downsell' => 'Downsell',
240 'thankyou' => 'Thankyou'
241 ];
242 $option_group = [];
243 foreach ($steps_array as $key => $value) {
244 $args = [
245 'posts_per_page' => -1,
246 'orderby' => 'date',
247 'order' => 'DESC',
248 'post_type' => WPFNL_STEPS_POST_TYPE,
249 'post_status' => 'publish',
250 'post__not_in' => [$this->get_id()],
251 'meta_query' => [
252 'relation' => 'AND',
253 [
254 'key' => '_step_type',
255 'value' => $key,
256 'compare' => '=',
257 ],
258 [
259 'key' => '_funnel_id',
260 'value' => $associate_funnel_id,
261 'compare' => '=',
262 ],
263 ],
264 ];
265 $query = new \WP_Query($args);
266 $steps = $query->posts;
267 if ($steps) {
268 foreach ($steps as $s) {
269 $option_group[$key][] = [
270 'id' => $s->ID,
271 'title' => $s->post_title,
272 ];
273 }
274 }
275 }
276 return $option_group;
277 }
278
279 /**
280 * Get all funnel steps
281 *
282 * @since 1.0.0
283 *
284 * @access protected
285 */
286 protected function get_steps_array($type = 'upsell')
287 {
288 $options = $this->get_prev_next_link_options();
289 $response = array();
290 if (isset($options[$type])) {
291 $prime_data = $options[$type];
292 foreach ($prime_data as $data) {
293 $response[$data['id']] = $data['title'];
294 }
295 }
296
297 return $response;
298 }
299
300 /**
301 * Register the widget controls.
302 *
303 * @since 1.0.0
304 *
305 * @access protected
306 */
307 protected function register_controls()
308 {
309
310 $this->next_step_button_controls();
311 }
312
313 /**
314 * Register the widget controls.
315 *
316 * @since 1.0.0
317 *
318 * @access protected
319 */
320 protected function _register_controls()
321 {
322 $this->next_step_button_controls();
323
324 }
325
326 /**
327 * Next step button controls.
328 *
329 * @since 1.0.0
330 *
331 * @access protected
332 */
333 protected function next_step_button_controls(){
334 $this->start_controls_section(
335 'section_button_controller',
336 [
337 'label' => __('Next Step Button', 'wpfnl'),
338 ]
339 );
340
341 $general_data = get_option('_wpfunnels_general_settings');
342 $funnel_types = $general_data['funnel_type'];
343
344
345 $this->add_control(
346 'button_type_selector',
347 [
348 'label' => __('Select Button Type', 'wpfnl'),
349 'type' => \Elementor\Controls_Manager::SELECT,
350 'default' => 'checkout',
351 'options' => $this->get_funnel_types(),
352 ]
353 );
354
355 $this->add_control(
356 'lead_type_selector',
357 [
358 'label' => __('Lead Type', 'wpfnl'),
359 'type' => \Elementor\Controls_Manager::SELECT,
360 'default' => '',
361 'options' => [
362 'page' => __('Page', 'wpfnl'),
363 'popup' => __('Popup', 'wpfnl'),
364 ],
365 'condition' => [
366 'button_type_selector' => 'lead',
367 ]
368 ]
369 );
370
371 $this->add_control(
372 'fluent_form_next_step',
373 [
374 'label' => __('Select Next Step', 'wpfnl'),
375 'type' => \Elementor\Controls_Manager::SELECT,
376 'options' => $this->get_available_steps(),
377 'condition' => [
378 'button_type_selector' => 'lead',
379 ]
380 ]
381 );
382
383 $this->add_control(
384 'url_path_field',
385 [
386 'label' => __('URL Path', 'wpfnl'),
387 'type' => \Elementor\Controls_Manager::URL,
388 'default' => [],
389 'condition' => [
390 'button_type_selector' => 'url-path',
391 ]
392 ]
393 );
394
395 $this->add_control(
396 'another_funnel_field',
397 [
398 'label' => __('Choose funnel', 'wpfnl'),
399 'type' => \Elementor\Controls_Manager::SELECT,
400 'default' => '',
401 'options' => Wpfnl_functions::get_funnel_list(),
402 'condition' => [
403 'button_type_selector' => 'another-funnel',
404 ]
405 ]
406 );
407
408 $this->end_controls_section();
409
410 $this->start_controls_section(
411 'section_button',
412 [
413 'label' => __('Next Step Button Content', 'wpfnl'),
414 // 'condition' => [
415 // 'button_type_selector' => 'checkout',
416 // ]
417 ]
418 );
419
420 $this->add_control(
421 'text',
422 [
423 'label' => __('Text', 'wpfnl'),
424 'type' => Controls_Manager::TEXT,
425 'default' => __('Go Next', 'wpfnl'),
426 'placeholder' => __('Go Next', 'wpfnl'),
427 ]
428 );
429
430 $this->add_responsive_control(
431 'align',
432 [
433 'label' => __('Alignment', 'wpfnl'),
434 'type' => Controls_Manager::CHOOSE,
435 'options' => [
436 'left' => [
437 'title' => __('Left', 'wpfnl'),
438 'icon' => 'fa fa-align-left',
439 ],
440 'center' => [
441 'title' => __('Center', 'wpfnl'),
442 'icon' => 'fa fa-align-center',
443 ],
444 'right' => [
445 'title' => __('Right', 'wpfnl'),
446 'icon' => 'fa fa-align-right',
447 ],
448 'justify' => [
449 'title' => __('Justified', 'wpfnl'),
450 'icon' => 'fa fa-align-justify',
451 ],
452 ],
453 'prefix_class' => 'elementor%s-align-',
454 'default' => '',
455 ]
456 );
457
458 $this->add_control(
459 'size',
460 [
461 'label' => __('Size', 'wpfnl'),
462 'type' => Controls_Manager::SELECT,
463 'default' => 'sm',
464 'options' => self::get_button_sizes(),
465 ]
466 );
467
468
469 $this->add_control(
470 'next_step_button_icon',
471 [
472 'label' => __('Icon', 'wpfnl'),
473 'type' => Controls_Manager::ICONS,
474 'fa4compatibility' => 'icon',
475 ]
476 );
477
478 $this->add_control(
479 'next_step_button_icon_align',
480 [
481 'label' => __('Icon Position', 'wpfnl'),
482 'type' => Controls_Manager::SELECT,
483 'default' => 'left',
484 'options' => [
485 'left' => __('Before Text', 'wpfnl'),
486 'right' => __('After Text', 'wpfnl'),
487 ],
488 'condition' => [
489 'next_step_button_icon[value]!' => '',
490 ],
491 ]
492 );
493
494 $this->add_control(
495 'next_step_button_icon_indent',
496 [
497 'label' => __('Icon Spacing', 'wpfnl'),
498 'type' => \Elementor\Controls_Manager::SLIDER,
499 'range' => [
500 'px' => [
501 'max' => 50,
502 ],
503 ],
504 'condition' => [
505 'next_step_button_icon!' => '',
506 ],
507 'selectors' => [
508 '{{WRAPPER}} .elementor-button .elementor-align-icon-right' => 'margin-left: {{SIZE}}{{UNIT}};',
509 '{{WRAPPER}} .elementor-button .elementor-align-icon-left' => 'margin-right: {{SIZE}}{{UNIT}};',
510 ],
511 ]
512 );
513
514
515 $this->add_control(
516 'view',
517 [
518 'label' => __('View', 'wpfnl'),
519 'type' => Controls_Manager::HIDDEN,
520 'default' => 'traditional',
521 ]
522 );
523
524 $this->end_controls_section();
525
526 $this->start_controls_section(
527 'section_style',
528 [
529 'label' => __('Button', 'wpfnl'),
530 'tab' => Controls_Manager::TAB_STYLE,
531 ]
532 );
533
534 $this->add_group_control(
535 Group_Control_Typography::get_type(),
536 [
537 'name' => 'next_step_button_typography',
538 'label' => 'Typography',
539 'selector' => '{{WRAPPER}} a.elementor-button',
540 ]
541 );
542
543 $this->add_group_control(
544 Group_Control_Text_Shadow::get_type(),
545 [
546 'name' => 'next_step_button_text_shadow',
547 'selector' => '{{WRAPPER}} a.elementor-button',
548 ]
549 );
550
551 $this->start_controls_tabs('tabs_button_style');
552
553 $this->start_controls_tab(
554 'tab_button_normal',
555 [
556 'label' => __('Normal', 'wpfnl'),
557 ]
558 );
559
560 $this->add_control(
561 'button_text_color',
562 [
563 'label' => __('Text Color', 'wpfnl'),
564 'type' => Controls_Manager::COLOR,
565 'default' => '',
566 'selectors' => [
567 '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'color: {{VALUE}};',
568 ],
569 ]
570 );
571
572 $this->add_control(
573 'background_color',
574 [
575 'label' => __('Background Color', 'wpfnl'),
576 'type' => Controls_Manager::COLOR,
577 'scheme' => [
578 'type' => Scheme_Color::get_type(),
579 'value' => Scheme_Color::COLOR_4,
580 ],
581 'selectors' => [
582 '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'background-color: {{VALUE}};',
583 ],
584 ]
585 );
586
587 $this->end_controls_tab();
588
589 $this->start_controls_tab(
590 'tab_button_hover',
591 [
592 'label' => __('Hover', 'wpfnl'),
593 ]
594 );
595
596 $this->add_control(
597 'hover_color',
598 [
599 'label' => __('Text Color', 'wpfnl'),
600 'type' => Controls_Manager::COLOR,
601 'selectors' => [
602 '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'color: {{VALUE}};',
603 ],
604 ]
605 );
606
607 $this->add_control(
608 'button_background_hover_color',
609 [
610 'label' => __('Background Color', 'wpfnl'),
611 'type' => Controls_Manager::COLOR,
612 'selectors' => [
613 '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'background-color: {{VALUE}};',
614 ],
615 ]
616 );
617
618 $this->add_control(
619 'button_hover_border_color',
620 [
621 'label' => __('Border Color', 'wpfnl'),
622 'type' => Controls_Manager::COLOR,
623 'condition' => [
624 'border_border!' => '',
625 ],
626 'selectors' => [
627 '{{WRAPPER}} a.elementor-button:hover, {{WRAPPER}} .elementor-button:hover' => 'border-color: {{VALUE}};',
628 ],
629 ]
630 );
631
632 $this->add_control(
633 'hover_animation',
634 [
635 'label' => __('Animation', 'wpfnl'),
636 'type' => Controls_Manager::HOVER_ANIMATION,
637 ]
638 );
639
640 $this->end_controls_tab();
641
642 $this->end_controls_tabs();
643
644 $this->add_group_control(
645 Group_Control_Border::get_type(),
646 [
647 'name' => 'border',
648 'label' => __('Border', 'wpfnl'),
649 'placeholder' => '1px',
650 'default' => '1px',
651 'selector' => '{{WRAPPER}} .elementor-button',
652 'separator' => 'before',
653 ]
654 );
655
656 $this->add_responsive_control(
657 'border_radius',
658 [
659 'label' => __('Border Radius', 'wpfnl'),
660 'type' => Controls_Manager::DIMENSIONS,
661 'size_units' => ['px', '%'],
662 'selectors' => [
663 '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
664 ],
665 ]
666 );
667
668
669 $this->add_group_control(
670 Group_Control_Box_Shadow::get_type(),
671 [
672 'name' => 'button_box_shadow',
673 'selector' => '{{WRAPPER}} .elementor-button',
674 ]
675 );
676
677 $this->add_responsive_control(
678 'text_padding',
679 [
680 'label' => __('Padding', 'wpfnl'),
681 'type' => Controls_Manager::DIMENSIONS,
682 'size_units' => ['px', 'em', '%'],
683 'selectors' => [
684 '{{WRAPPER}} a.elementor-button, {{WRAPPER}} .elementor-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
685 ],
686 'separator' => 'before',
687 ]
688 );
689
690
691 $this->end_controls_section();
692 }
693
694
695 /**
696 * Render the widget output on the frontend.
697 *
698 * Written in PHP and used to generate the final HTML.
699 *
700 * @since 1.0.0
701 *
702 * @access protected
703 */
704 protected function render()
705 {
706 $settings = $this->get_settings();
707
708 $this->add_render_attribute('wrapper', 'class', 'elementor-button-wrapper');
709 $this->add_render_attribute('button', 'class', 'elementor-button');
710 $products = '';
711 if (!empty($settings['size'])) {
712 $this->add_render_attribute('button', 'class', 'elementor-size-' . $settings['size']);
713 }
714
715 if (isset($settings['hover_animation']) && $settings['hover_animation']) {
716 $this->add_render_attribute('button', 'class', 'elementor-animation-' . $settings['hover_animation']);
717 }
718 if (isset($settings['button_type_selector']) && $settings['button_type_selector'] !== 'lead') {
719
720 // $products = implode(",", $settings['checkout_product_selector']);
721 $products_array = get_post_meta(get_the_ID(), 'checkout_product_selector', true);
722 if ($products_array) {
723 $products = implode(",", $products_array);
724 }
725
726 if( 'url-path' === $settings['button_type_selector'] ){
727 $url = isset($settings['url_path_field']['url']) ? $settings['url_path_field']['url'] : '';
728 }elseif( 'another-funnel' === $settings['button_type_selector'] ){
729 $url = $settings['another_funnel_field'];
730 }else{
731 $url = '';
732 }
733
734 ?>
735 <div <?php echo $this->get_render_attribute_string('wrapper'); ?>>
736 <a href="#" data-button-type="<?php echo $settings['button_type_selector']; ?>" data-url="<?php echo $url; ?>" data-id="<?php echo get_the_ID(); ?>" data-products="<?php echo $products; ?>"
737 id="wpfunnels_next_step_controller"
738 style="cursor: pointer;" <?php echo $this->get_render_attribute_string('button'); ?>>
739 <?php $this->render_text(); ?>
740 <span class="wpfnl-loader"></span>
741 </a>
742 </div>
743 <span class="wpfnl-alert" id="wpfnl-next-button-loader"></span>
744
745 <?php
746 } elseif (isset($settings['button_type_selector']) && $settings['button_type_selector'] == 'lead') {
747 if (!in_array('fluentform/fluentform.php', WPFNL_ACTIVE_PLUGINS)) {
748 echo '<p style="color: red;">Please activate Fluent Forms</p>';
749 }
750 $form = $settings['lead_type_page_selector'];
751 if (isset($settings['lead_type_selector']) && $settings['lead_type_selector'] == 'page') {
752 echo do_shortcode('[fluentform id="' . $form . '"]');
753 } elseif (isset($settings['lead_type_selector']) && $settings['lead_type_selector'] == 'popup') {
754 echo do_shortcode('[fluentform_modal form_id="' . $form . '" ]');
755 //echo '<a href="#" id="modal-id">show modal</a>';
756 }
757 }
758
759 }
760
761
762 /**
763 * Render button text.
764 *
765 * Render button widget text.
766 *
767 * @since 1.5.0
768 * @access protected
769 */
770 protected function render_text()
771 {
772 $settings = $this->get_settings();
773 $migrated = isset($settings['__fa4_migrated']['next_step_button_icon']);
774 $is_new = empty($settings['icon']) && Icons_Manager::is_migration_allowed();
775
776 if (!$is_new && empty($settings['next_step_button_icon_align'])) {
777
778 $settings['next_step_button_icon_align'] = $this->get_settings('next_step_button_icon_align');
779 }
780
781 $this->add_render_attribute([
782 'content-wrapper' => [
783 'class' => 'elementor-button-content-wrapper',
784 ],
785 'icon-align' => [
786 'class' => [
787 'elementor-button-icon',
788 'elementor-align-icon-' . $settings['next_step_button_icon_align'],
789 ],
790 ],
791 'text' => [
792 'class' => 'elementor-button-text',
793 ],
794 ]);
795
796 $this->add_render_attribute('content-wrapper', 'class', 'elementor-button-content-wrapper');
797 $this->add_render_attribute('text', 'class', 'elementor-button-text');
798
799 $this->add_inline_editing_attributes('text', 'none');
800 ?>
801 <span <?php echo $this->get_render_attribute_string('content-wrapper'); ?>>
802
803 <?php if (!empty($settings['icon']) || !empty($settings['next_step_button_icon']['value'])) : ?>
804 <span <?php echo $this->get_render_attribute_string('icon-align'); ?>>
805 <?php if ($is_new || $migrated) :
806 Icons_Manager::render_icon($settings['next_step_button_icon'], ['aria-hidden' => 'true']);
807 else : ?>
808 <i class="<?php echo esc_attr($settings['icon']); ?>" aria-hidden="true"></i>
809 <?php endif; ?>
810 </span>
811 <?php endif; ?>
812
813 <span <?php echo $this->get_render_attribute_string('text'); ?>>
814 <?php echo $settings['text']; ?>
815 </span>
816 </span>
817 <?php
818 }
819
820
821 /**
822 * Fnd next step url
823 *
824 * @since 1.5.0
825 * @access protected
826 */
827 public function get_next_step_url()
828 {
829 $id = get_the_ID();
830 $funnel_id = get_post_meta($id, '_funnel_id', true);
831 $steps_order = get_post_meta($funnel_id, '_steps_order', true);
832 $step_object = new Wpfnl_Steps_Store_Data();
833 $next_step_id = $step_object->get_next_step($steps_order, $funnel_id);
834 if ($next_step_id) {
835 $next_step_url = get_post_permalink($next_step_id);
836 } else {
837 $next_step_url = '#';
838 }
839 return $next_step_url;
840 }
841 }
842