Skip to content

Instantly share code, notes, and snippets.

View iamsathyaseelan's full-sized avatar

Sathyaseelan iamsathyaseelan

View GitHub Profile
@iamsathyaseelan
iamsathyaseelan / invalid_order_status_for_ababdoned_cart.php
Last active December 16, 2019 04:55
consider following order status as abandoned order
<?php
add_filter("rnoc_abandoned_cart_invalid_order_statuses","rnoc_invalid_order_status_to_consider_as_abandoned_cart");
if(!function_exists("rnoc_invalid_order_status_to_consider_as_abandoned_car")){
function rnoc_invalid_order_status_to_consider_as_abandoned_cart($invalid_order_status){
/* Replace processing with invalid order status */
$invalid_order_status[] = "processing";
return $invalid_order_status;
}
}
?>
<?php
//Example:https://nimb.ws/PumFqI
if(!function_exists("rnoc_exit_intent_popup_condition_coupons")){
function rnoc_exit_intent_popup_condition_coupons($to_replace){
$cart_total = 0;
if(function_exists("WC")){
$cart_total = WC()->cart->total;
}
$coupon_code = "";
if($cart_total >100){
@iamsathyaseelan
iamsathyaseelan / add_to_cart_addon_popup_classes.php
Last active September 25, 2019 05:04
Retainful Premium - add to cart email collection (show popup for pages building using page builders)
/*
* Replace 'add_to_cart_button_classes' values with comma seperated multiple classes
*/
add_filter('retainful_premium_add_to_cart_collection_button_classes',function($classes){
//For version 1.0.9 above
return $classes['add_to_cart_button_classes'] = '.elementor-button-link';
//For version 1.0.9 and below
//return array('add_to_cart_button_classes' => '.elementor-button-link');
});
@iamsathyaseelan
iamsathyaseelan / support_print_invice_for_retainful.php
Last active August 19, 2019 11:51
Code snippet to show next order coupon while printing invoice using "WooCommerce Print Invoice & Delivery Note"
/*
* 1. wcdn_after_branding => After the invoice logo
* 2. wcdn_after_addresses => After displaying the billing and shipping address
* 3. wcdn_after_info => After order details
* 4. wcdn_after_items => After the order items table
* 5. wcdn_after_notes => After the order notes
* 6. wcdn_after_thanks => After thanks
* 7. wcdn_after_colophon => After colophon
*
* Replace `wcdn_after_addresses` with any other mentioned hooks to change the display position