Skip to content

Instantly share code, notes, and snippets.

MarkoSh

Block or report user

Report or block MarkoSh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MarkoSh
MarkoSh / functions.php
Last active Feb 11, 2018
Woocommerce count items in cookie
View functions.php
add_action( 'wp', 'woocommerce_set_custom_cookie', 100 );
add_action( 'woocommerce_add_to_cart_handler', 'woocommerce_set_custom_cookie' );
function woocommerce_set_custom_cookie() {
setcookie( 'woocommerce_cart_contents_count', WC()->cart->cart_contents_count, 0, '/' );
}
@MarkoSh
MarkoSh / functions.php
Created Feb 11, 2018
Woocommerce all js params
View functions.php
add_action( 'wp_head', 'woo_js_params', 99 );
function woo_js_params() {
?>
<script>
<?php
$vars = array(
'woocommerce' => array(
'ajax_url' => WC()->ajax_url() ,
'wc_ajax_url' => WC_AJAX::get_endpoint("%%endpoint%%") ,
) ,
@MarkoSh
MarkoSh / functions.php
Last active Feb 11, 2018
WooCommerce total disable
View functions.php
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
add_action( 'wp_head', 'disable_woo', 99 );
function disable_woo() {
global $wp_scripts, $wp_styles;
$scripts = array(
'accounting',
'wc-jquery-ui-touchpunch',
'wc-price-slider',
'flexslider',
View shellShock_.idea_encodings.xml
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
</project>
You can’t perform that action at this time.