Skip to content

Instantly share code, notes, and snippets.

View xlplugins's full-sized avatar

XLPlugins xlplugins

View GitHub Profile
@xlplugins
xlplugins / gravityxl-scheduled-export-entry.php
Last active July 6, 2023 03:38
Schedule Export for Gravity Forms Entries
<?php
/**
* @package Gravity XL Scheduled Entries Export
* @version 1.0
* @name gravityxl -scheduled-entries-export
* @author Gravity XL
*/
/**
* Schedule gform Entry export
*
@xlplugins
xlplugins / gravityxl-live-html-preview.php
Last active December 6, 2016 13:14
Generate Live Preview of number & total fields embedded by merge tags in Gravity Form's HTML field
/**
* @package Gravity XL Live Html Preview
* @version 1.0
* @name gravity -gravity_xl-live-html-preview
* @author Gravity XL
*/
/**
* Make html field show live calculations and totals embedded
*
*/
@xlplugins
xlplugins / wcst_handle_pricing_hook_conflict.php
Last active October 7, 2019 10:01
XL WooCommerce Sales Triggers plugin change priority of native action hook 'woocommerce_single_product_summary' for price 'woocommerce_template_single_price'. If any theme (Premium/ Custom) not using native price action hook i.e. removed. Then add below line on code in your theme (parent/ child) functions.php to get rid of default pricing.
add_action('wp', 'theme_remove_native_pricing', 999);
if(!function_exists('theme_remove_native_pricing')) {
function theme_remove_native_pricing() {
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 14.9);
}
}
@xlplugins
xlplugins / xl-woocommerce-sales-triggers-smarter-reviews-yotpo-integration.php
Created February 16, 2017 16:00
This is a patch snippet used for XL WooCommerce Sales Triggers plugin to hook in YOTPO Reviews to Smarter Reviews Trigger.
<?php
/**
* YOTPO Review System Code
*/
$wcst_plugin_instance = WCST_Core::get_instance();
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_review'), 11);
add_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_below_review'), 8);
add_filter('wcst_smarter_reviews_single_arr', 'wcst_modify_smarter_reviews_data', 10, 3);
@xlplugins
xlplugins / wcst_modify_hard_values.php
Created May 12, 2017 11:42
Change days, hrs, mins seconds like hard text in XL WooCommerce Sales Trigger Plugin
/**
* Add below code in theme functions.php file to change days, hrs, mins seconds like hard text
**/
add_filter('wcst_modify_hard_values', 'wcst_modify_hard_values', 10, 1);
function wcst_modify_hard_values($array) {
$array['others'] = 'andre';
$array['other'] = 'annen';
$array['from'] = 'fra ';
$array['in'] = 'i';
$array['&'] = '& ';
@xlplugins
xlplugins / wcst_modify_positions_hcode_theme.php
Created May 13, 2017 07:52
Change WooCommerce single product positions in H-Code theme for XL WooCommerce Sales Trigger Plugin
/**
* Add This whole code in working theme functions.php to alter woocommerce native positions
*
* XL WooCommerce Sales Trigger Class Instance
*/
if (class_exists('WCST_Core')) {
$wcst_plugin_instance = WCST_Core::get_instance();
// removing all positions based action hooks
remove_action('woocommerce_single_product_summary', array($wcst_plugin_instance, 'wcst_position_above_title'), 2.2);
@xlplugins
xlplugins / wcst_show_product_views.php
Last active July 7, 2017 10:23
Modify Existing Trigger Content To Show Product Views Just like any other trigger.
<?php
/**
* Show number of people viewing this product by modifying existing trigger content
*/
add_filter('wcst_guarantee_display_content', 'wcst_guarantee_display_content_modify', 10, 5);
/**
* Modifies and HTML for a existing trigger to show number of people viewing this product
* @hooked over `wcst_guarantee_display_content`
* @param string $gurantee_html Existing Guarantee HTML
@xlplugins
xlplugins / wcst_modify_sales_count_by_filter.php
Last active September 28, 2017 06:17
Modify Sales Count using Filter `wcst_sales_count_display_content_before_data`
<?php
/**
* Modify Sales Count display content to show random sales count
*/
add_filter('wcst_sales_count_display_content_before_data', 'wcst_sales_count_display_content_before_data_modify', 10,5);
/**
* @hooked into `wcst_sales_count_display_content_before_data`
* Modifies sales count value before rendering of sales count snippet
/**
* Modify best seller badge HTML contact to reorder Elements
*/
add_filter('wcst_best_seller_badge_display_content', 'wcst_best_seller_badge_display_content_modify', 10, 6);
/**
* @hooked into `wcst_best_seller_badge_display_content`
* Reorder HTML elements for Xl sales triggers's best seller badge
@xlplugins
xlplugins / wcst_modify_positions_float_theme.php
Last active July 4, 2017 12:17
Change WooCommerce single product positions in Float 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/float-minimalist-ecommerce-theme/19868208
* XL WooCommerce Sales Trigger Class Instance
*/
add_action('wp', 'float_wcct_modify_positions', 99);
function float_wcct_modify_positions() {
if (class_exists('WCST_Core')) {