Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / wcst_modify_positions_shopkeeper_theme.php
Created June 12, 2017 20:54
Change WooCommerce single product positions in Shopkeeper theme for XL WooCommerce Sales Trigger Plugin
/**
* Add This whole code in working theme functions.php inside php tag to alter woocommerce native positions
* Theme: https://themeforest.net/item/shopkeeper-ecommerce-wp-theme-for-woocommerce/9553045
* XL WooCommerce Sales Trigger Class Instance
*/
add_action('wp', 'shokeeper_wcst_modify_positions', 99);
function shokeeper_wcst_modify_positions() {
if (class_exists('WCST_Core')) {
$wcst_plugin_instance = WCST_Core::get_instance();
@xlplugins
xlplugins / wcst_modify_positions_uncode_theme.php
Last active July 4, 2017 09:08
Change WooCommerce single product positions in UNCODE theme for XL WooCommerce Sales Trigger Plugin
/**
* Add This whole code in working theme functions.php inside php tag to alter woocommerce native positions
* Theme: https://themeforest.net/item/uncode-creative-multiuse-wordpress-theme/13373220
* XL WooCommerce Sales Trigger Class Instance
*/
add_action('wp', 'uncode_wcst_modify_positions', 99);
if (!function_exists('uncode_wcst_modify_positions')) {
function uncode_wcst_modify_positions() {
if (class_exists('WCST_Core')) {
@xlplugins
xlplugins / wcct_show_countdown_timer_on_grid.php
Last active June 23, 2017 12:03
Show Campaign Timer on WooCommerce Product Grid
/**
* Customize and show countdown timer on grid
*/
add_filter("wcct_add_timer_to_grid", "custom_wcct_add_timer_to_grid");
function custom_wcct_add_timer_to_grid($config) {
$config = array(
'skin' => 'round_fill', // you can use following values (default | square_ghost | square_fill | round_ghost | round_fill | highlight_1)
'bg_color' => '#666667',
'label_color' => '#ffffff',
@xlplugins
xlplugins / wcct_show_counter_bar_on_grid.php
Last active June 23, 2017 11:58
Show Inventory Bar on WooCommerce Product Grid
/**
* Customize and show inventory bar on grid
*/
add_filter("wcct_add_bar_to_grid", "custom_wcct_add_bar_to_grid");
function custom_wcct_add_bar_to_grid($config)
{
$config = array(
'skin' => 'stripe_animate',
'edge' => 'smooth',
@xlplugins
xlplugins / wcct_modify_shop_loop_position.php
Created June 23, 2017 15:41
This code runs with Finale: WooCommerce Countdown Timer plugin. Unhook the grid display function on native 'woocommerce_after_shop_loop_item' handle and register with new position handle
/**
* Add This whole code in working theme functions.php inside php tag to alter woocommerce native 'shop loop' position
* Finale WooCommerce Sales Trigger
* https://xlplugins.com/finale-woocommerce-sales-countdown-timer-discount-plugin/
*/
add_action('wp', 'theme_slug_wcct_modify_positions', 99);
if (!function_exists('theme_slug_wcct_modify_positions')) {
function theme_slug_wcct_modify_positions() {
if (function_exists('WCCT_Core')) {
@xlplugins
xlplugins / wcct_positions_master.php
Last active September 13, 2017 07:08
Change Positions of Timers and Triggers against WC Native positions
<?php
/**
* Change positions against woocommerce native positions.
* Code to be placed inside child theme's functions.php file
*/
add_action('woocommerce_before_template_part', 'wcst_theme_helper_float_before_template_part', 99);
function wcst_theme_helper_float_before_template_part($template_name = '', $template_path = '', $located = '', $args = array()) {
@xlplugins
xlplugins / wcct_best_seller_static_content.php
Created July 7, 2017 10:20
Allow Best Seller badge to Show Static Text Badge that do not process orders.
<?php
/**
** Allow Best seller badge to show wihout processing orders
**/
add_filter('wcst_show_static_best_seller_badge', 'wcst_static_best_seller_badge',10,3);
/**
* Hooked intp 'wcst_show_static_best_seller_badge'
* Decide whether to show static content or not by checking merge tagv precense in the content
@xlplugins
xlplugins / wcst_custom_orer_statuses.php
Last active April 16, 2018 07:42
Sales Trigger: Add more WC States to Sales Count or Sales Snippet triggers data fetching.
<?php
/**
* Add your custom order statuses to sales snippet or count triggers
*/
if ( ! function_exists( 'theme_modify_wcst_custom_wc_order_states' ) ) {
add_filter( 'wcst_modify_wc_order_states', 'theme_modify_wcst_custom_wc_order_states', 90 );
/**
* Hooked into `wcst_modify_wc_order_states`
@xlplugins
xlplugins / wcst_theme_positions_wowmall.php
Created July 13, 2017 15:09
Change WooCommerce single product positions in WOWMALL theme for XL WooCommerce Sales Trigger Plugin
<?php
add_action('wp', 'wcst_theme_helper_wowmall', 99);
function wcst_theme_helper_wowmall() {
$wcst_core = WCST_Core::get_instance();
remove_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_add_cart'), 39.2);
add_action('woocommerce_single_product_summary', array($wcst_core, 'wcst_position_below_add_cart'), 39);
remove_action( 'woocommerce_single_product_summary', 'wowmall_wc_single_btns_wrapper_end', 39 );
add_action( 'woocommerce_single_product_summary', 'wowmall_wc_single_btns_wrapper_end', 38 );
@xlplugins
xlplugins / wcst_xstore_theme_add_countdown_timer_and_bar_on_grid_loop.php
Created July 14, 2017 14:35
Change action hook position of shop loop function and hook in Finale countdown timer or counter bar
<?php
/**
* Add This whole code in working theme functions.php inside php tag to alter woocommerce shop loop native position
* Theme: X Store https://themeforest.net/item/xstore-responsive-woocommerce-theme/15780546
* Plugin: Finale - WooCommerce Sales Countdown Timer & Discount Plugin
*/
add_action('wp', 'wcct_xstore_modify_positions', 99);
if (!function_exists('wcct_xstore_modify_positions')) {