This file contains 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
/** | |
* 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, |
This file contains 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 | |
/** | |
* 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>'; |
This file contains 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
/** | |
* 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'])) { |
This file contains 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
<? | |
$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"]; |
This file contains 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
$dbBasketItems = CSaleBasket::GetList( | |
array("ID" => "ASC"), | |
array( | |
'FUSER_ID' => CSaleBasket::GetBasketUserID(), | |
'LID' => SITE_ID, | |
'ORDER_ID' => 'NULL' | |
), | |
false, | |
false, |
This file contains 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 | |
/** | |
* Custom Loop Add to Cart. | |
* | |
* Template with quantity and ajax. | |
* @since Woocommerce 3.0.0 | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly. |
This file contains 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 | |
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']; |
This file contains 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 | |
// 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; |
This file contains 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
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') |
OlderNewer