| 1 |
<?php |
| 2 |
/** |
| 3 |
* View Flow steps |
| 4 |
* |
| 5 |
* @package CartFlows |
| 6 |
*/ |
| 7 |
|
| 8 |
$get_steps = array( |
| 9 |
'landing' => __( 'Landing', 'cartflows' ), |
| 10 |
'checkout' => __( 'Checkout', 'cartflows' ), |
| 11 |
'thankyou' => __( 'Thank You', 'cartflows' ), |
| 12 |
'upsell' => __( 'Upsell', 'cartflows' ), |
| 13 |
'downsell' => __( 'Downsell', 'cartflows' ), |
| 14 |
|
| 15 |
); |
| 16 |
|
| 17 |
?> |
| 18 |
<div class="wcf-flow-steps-meta-box"> |
| 19 |
<div class="wcf-flow-settings"> |
| 20 |
<?php do_action( 'cartflows_above_flow_steps' ); ?> |
| 21 |
<div class="wcf-flow-steps-wrap"> |
| 22 |
<div class="wcf-flow-steps-container"> |
| 23 |
<?php if ( is_array( $options['steps'] ) ) { ?> |
| 24 |
<?php foreach ( $options['steps'] as $index => $data ) { ?> |
| 25 |
<?php |
| 26 |
$term_slug = ''; |
| 27 |
$term_name = ''; |
| 28 |
$step_wrap_class = ''; |
| 29 |
$has_product_assigned = true; |
| 30 |
|
| 31 |
if ( isset( $data['type'] ) ) { |
| 32 |
$term_slug = $data['type']; |
| 33 |
$term_name = $get_steps[ $data['type'] ]; |
| 34 |
} |
| 35 |
|
| 36 |
if ( ! _is_cartflows_pro() && ( 'upsell' === $term_slug || 'downsell' === $term_slug ) ) { |
| 37 |
$step_wrap_class .= ' invalid-step'; |
| 38 |
} |
| 39 |
|
| 40 |
if ( isset( $_GET['highlight-step-id'] ) && $_GET['highlight-step-id'] == $data['id'] ) { |
| 41 |
$step_wrap_class .= ' wcf-new-step-highlight'; |
| 42 |
} |
| 43 |
|
| 44 |
if ( 'upsell' === $term_slug || 'downsell' === $term_slug || 'checkout' === $term_slug ) { |
| 45 |
|
| 46 |
$has_product_assigned = Cartflows_Helper::has_product_assigned( $data['id'] ); |
| 47 |
|
| 48 |
if ( ! $has_product_assigned ) { |
| 49 |
$step_wrap_class .= ' wcf-no-product-step'; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
?> |
| 54 |
<div class="wcf-step-wrap <?php echo $step_wrap_class; ?>" data-id="<?php echo $data['id']; ?>" data-term-slug="<?php echo esc_attr( $term_slug ); ?>"> |
| 55 |
<div class="wcf-step"> |
| 56 |
<div class="wcf-step-left-content"> |
| 57 |
<span class="dashicons dashicons-menu"></span> |
| 58 |
<span><?php echo wp_trim_words( get_the_title( $data['id'] ), 3 ); ?></span> |
| 59 |
<span class="wcf-flow-badge"><?php echo esc_attr( $term_name ); ?></span> |
| 60 |
|
| 61 |
<?php |
| 62 |
if ( ! $has_product_assigned ) { |
| 63 |
?> |
| 64 |
<span class="wcf-no-product-badge"><?php _e( 'No Product Assigned', 'cartflows' ); ?></span> |
| 65 |
<?php |
| 66 |
} |
| 67 |
|
| 68 |
?> |
| 69 |
<input type="hidden" class="wcf-steps-hidden" name="wcf-steps[]" value="<?php echo $data['id']; ?>"> |
| 70 |
</div> |
| 71 |
<div class="wcf-steps-action-buttons"> |
| 72 |
<a href="<?php echo get_permalink( $data['id'] ); ?>" target="_blank" class="wcf-step-view wcf-action-button wp-ui-text-highlight" title="<?php echo __( 'View Step', 'cartflows' ); ?>" > |
| 73 |
<span class="dashicons dashicons-visibility"></span> |
| 74 |
<span class="wcf-step-act-btn-text">View</span> |
| 75 |
</a> |
| 76 |
<a href="<?php echo get_edit_post_link( $data['id'] ); ?>" class="wcf-step-edit wcf-action-button wp-ui-text-highlight" title="<?php echo __( 'Edit Step', 'cartflows' ); ?>" > |
| 77 |
<span class="dashicons dashicons-edit"></span> |
| 78 |
<span class="wcf-step-act-btn-text">Edit</span> |
| 79 |
</a> |
| 80 |
<a href="<?php echo wp_nonce_url( 'admin.php?action=cartflows_clone_step&post=' . $data['id'], 'step_clone', 'step_clone_nonce' ); ?>" class="wcf-step-clone wcf-action-button wp-ui-text-highlight" title="<?php echo __( 'Clone Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>"> |
| 81 |
<span class="dashicons dashicons-admin-page"></span> |
| 82 |
<span class="wcf-step-act-btn-text">Clone</span> |
| 83 |
</a> |
| 84 |
<a href="#" class="wcf-step-delete wcf-action-button wp-ui-text-highlight" title="<?php echo __( 'Delete Step', 'cartflows' ); ?>" data-id="<?php echo $data['id']; ?>"> |
| 85 |
<span class="dashicons dashicons-trash"></span> |
| 86 |
<span class="wcf-step-act-btn-text">Delete</span> |
| 87 |
</a> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div><!-- .wcf-step-wrap --> |
| 91 |
<?php } ?> |
| 92 |
<?php } ?> |
| 93 |
</div><!-- .wcf-flow-steps-container --> |
| 94 |
</div> <!-- .wcf-flow-steps-wrap --> |
| 95 |
<div class="wcf-flow-buttons-wrap"> <!-- .wcf-flow-buttons-wrap --> |
| 96 |
<?php do_action( 'cartflows_bellow_flow_steps' ); ?> |
| 97 |
<div class='wcf-add-new-step-btn-wrap'> |
| 98 |
<button class='wcf-trigger-popup button button-primary'> |
| 99 |
<?php echo __( 'Add New Step', 'cartflows' ); ?> |
| 100 |
</button> |
| 101 |
</div> |
| 102 |
</div><!-- .wcf-flow-buttons-wrap --> |
| 103 |
</div><!-- .wcf-flow-settings --> |
| 104 |
|
| 105 |
<div id="wcf-remote-step-importer" class="wcf-templates-popup-overlay"> |
| 106 |
<div class="wcf-templates-popup-content"> |
| 107 |
<div class="spinner"></div> |
| 108 |
<div class="wcf-templates-wrap wcf-templates-wrap-flows"> |
| 109 |
|
| 110 |
<div id="wcf-remote-step-actions" class="wcf-template-header"> |
| 111 |
<div class="wcf-template-logo-wrap"> |
| 112 |
<span class="wcf-cartflows-logo-img"> |
| 113 |
<span class="cartflows-icon"></span> |
| 114 |
</span> |
| 115 |
<span class="wcf-cartflows-title"><?php _e( 'Templates', 'cartflows' ); ?></span> |
| 116 |
</div> |
| 117 |
<div class="wcf-tab-wrapper"> |
| 118 |
<div id="wcf-page-builders"> |
| 119 |
<ul class="wcf-page-builder-links filter-links"> |
| 120 |
<li><a href="#" class="current" data-id="elementor"><?php _e( 'Elementor', 'cartflows' ); ?></a></li> |
| 121 |
<li><a href="#" data-id="divi"><?php _e( 'Divi', 'cartflows' ); ?></a></li> |
| 122 |
<li><a href="#" data-id="bb"><?php _e( 'Beaver Builder', 'cartflows' ); ?></a></li> |
| 123 |
</ul> |
| 124 |
</div> |
| 125 |
</div> |
| 126 |
<div class="wcf-popup-close-wrap"> |
| 127 |
<span class="close-icon"><span class="wcf-cartflow-icons dashicons dashicons-no"></span></span> |
| 128 |
</div> |
| 129 |
</div> |
| 130 |
|
| 131 |
<!--<div class="wcf-search-form"> |
| 132 |
<label class="screen-reader-text" for="wp-filter-search-input"><?php _e( 'Search Sites', 'cartflows' ); ?> </label> |
| 133 |
<input placeholder="<?php _e( 'Search Flow...', 'cartflows' ); ?>" type="text" aria-describedby="live-search-desc" class="wcf-flow-search-input"> |
| 134 |
</div>--> |
| 135 |
<?php if ( ! _is_cartflows_pro() ) { ?> |
| 136 |
<div class="wcf-template-notice"><p><?php echo __( 'You need a Cartflows Pro version to import Upsell / Downsell', 'cartflows' ); ?></p></div> |
| 137 |
<?php } ?> |
| 138 |
<div id="wcf-remote-content"> |
| 139 |
<div id="wcf-remote-step-filters"></div> |
| 140 |
<div id="wcf-remote-step-list" class="wcf-remote-list wcf-template-list-wrap"></div> |
| 141 |
<div id="wcf-upcoming-page-builders" style="display: none;" class="wcf-remote-list wcf-template-list-wrap"></div> |
| 142 |
</div> |
| 143 |
</div> |
| 144 |
</div> |
| 145 |
</div><!-- .wcf-templates-popup-overlay --> |
| 146 |
</div> |
| 147 |
<?php |
| 148 |
|