This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('wp_head', function () { | |
global $template; | |
echo $template; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header class="woocommerce-products-header"> | |
<?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?> | |
<h1 class="woocommerce-products-header__title page-title"><?php echo strtoupper(woocommerce_page_title(false)); ?></h1> | |
<?php endif; ?> | |
<?php | |
/** | |
* Hook: woocommerce_archive_description. | |
* | |
* @hooked woocommerce_taxonomy_archive_description - 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined( 'ABSPATH' ) or die( 'No direct access please!' ); | |
/* | |
Plugin Name: VG Woo Sort | |
Description: Aditional sort for WooCommerce Shop | |
Version: 1.0 | |
Author: Vijayan G | |
Author URI: www.vijayan.in | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Show options for ordering | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/loop/orderby.php. | |
* | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined( 'ABSPATH' ) or die( 'No direct access please!' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Plugin Name: VG Woo Sort | |
Description: Aditional sort for WooCommerce Shop | |
Version: 1.0 | |
Author: Vijayan G | |
Author URI: www.vijayan.in | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Plugin Name: VG Woo Sort | |
Description: Aditional sort for WooCommerce Shop | |
Version: 1.0 | |
Author: Vijayan G | |
Author URI: www.vijayan.in | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Callback method to implement A-Z & Z-A sort functionality | |
* | |
* @since 1.0 | |
*/ | |
public function custom_woocommerce_get_catalog_ordering_args( $args ) { | |
$orderby_value = isset( $_GET['orderby'] ) ? | |
wc_clean( $_GET['orderby'] ) : | |
apply_filters( 'woocommerce_default_catalog_orderby', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function custom_woocommerce_catalog_orderby( $sortby ) { | |
$sortby = [ | |
'menu_order' => __( 'Default', 'woocommerce'), | |
'alpha_list' => __('A - Z', 'woocommerce'), | |
'reverse_list' => __( 'Z - A', 'woocommerce'), | |
'popularity' => __( 'Popularity', 'woocommerce' ), | |
'rating' => __( 'Average rating', 'woocommerce' ), | |
'date' => __( 'Latest', 'woocommerce' ), | |
'price' => __( 'Price: low to high', 'woocommerce' ), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_get_catalog_ordering_args', array('VG_Sort', 'custom_woocommerce_get_catalog_ordering_args' )); | |
add_filter( 'woocommerce_default_catalog_orderby_options', array('VG_Sort', 'custom_woocommerce_catalog_orderby' )); | |
add_filter( 'woocommerce_catalog_orderby', array('VG_Sort', 'custom_woocommerce_catalog_orderby' )); |