Example #1
0
    protected function content($atts, $content = null)
    {
        $custom_css = $el_class = $title = $icon = $output = $s_content = $m_link = $payment_plan_feature = $payment_plan = '';
        extract(shortcode_atts(array('el_class' => '', 'payment_plan' => '', 'number_plan' => 4), $atts));
        /* ================  Render Shortcodes ================ */
        ob_start();
        ?>
        <!-- PRICING -->
        <?php 
        global $ae_post_factory;
        $ae_pack = AE_Package::get_instance();
        $ae_pack = $ae_post_factory->get('pack');
        $packs = $ae_pack->fetch();
        $pack_currency = ae_get_option('currency');
        $i = 0;
        $col = 'col-md-3 col-sm-6 col-xs-6';
        $class_width = '';
        if ($number_plan == 3) {
            $col = 'col-md-4 col-sm-4 col-xs-6';
            $class_width = 'width-880';
        }
        if ($number_plan == 2) {
            $col = 'col-md-6 col-sm-6 col-xs-6';
            $class_width = 'width-580';
        }
        ?>
        <div class="pricing-container">
            <div class="container  <?php 
        echo $class_width;
        ?>
 " >
            <div class="row">
            <?php 
        foreach ($packs as $key => $package) {
            $i++;
            if ($i > $number_plan) {
                break;
            }
            $pack = $ae_pack->convert($package);
            ?>
                <div class="<?php 
            echo $col;
            ?>
 pricing-item">
                    <div class="pricing <?php 
            echo $payment_plan_feature ? 'active' : '';
            ?>
 ">
                        <div class="pricing-number pricing-wrapper">
                            <h2 class="price">
                                <?php 
            if ($pack->et_price > 0) {
                ae_price($pack->et_price);
            } else {
                _e("FREE", ET_DOMAIN);
            }
            ?>
                            </h2>
                            <span>
                                <?php 
            echo $pack->backend_text;
            ?>
                            </span>
                        </div>
                        <div class="pricing-content">
                            <h3 class="pricing-title"><?php 
            echo $pack->post_title;
            ?>
</h3>
                            <div class="pricing-detail">
                                <?php 
            echo $pack->post_content;
            ?>
                            </div>
                            <div class="submit-price">
                                <a href="<?php 
            echo et_get_page_link(array('page_type' => 'submit-project'));
            ?>
" class="btn-sumary btn-price">
                                    <?php 
            if (!is_user_logged_in()) {
                _e('Sign Up', ET_DOMAIN);
            } else {
                _e("Submit Project", ET_DOMAIN);
            }
            ?>
                                </a>
                            </div>
                        </div> 
                    </div>
                </div>
                <?php 
        }
        ?>
            </div>
            </div>
        </div>
        <?php 
        $output = ob_get_clean();
        /* ================  Render Shortcodes ================ */
        return $output;
    }
Example #2
0
function cash_upproved($post_ID, $post)
{
    if (current_user_can('manage_options')) {
        if ($post->post_type == 'order' && $post->post_status == 'publish') {
            $order = new AE_Order($post_ID);
            $order_pay = $order->get_order_data();
            if (isset($order_pay['payment']) && $order_pay['payment'] == 'cash') {
                $products = $order_pay['products'];
                $sku = $order_pay['payment_package'];
                $packs = AE_Package::get_instance();
                $pack = $packs->get_pack($sku, 'bid_plan');
                if (isset($pack->et_number_posts) && (int) $pack->et_number_posts > 0) {
                    update_credit_number($post->post_author, (int) $pack->et_number_posts);
                }
            }
        }
    }
}