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 / request.php
Created February 7, 2021 23:04 — forked from demoriz/request.php
Request API (D7) #Bitrix
<?php
//use Bitrix\Main\Context;
use Bitrix\Main\Application;
//$context = Context::getCurrent();
//$request = $context->getRequest();
$context = Application::getInstance()->getContext();
$request = Application::getInstance()->getContext()->getRequest();
$bla = $request->get('bla');
@sukhikh18
sukhikh18 / mysql-docker.sh
Created July 17, 2020 06:12 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@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')
@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 / 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 / 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.
$dbBasketItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
'FUSER_ID' => CSaleBasket::GetBasketUserID(),
'LID' => SITE_ID,
'ORDER_ID' => 'NULL'
),
false,
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"];
@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 ));
?>
/**
* 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'])) {