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
phpcs --standard=WordPress templates/request-quote-view.php | |
#hide warning | |
phpcs --standard=WordPress -n templates/request-quote-view.php | |
#automation | |
phpcs --standard=WordPress --report-diff=changes.diff view-quote.php | |
patch -p0 -ui changes.diff | |
//only escape |
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_rest_product_object_query', 'yith_pos_extend_post_per_pages', 5, 2 ); | |
function yith_pos_extend_post_per_pages( $args, $request ){ | |
if ( isset( $_GET[ 'queryName' ] ) && 'yith_pos_search' === $_GET[ 'queryName' ] ) { | |
$args[ 'posts_per_page' ] = 20; | |
} | |
return $args; |
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_rest_prepare_product_object', 'yith_pos_custom_product_response', 20, 3 ); | |
function yith_pos_custom_product_response( $response, $object, $request ) { | |
$param = $request->get_param( 'queryName' ); | |
if ( $param == 'yith_pos_search' ) { | |
$result = $response->data; | |
$result['name'] .= empty($result['sku']) ? '' : ' - ' . $result['sku']; | |
$response->data = $result; |
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( 'init', 'yith_pos_add_meta_to_products' ); | |
function yith_pos_add_meta_to_products() { | |
$option = get_option( 'yith_pos_stock_product_enabled', 'no' ); | |
if ( $option === 'no' ) { | |
$products = wc_get_products( array( 'limit' => - 1 ) ); | |
if ( $products ) { |
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 | |
if (defined('YITH_POS_VERSION')) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_add_new_stylesheet', 12 ); | |
function yith_pos_add_new_stylesheet(){ | |
global $yith_pos_styles; | |
wp_enqueue_style('yith-pos-override-frontend', get_stylesheet_directory_uri().'/pos.css', array('yith-pos-frontend'), YITH_POS_VERSION); | |
yith_pos_enqueue_style('yith-pos-override-frontend'); | |
} |
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 | |
if ( ! function_exists( 'yith_pos_customization_barcode_field' ) ) { | |
add_filter( 'yith_pos_barcode_custom_field', 'yith_pos_customization_barcode_field' ); | |
function yith_pos_customization_barcode_field() { | |
return "your_barcode_custom_field"; | |
} | |
} |
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 | |
if ( ! function_exists( 'yith_pos_customization_css' ) ) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_customization_css', 99 ); | |
function yith_pos_customization_css() { | |
$css = ".yith-pos-product-list__list .product, .yith-pos-product-category-list__list .product-cat{ | |
height: 150px; | |
}"; | |
wp_add_inline_style( 'yith-pos-frontend', $css ); |
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 if ( ! function_exists( 'yith_pos_customization_order_status_to_complete' ) ) { | |
add_filter( 'woocommerce_payment_complete_order_status', 'yith_pos_customization_order_status_to_complete', 10, 3 ); | |
function yith_pos_customization_order_status_to_complete( $status, $order_id, $order ) { | |
if ( absint( $order->get_meta( '_yith_pos_order' ) ) ) { | |
$status = 'completed'; | |
} | |
return $status; | |
} |
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 | |
remove_filter( 'woocommerce_'.YITH_WC_Dynamic_Pricing_Frontend()->get_product_filter.'get_price', array( YITH_WC_Dynamic_Pricing_Frontend(), 'get_price' ) ); | |
remove_filter( 'woocommerce_' . YITH_WC_Dynamic_Pricing_Frontend()->get_product_filter . 'variation_get_price', array( YITH_WC_Dynamic_Pricing_Frontend(), 'get_price' ) ); | |
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' ); | |
if ( $label_table != '' ): | |
?> | |
<p class="ywdpd-table-discounts-label"><strong><?php echo $label_table ?></strong> | |
<?php if ( $until != '' ) { | |
echo "<span>$until</span>"; |
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( 'ywdpd_round_total_price', 'ywdpd_round_price_for_single_product' ); | |
function ywdpd_round_price_for_single_product(){ | |
return false; | |
} | |