|
Server IP : 10.106.20.8 / Your IP : 216.73.216.148 Web Server : Apache System : Linux webm008.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : sixiemesrc ( 611999) PHP Version : 8.0.30 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/sixiemesrc/new/wp-content/themes/gaaga/../gaaga/ocdi/../modules/woocommerce/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* Locate file
*/
if ( ! function_exists( 'gaaga_woo_locate_file' ) ) {
function gaaga_woo_locate_file( $module ) {
$plugin_file_path = apply_filters( 'gaaga_woo_locate_file', '', $module);
if( $plugin_file_path ) {
$file_path = $plugin_file_path;
} else {
$file_path = GAAGA_MODULE_DIR . '/woocommerce/' . $module .'.php';
}
$located_file_path = false;
if ( $file_path && file_exists( $file_path ) ) {
$located_file_path = $file_path;
}
return $located_file_path;
}
}
/**
* Check file is in theme
*/
if ( ! function_exists( 'gaaga_is_file_in_theme' ) ) {
function gaaga_is_file_in_theme( $file_path = __FILE__ ) {
$root = get_theme_root();
$root = str_replace( '\\', '/', $root );
$file_path = str_replace( '\\', '/', $file_path );
$bool = stripos( $file_path, $root );
if ( false === $bool ) {
return false;
}
return true;
}
}
/**
* Check item is in cart
*/
if(!function_exists('gaaga_check_item_is_in_cart')) {
function gaaga_check_item_is_in_cart( $product_id ){
if ( $product_id > 0 ) {
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) {
$cart_product = $values['data'];
if( $product_id == $cart_product->get_id() ) {
return true;
}
}
}
return false;
}
}