예제 #1
0
<?php

define("COMPARE_WOO_PLUGIN_URL", WOO_PLUGIN_URL . "/compare");
define("COMPARE_COOKIE_NAME", "as_compare_products");
/* ----------------------------------------------------------------------------------- */
/* Ajax   */
/* ----------------------------------------------------------------------------------- */
add_ajax("as_add_compare", "as_ajax_add_compare_product");
add_ajax("as_remove_compare", "as_ajax_remove_compare_product");
/* ----------------------------------------------------------------------------------- */
/* Filters   */
/* ----------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------- */
/* Actions   */
/* ----------------------------------------------------------------------------------- */
add_action('wp_enqueue_scripts', 'as_compare_scripts');
add_action('woocommerce_after_add_to_cart_button', 'as_after_add_to_cart_button');
/* ----------------------------------------------------------------------------------- */
/* ShortCodes   */
/* ----------------------------------------------------------------------------------- */
add_shortcode('as_compare', 'as_shortcode_page_compare');
function as_compare_scripts()
{
    add_script('compare', COMPARE_WOO_PLUGIN_URL . '/js/compare.js', array('jquery'));
}
function as_shortcode_page_compare()
{
    include_once dirname(__FILE__) . '/template/compare-page.php';
}
function as_ajax_add_compare_product()
{
예제 #2
0
<?php

define("WISHLIST_WOO_PLUGIN_URL", WOO_PLUGIN_URL . "/wish-list");
define("WISHLIST_COOKIE_NAME", "as_wishlist_products");
/* ----------------------------------------------------------------------------------- */
/* Ajax   */
/* ----------------------------------------------------------------------------------- */
add_ajax("as_add_wish_list", "as_ajax_add_wish_list_product");
add_ajax("as_remove_wish_list", "as_ajax_remove_wish_list_product");
/* ----------------------------------------------------------------------------------- */
/* Filters   */
/* ----------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------- */
/* Actions   */
/* ----------------------------------------------------------------------------------- */
add_action('wp_enqueue_scripts', 'as_wishlist_scripts');
add_action('woocommerce_after_add_to_cart_button', 'as_wish_list_after_add_to_cart_button');
/* ----------------------------------------------------------------------------------- */
/* ShortCodes   */
/* ----------------------------------------------------------------------------------- */
add_shortcode('as_wish_list', 'as_shortcode_page_wish_list');
function as_wishlist_scripts()
{
    add_script('wishlist', WISHLIST_WOO_PLUGIN_URL . '/js/wish-list.js', array('jquery'));
}
function as_shortcode_page_wish_list()
{
    include_once dirname(__FILE__) . '/template/wish-list-page.php';
}
function as_ajax_add_wish_list_product()
{
예제 #3
0
<?php

define("WOO_PLUGIN_URL", TEMPLATEURL . "/plugins/woocommerce");
/* ----------------------------------------------------------------------------------- */
/* Wishlist   */
/* ----------------------------------------------------------------------------------- */
require_once dirname(__FILE__) . "/wish-list/wish-list.php";
require_once dirname(__FILE__) . "/compare/compare.php";
if (class_exists('Woocommerce')) {
    /* ----------------------------------------------------------------------------------- */
    /* Ajax   */
    /* ----------------------------------------------------------------------------------- */
    add_ajax('remove_product', 'as_remove_product_from_cart');
    add_ajax('as_quick_view', 'as_load_product_quick_view');
    /* ----------------------------------------------------------------------------------- */
    /* Filters   */
    /* ----------------------------------------------------------------------------------- */
    add_filter('body_class', 'woo_columns_body_class');
    add_filter('loop_shop_per_page', create_function('$limit', 'return ' . as_option('as_woo_item_per_page') . ';'), 20);
    add_filter('woocommerce_enqueue_styles', 'jk_dequeue_styles');
    add_filter('woocommerce_show_page_title', 'override_page_title');
    add_filter('loop_shop_columns', create_function('$cols', 'return ' . as_option('woo_listing_column_number') . ';'), 20);
    /* ----------------------------------------------------------------------------------- */
    /* Actions   */
    /* ----------------------------------------------------------------------------------- */
    add_action('wp_enqueue_scripts', 'as_woo_enqueue_scripts');
    add_action('init', 'jk_remove_wc_breadcrumbs');
    add_action('woocommerce_before_shop_loop_item_title', 'as_woo_template_loop_second_product_thumbnail', 11);
    add_action('woocommerce_before_shop_loop_item_title_module_dslc', 'as_woo_template_loop_second_product_thumbnail', 11);
    /* ----------------------------------------------------------------------------------- */
    /* Remove Woo Default Styles  */
예제 #4
0
<?php

/* ----------------------------------------------------------------------------------- */
/* 	Init Ajax */
/* ----------------------------------------------------------------------------------- */
add_ajax('as_load_project', 'load_project');
add_ajax('as_like_post', 'like_post');
/* ----------------------------------------------------------------------------------- */
/* 	Init Functions */
/* ----------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------- */
/* Ajax Project
  /*----------------------------------------------------------------------------------- */
function load_project()
{
    $data = $_REQUEST['content'];
    $project = get_post($data['id']);
    $project_permalink = get_permalink($project->ID);
    $project_url = get_post_meta($project->ID, 'dslc_project_url', true);
    $project_url_text = get_post_meta($project->ID, 'dslc_project_url_text', true);
    $project_name = get_post_meta($project->ID, 'dslc_project_name', true);
    $cats = array();
    $terms = get_the_terms($project->ID, 'dslc_projects_cats');
    foreach ($terms as $term) {
        $cats[] = $term->name;
    }
    $dslc_projects_cats = join(', ', $cats);
    $fb_share = '<li><a class="as-port-ajax-social-facebook" href="http://www.facebook.com/sharer/sharer.php?u=' . $project_permalink . '" onclick="javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=660\');return false;" target="_blank"><span class="dslc-icon dslc-icon-facebook"></span></a></li>';
    $twitter_share = '<li><a class="as-port-ajax-social-twitter" href="http://twitter.com/share?url=' . $project_permalink . '&amp;lang=en&amp;text=Check%20out%20this%20awesome%20project:&amp;" onclick="javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=620\');return false;" data-count="none" data-via=" "><span class="dslc-icon dslc-icon-twitter"></span></a></li>';
    $google_share = '<li><a class="as-port-ajax-social-google" href="https://plus.google.com/share?url=' . $project_permalink . '" onclick="javascript:window.open(this.href,\'\', \'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=400,width=500\');return false;"><span class="dslc-icon dslc-icon-google-plus"></span></a></li>';
    $btn_get = '<a href="' . $project_url . '" class="as-get-in-touch-prj-ajax">' . __('Visit Project', AS_DOMAIN) . '</a>';