Skip to content

Instantly share code, notes, and snippets.

<?php
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
<?php
function wpt_custom_remove_default_sort( $classes ){
$key = array_search('wpt_column_sort',$classes);
unset($classes[$key]);
$key2 = array_search(' wpt_column_sort',$classes);
unset($classes[$key2]);
return $classes;
}
add_filter('wpt_wrapper_class','wpt_custom_remove_default_sort');
@codeastrology-dev
codeastrology-dev / view_cart_text.php
Last active October 30, 2022 07:12
Footer cart view cart text change
<?php
function wpt_view_cart_text_changer_callback($view_cart_text, $table_id){
$view_cart_text = 'Show';
return $view_cart_text;
}
add_filter('wpt_view_cart_text', 'wpt_view_cart_text_changer_callback',10,2);
@codeastrology-dev
codeastrology-dev / minifilter_taxonomy.php
Created October 30, 2022 06:13
Mini filter taxonomy names
<?php
if( !function_exists( 'codeastrology_wpt_minifilter_taxonomy_name' ) ){
function codeastrology_wpt_minifilter_taxonomy_name($label, $texonomy_name){
if($texonomy_name == 'product_cat'){
return "Filter By Categoty";
}
if($texonomy_name == 'product_tag'){
return "Filter By Tag";
}
return $label;
woocommerce_add_cart_item_data
woocommerce_checkout_create_order_line_item
woocommerce_get_item_data
@codeastrology-dev
codeastrology-dev / function wp_maintenance_mode()
Created September 11, 2022 09:14
function wp_maintenance_mode()
// Activate WordPress Maintenance Mode
function wp_maintenance_mode() {
if (!current_user_can(‘edit_themes’) || !is_user_logged_in()) {
wp_die(‘<h1>Under Maintenance</h1><br />Website under planned maintenance. Please check back later.’);
}
}
add_action(‘get_header’, ‘wp_maintenance_mode’);
@codeastrology-dev
codeastrology-dev / maintenance.html
Created September 11, 2022 08:44
maintenance.html
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ https://example.com/maintenance.html [R=307,L]
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<item>
<title>image-835634856_324234</title>
<link>https://codeastrology.com/wp-content/uploads/image-835634856_324234-5/</link>
<pubDate>Sun, 13 AUG 2022 21:17:52 +0000</pubDate>
<dc:creator><![CDATA[devowl]]></dc:creator>
<guid isPermaLink="false">https://codeastrology.com/wp-content/uploads/image-835634856_324234.jpg?sc=56</guid>
<description></description>
<content:encoded><![CDATA[]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
@codeastrology-dev
codeastrology-dev / Add to Cart(Selected)
Created August 11, 2022 06:42
Add to Cart(Selected)
add_action( 'wp_footer','codeAstroly_change_add_cart_selected_text',100);
function codeAstroly_change_add_cart_selected_text(){
?>
<script>
jQuery(document).ready(function($){
$(document).on('wpt_count_updated',function(aaa,args){
var btn = args['button_object'];
var itemAmount = args['itemAmount'];
var button_text = args['button_text'];
var custom_text = 'Added';