This file contains hidden or 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
/** | |
* Sorting out of stock WooCommerce products - Order product collections by stock status, in-stock products first. | |
*/ | |
class iWC_Orderby_Stock_Status | |
{ | |
public function __construct() | |
{ | |
// Check if WooCommerce is active | |
if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) { | |
add_filter('posts_clauses', array($this, 'order_by_stock_status'), 2000); |
This file contains hidden or 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
function get_price_html_custom( $new_price,$product ) { | |
if ( '' === $product->get_price() ) { | |
$price = apply_filters( 'woocommerce_empty_price_html', '', $product ); | |
} elseif ( $product->is_on_sale() && $product->is_type( 'variable' ) ) { | |
$price = wc_format_sale_price( wc_get_price_to_display( $product, array( 'price' => $product->get_variation_regular_price() ) ), wc_get_price_to_display( $product, array( 'price' => $new_price ) )) . $product->get_price_suffix(); | |
} | |
elseif ( $product->is_on_sale() ) { | |
$price = wc_format_sale_price( wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price() ) ), wc_get_price_to_display( $product, array( 'price' => $new_price ) )) . $product->get_price_suffix(); | |
} | |
else { |
This file contains hidden or 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
<img class="thumb" src="http://assets.imgix.net/dog.png?w=100" data-zoom="http://assets.imgix.net/dog.png?w=1200"> | |
<img class="thumb" src="http://assets.imgix.net/cat.png?w=100" data-zoom="http://assets.imgix.net/cat.png?w=1200"> | |
<img class="thumb" src="http://assets.imgix.net/frog.png?w=100" data-zoom="http://assets.imgix.net/frog.png?w=1200"> | |
<img class="thumb" src="http://assets.imgix.net/llama.png?w=100" data-zoom="http://assets.imgix.net/llama.png?w=1200"> | |
<p>Aenean lacinia bibendum nulla sed consectetur. Vestibulum id ligula porta felis euismod semper. Donec id elit non mi porta gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla.</p> | |
<div class="more-thumbs"> | |
<img class="more" src="http://assets.imgix.net/trees.png?w=100" data-zoom="http://assets.imgix.net/trees.png?w=1200"> | |
<img class="more" src="http://assets.imgix.net/mountains.png?w=100" data-zoom="http://assets.imgix.net/mountains.png?w=1200"> |
This file contains hidden or 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
function check($array, $value) | |
{ | |
foreach ($array as $key => $inner) { | |
if (is_array($inner)) { | |
if (check($inner, $value)) { | |
return $key; | |
} | |
} else { | |
if ($value == $inner) { | |
return $key; |
This file contains hidden or 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 | |
function wc_attrs_group($atts) { | |
global $product; | |
ob_start(); | |
$return = []; | |
$attributes = $product->get_attributes(); | |
if (!empty($attributes)) { | |
//ob_start(); | |
foreach ($attributes as $attr => $attr_deets) { |
This file contains hidden or 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
// cart and checkout inline styles | |
add_action( 'wp_head', 'custom_inline_styles', 900 ); | |
function custom_inline_styles(){ | |
if ( is_checkout() || is_cart() ){ | |
?><style> | |
.product-item-thumbnail { float:left; padding-right:10px;} | |
.product-item-thumbnail img { margin: 0 !important;} | |
dt.variation-Description { display: none;} | |
</style><?php | |
} |
This file contains hidden or 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
HTML: | |
<div class="wrapper"> | |
<div class="tabs"> | |
<span class="tab">Вкладка 1</span> | |
<span class="tab">Вкладка 2</span> | |
<span class="tab">Вкладка 3</span> | |
</div> | |
<div class="tab_content"> | |
<div class="tab_item">Содержимое 1</div> | |
<div class="tab_item">Содержимое 2</div> |
This file contains hidden or 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
function validate($data,$errors) { | |
// Do your data processing here and in case of an | |
// error add it to the errors array like: | |
$errors->add( 'validation', __( 'Not all fields have been filled in correctly.' )); | |
} | |
add_action('woocommerce_after_checkout_validation', 'validate',10,2); |
This file contains hidden or 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
$( '.search_button' ).on('click', function() { | |
if ($('#searchform').hasClass('header-block')) { | |
$('#searchform').removeClass('header-block'); | |
} else{ | |
$('#searchform').addClass('header-block'); | |
} | |
}); | |
$( 'html' ).on('click', function(e) { |
This file contains hidden or 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
{"aiowps_enable_debug":"","aiowps_remove_wp_generator_meta_info":"1","aiowps_prevent_hotlinking":"1","aiowps_enable_login_lockdown":"1","aiowps_allow_unlock_requests":"","aiowps_max_login_attempts":3,"aiowps_retry_time_period":5,"aiowps_lockout_time_length":60,"aiowps_set_generic_login_msg":"","aiowps_enable_email_notify":"","aiowps_email_address":"9698114@mail.ru","aiowps_enable_forced_logout":"","aiowps_logout_time_period":"60","aiowps_enable_invalid_username_lockdown":"","aiowps_instantly_lockout_specific_usernames":[],"aiowps_unlock_request_secret_key":"9boae3otjbi5x7b7q6kf","aiowps_enable_whitelisting":"","aiowps_allowed_ip_addresses":"","aiowps_enable_login_captcha":"","aiowps_enable_custom_login_captcha":"","aiowps_captcha_secret_key":"y9t13745ja38h0dirf5q","aiowps_enable_manual_registration_approval":"","aiowps_enable_registration_page_captcha":"","aiowps_enable_random_prefix":"","aiowps_enable_automated_backups":"1","aiowps_db_backup_frequency":2,"aiowps_db_backup_interval":"2","aiowps_backup_files_s |
NewerOlder