Skip to content

Instantly share code, notes, and snippets.

View brstcrt's full-sized avatar

Dmitry brstcrt

  • Limassol, Cyprus
View GitHub Profile
@brstcrt
brstcrt / OnOrderNewSendEmail.php
Created January 15, 2022 15:41 — forked from nafilimonov/OnOrderNewSendEmail.php
Bitrix. Sale. Письмо после заказа.
<?
AddEventHandler("sale", "OnOrderNewSendEmail", "OnOrderNewSendEmailNewFields");
function OnOrderNewSendEmailNewFields($orderID, &$eventName, &$arFields){
$arOrder = CSaleOrder::GetByID($orderID);
$country = "";
$city = "";
$address = "";
$order_props = CSaleOrderPropsValue::GetOrderProps($orderID);
while ($arProps = $order_props->Fetch()){
@VasiliuKr
VasiliuKr / bitrix_smart_filter_ajax.js
Last active October 26, 2022 07:17
catalog.smart.filter - ajax обновление списка без AXAJ_MODE
// В шаблоне bitrix:catalog.smart.filter редактируем script.js - ищим функцию JCSmartFilter.prototype.postHandler и редактируем следующее
//if (modef.style.display === 'none')
//{
// modef.style.display = 'inline-block';
//}
$.get(
result.FILTER_AJAX_URL,
function (data) {
@gokulkrishh
gokulkrishh / media-query.css
Last active November 18, 2025 15:54
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@dompascal
dompascal / css-structure-with-media-queries.css
Created November 23, 2013 10:56
CSS - Structure with Media Queries
/* fonts */
/* ------------------------------------------------------------------------- */
/* reset */
/* ------------------------------------------------------------------------- */
@import url('css/reset.css');
@import url('css/normalize.min.css');
@gerbenvandijk
gerbenvandijk / Mark parent navigation active when on custom post type single page
Last active November 3, 2025 20:30
Mark (highlight) custom post type parent as active item in Wordpress Navigation.When you visit a custom post type's single page, the parent menu item (the post type archive) isn't marked as active. This code solves it by comparing the slug of the current post type with the navigation items, and adds a class accordingly.
<?php
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Get post ID, if nothing found set to NULL
$id = ( isset( $post->ID ) ? get_the_ID() : NULL );
@juliuzfan
juliuzfan / loop-sticky-posts.php
Created November 28, 2011 00:56
Custom WP Query For Sticky Posts Only
<?php
/**
Custom Query for Sticky Posts only
----------------------------------
*/
$sticky = get_option( 'sticky_posts' );
$args = array(
'posts_per_page' => 2, // Number of sticky posts to get
'post__in' => $sticky,
'ignore_sticky_posts' => 1
@davecap
davecap / collections.liquid.html
Last active October 15, 2025 13:07
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<!-- the top of your collections.liquid -->
<!-- START PRODUCTS -->
{% for product in collection.products %}
<!-- START PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->
<div class="product" id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</div>
<!-- END PRODUCT {{ forloop.index | plus:paginate.current_offset }} -->