Skip to content

Instantly share code, notes, and snippets.

View iamsathyaseelan's full-sized avatar

Sathyaseelan iamsathyaseelan

View GitHub Profile
@iamsathyaseelan
iamsathyaseelan / line_sub_total.php
Created May 21, 2020 06:30
line subtoal change
add_filter('retainful_get_line_item_total','retainful_get_line_item_total',10,5);
function retainful_get_line_item_total($total, $line_total, $line_total_tax, $item_details,$cart){
$line_total = (isset($item_details['line_subtotal']) && !empty($item_details['line_subtotal'])) ? $item_details['line_subtotal'] : $total;
return $line_total;
}
@iamsathyaseelan
iamsathyaseelan / change-recovery-url.php
Created May 11, 2020 05:44
change recovery url retainful
add_filter('retainful_recovery_redirect_url','retainful_recovery_redirect_url');
function retainful_recovery_redirect_url($url){
$url = wc_get_cart_url();
return $url;
}
@iamsathyaseelan
iamsathyaseelan / order_items.php
Created May 8, 2020 05:29
gist to hide paymant method in order items table
<div class="email-product-list" style="padding: 15px 25px;">
<?php
/**
* Order details table shown in emails.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you (the theme developer).
* will need to copy the new files to your theme to maintain compatibility. We try to do this.
* as little as possible, but it does happen. When this occurs the version of the template file will.
* be bumped and the readme will list any important changes.
*/
@iamsathyaseelan
iamsathyaseelan / free-sample-product-title.php
Created April 6, 2020 11:00
getting free sample products
add_filter('rnoc_get_cart_line_item_details', 'rnoc_get_cart_line_item_details', 10, 5);
function rnoc_get_cart_line_item_details($item_array, $cart, $item_key, $item, $item_details)
{
if ($item_array['title'] == "Free Sample" && isset($item_details['free_sample']) && !empty($item_details['free_sample'])) {
$product = wc_get_product($item_details["free_sample"]);
$name = $item_array['title'] . " (" . $product->get_name() . ")";
$item_array['title'] = $name;
}
return $item_array;
}
@iamsathyaseelan
iamsathyaseelan / change_order_Status.php
Created March 11, 2020 06:12
changing the order status of the abandoned order to recover the order
add_filter('rnoc_abandoned_cart_order_status','rnoc_abandoned_cart_order_status',10,2);
function rnoc_abandoned_cart_order_status($order_status,$order){
if(in_array($order_status,array("cancelled","failed"))){
$order_status = "pending";
}
return $order_status;
}
@iamsathyaseelan
iamsathyaseelan / snippet-noc-for-particular-order-status.php
Created March 4, 2020 13:13
allowing the next order coupons for particular order emails only
add_filter('rnoc_before_displaying_next_order_coupon','rnoc_before_displaying_next_order_coupon',10,2);
function rnoc_before_displaying_next_order_coupon($message,$order){
if (method_exists($order, 'get_status')) {
$order_status = $order->get_status();
$order_status = strtolower($order_status);
if($order_status == "processing"){
return $message;
}else{
return '';
}
@iamsathyaseelan
iamsathyaseelan / exit-intent-popup-with-areocheckout
Created February 28, 2020 08:05
exit intent popup was not showed with areo checkout
/* Retainful exit intent popup in checkout*/
add_filter("rnoc_load_exit_intent_popup_scripts_after","rnoc_load_exit_intent_popup_scripts",10);
function rnoc_load_exit_intent_popup_scripts($dependencies){
if(is_checkout()){
return array();
}
return $dependencies;
}
add_filter("rnoc_load_exit_intent_popup_settings","rnoc_load_exit_intent_popup_settings",10);
function rnoc_load_exit_intent_popup_settings($settings){
@iamsathyaseelan
iamsathyaseelan / rnoc_override_product_image_url.php
Created February 17, 2020 13:01
override product image URL
add_filter('rnoc_get_product_image_src','rnoc_override_product_image_url',10,2);
function rnoc_override_product_image_url($url,$product){
$url = str_replace('wp-content/uploads','zova_uploads',$url);
return $url;
}
wp-content/themes/tatara/js/ajax.js
Line number : 12
Original:
=========
if (response) {
setTimeout(function () {
$('.cart_popup').html(response);
}, 500);
@iamsathyaseelan
iamsathyaseelan / removing-retainful-log.php
Created December 23, 2019 12:48
removing the retainful log
<?php
if(is_admin()) {
add_action('init', function () {
$path = ABSPATH . 'wp-content/retainful.log';
if (file_exists($path)) {
unlink($path);
}
});
}
?>