Example #1
0
                        <input type="checkbox" class="input-checkbox" name="terms" <?php 
        checked($terms_is_checked, true);
        ?>
 id="terms" />
                    </p>
                <?php 
    }
    ?>

                <?php 
    do_action('woocommerce_review_order_after_submit');
    ?>

            </div>

            <div class="clear"></div>

        </div>

        <?php 
    do_action('woocommerce_review_order_after_payment');
    ?>
    <?php 
}
?>

<?php 
if (version_compare($porto_woo_version, '2.3', '<') && !porto_is_ajax()) {
    ?>
</div><?php 
}
Example #2
0
    ?>
').easyResponsiveTabs({
                type: '<?php 
    echo esc_js($porto_settings['product-tabs']);
    ?>
', //Types: default, vertical, accordion
                width: 'auto', //auto or any width like 600px
                fit: true,   // 100% fit in a container
                closed: 'accordion', // Start closed if in accordion view
                activate: function(event) { // Callback function if tab is switched

                }
            });

            <?php 
    if (!porto_is_ajax()) {
        ?>
            // go to reviews, write a review
            $('.woocommerce-review-link, .woocommerce-write-review-link').click(function(e) {
                var recalc_pos = false;
                if ($('#content #tab-reviews').css('display') != 'block') {
                    recalc_pos = true;
                }
                if ($("h2[aria-controls=tab_item-<?php 
        echo esc_js($review_index);
        ?>
]").length && $("h2[aria-controls=tab_item-<?php 
        echo esc_js($review_index);
        ?>
]").next().css('display') == 'none')
                    $("h2[aria-controls=tab_item-<?php 
Example #3
0
        ?>
</a></div>
        <?php 
    }
    ?>
	</div>

<?php 
} else {
    ?>

    <?php 
    if (comments_open()) {
        ?>
        <div class="woocommerce-product-rating noreview">
            <a href="<?php 
        if (porto_is_ajax()) {
            the_permalink();
        }
        ?>
#review_form" class="woocommerce-write-review-link" rel="nofollow"><?php 
        echo __('Be the first to review', 'woocommerce');
        ?>
</a>
        </div>
    <?php 
    }
    ?>

<?php 
}
Example #4
0
function porto_woocommerce_init()
{
    global $porto_settings;
    // Hide product short description
    if (isset($porto_settings['catalog-enable']) && !$porto_settings['product-short-desc']) {
        remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20);
    }
    // Catalog Mode
    if (isset($porto_settings['catalog-enable']) && $porto_settings['catalog-enable']) {
        if ($porto_settings['catalog-admin'] || !$porto_settings['catalog-admin'] && !(current_user_can('administrator') && is_user_logged_in())) {
            if (!$porto_settings['catalog-price']) {
                remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
                remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10);
                add_filter('woocommerce_get_price_html', 'porto_woocommerce_get_price_html_empty', 100, 2);
                add_filter('woocommerce_cart_item_price', 'porto_woocommerce_get_price_empty', 100, 3);
                add_filter('woocommerce_cart_item_subtotal', 'porto_woocommerce_get_price_empty', 100, 3);
                add_filter('woocommerce_cart_subtotal', 'porto_woocommerce_get_price_empty', 100, 3);
                add_filter('woocommerce_get_variation_price_html', 'porto_woocommerce_get_price_html_empty', 100, 2);
            }
            if (!$porto_settings['catalog-cart']) {
                remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30);
                add_action('woocommerce_single_product_summary', 'porto_woocommerce_template_single_add_to_cart', 30);
                remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
                if ($porto_settings['catalog-readmore']) {
                    add_action('woocommerce_single_product_summary', 'porto_woocommerce_readmore_button', 30);
                } else {
                    if ($porto_settings['category-addlinks-pos'] == 'outimage') {
                        $porto_settings['category-addlinks-pos'] = 'onimage';
                    }
                }
            }
            if (!$porto_settings['catalog-review']) {
                add_filter('pre_option_woocommerce_enable_review_rating', 'porto_woocommerce_disable_rating');
                add_filter('woocommerce_product_tabs', 'porto_woocommerce_remove_reviews_tab', 98);
                function porto_woocommerce_remove_reviews_tab($tabs)
                {
                    unset($tabs['reviews']);
                    return $tabs;
                }
            }
        }
    }
    // change product tabs position
    if (!porto_is_ajax() && isset($porto_settings['product-tabs-pos']) && $porto_settings['product-tabs-pos'] == 'below') {
        remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs');
        add_action('woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 25);
    }
}
Example #5
0
<?php

/**
 * Porto Theme Options
 */
require_once porto_admin . '/functions.php';
// include redux framework core functions
require_once porto_admin . '/ReduxCore/framework.php';
// porto theme settings options
require_once porto_admin . '/porto/settings.php';
require_once porto_admin . '/porto/save_settings.php';
if (get_option('porto_init_theme', '0') != '1') {
    porto_check_theme_options();
}
// regenerate default css, skin css files after update theme
$porto_cur_version = get_option('porto_version', '1.0');
if (!porto_is_ajax() && version_compare(porto_version, $porto_cur_version, '>') && version_compare(phpversion(), '5.3', '>=')) {
    update_option('porto_version', porto_version);
    @ini_set('max_execution_time', '10000');
    @ini_set('memory_limit', '256M');
    // regenerate default css
    if (file_exists(porto_dir . '/css/plugins_rtl_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/plugins_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_rtl_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_rtl_shop_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_shop_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_rtl_bbpress_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/theme_bbpress_' . porto_get_blog_id() . '.css')) {
        porto_compile_css(true);
    }
    // regenerate skin css
    if (file_exists(porto_dir . '/css/skin_rtl_' . porto_get_blog_id() . '.css') || file_exists(porto_dir . '/css/skin_' . porto_get_blog_id() . '.css')) {
        porto_save_theme_settings();
    }
}
update_option('porto_version', porto_version);
Example #6
0
            remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
            $porto_settings['category-addlinks-pos'] = 'onimage';
        }
        if (!$porto_settings['catalog-review']) {
            add_filter('pre_option_woocommerce_enable_review_rating', 'porto_woocommerce_disable_rating');
            add_filter('woocommerce_product_tabs', 'porto_woocommerce_remove_reviews_tab', 98);
            function porto_woocommerce_remove_reviews_tab($tabs)
            {
                unset($tabs['reviews']);
                return $tabs;
            }
        }
    }
}
function porto_woocommerce_get_price_html_empty($price, $product)
{
    return '';
}
function porto_woocommerce_get_price_empty($price, $param2, $param3)
{
    return '';
}
function porto_woocommerce_disable_rating($false)
{
    return 'no';
}
// change product tabs position
if (!porto_is_ajax() && isset($porto_settings['product-tabs-pos']) && $porto_settings['product-tabs-pos'] == 'below') {
    remove_action('woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs');
    add_action('woocommerce_single_product_summary', 'woocommerce_output_product_data_tabs', 25);
}