Skip to content

Instantly share code, notes, and snippets.

View sukhikh18's full-sized avatar
💪
Business, Development, Sales, Marketing

Nick Sergeevich sukhikh18

💪
Business, Development, Sales, Marketing
View GitHub Profile
@sukhikh18
sukhikh18 / add-wc-order-status.php
Created July 4, 2017 06:03 — forked from bekarice/add-wc-order-status.php
Add WooCommerce 2.2 Order Status
/**
* Register new status
* Tutorial: http://www.sellwithwp.com/woocommerce-custom-order-status-2/
**/
function register_awaiting_shipment_order_status() {
register_post_status( 'wc-awaiting-shipment', array(
'label' => 'Awaiting shipment',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
<?php
/**
* Add the field to the checkout
**/
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
/**
* INSTALLATION: this code should be pasted into your theme's functions.php file.
*
* To Use: Install 'Easy Fancybox'. Leave the URL blank on an image slide in Meta Slider.
* The slide will automatically be linked to it's full image in a lightbox
*
* @tested on WP - 4.4.11; Meta Slider - 3.5.1
*/
function metaslider_easy_fancybox($attributes, $slide, $slider_id) {
if (!strlen($attributes['href'])) {
@sukhikh18
sukhikh18 / custom-nav-walker-usage.php
Created December 29, 2017 11:10 — forked from kosinix/custom-nav-walker-usage.php
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>
@sukhikh18
sukhikh18 / location_bitrix.php
Last active July 31, 2018 09:25 — forked from VSeryoga/location_bitrix.php
Местоположения Битрикс
<?
$res = \Bitrix\Sale\Location\LocationTable::getList(array(
'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID, 'TYPE_CODE' => array("VILLAGE", "CITY"), 'NAME_RU' => array($_POST["city"], $_POST["city"]." %")),
'select' => array('*', 'NAME_RU' => 'NAME.NAME', 'TYPE_CODE' => 'TYPE.CODE'),
'limit' => 10
));
while($item = $res->fetch())
{
$loc[$item["ID"]] = $item;
$ids[] = $item["PARENT_ID"];
$dbBasketItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
'FUSER_ID' => CSaleBasket::GetBasketUserID(),
'LID' => SITE_ID,
'ORDER_ID' => 'NULL'
),
false,
false,
@sukhikh18
sukhikh18 / add-to-cart.php
Last active June 28, 2019 12:54 — forked from lukecav/add-to-cart.php
Display Product Variations in the Shop Loop - With Conditional Apply Filter Logic
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
* @since Woocommerce 3.0.0
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
@sukhikh18
sukhikh18 / bitrixOneClickOrder.php
Created November 29, 2019 11:31
Заказ в один клик (не оптимизированно) #Bitrix #Raw
<?php
require_once($_SERVER['DOCUMENT_ROOT']. "/bitrix/modules/main/include/prolog_before.php");
// добавление заказа в один клик, только по имени и телефону
CModule::IncludeModule("sale");
CModule::IncludeModule("catalog");
if(!empty($_REQUEST['name']) && !empty($_REQUEST['phone']))
{
$name = $_REQUEST['name'];
@sukhikh18
sukhikh18 / monolog.php
Created February 13, 2020 08:34 — forked from mamchenkov/monolog.php
Example use of Monolog logger
<?php
// Before: composer require monolog/monolog
// composer autoloader
require_once 'vendor/autoload.php';
// Shortcuts for simpler usage
use \Monolog\Logger;
use \Monolog\Formatter\LineFormatter;
use \Monolog\Handler\StreamHandler;
@sukhikh18
sukhikh18 / slide_count.js
Last active April 1, 2020 21:05 — forked from iiiBird/slide_count.js
slick slide count and all slides
var $slider = $('.slider'),
$current = $('<span class="current">'),
$summary = $('<span class="summary">');
$slider
.on('init', function(event, slick) {
$current.html(1);
$summary.html(slick.slideCount);
$('.slick-dots')