Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
On vacation

Pechenki AlexandrKrot

😎
On vacation
View GitHub Profile
@AlexandrKrot
AlexandrKrot / functions.php
Last active May 23, 2022
Telsender UTM Leads Tracker - XLPlugins Woocomerse
View functions.php
<?php
/*
* {utm_source}
* {utm_medium}
* {utm_campaign}
*/
add_filter('tscf_filter_codetemplate', function ($list, $order_id) {
View Ukraine-map.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlexandrKrot
AlexandrKrot / functions.php
Created May 2, 2022
telsender link product
View functions.php
<?php
/* Telsender link product */
function meta_wc_function_link($list, $order_id)
{
$order = wc_get_order($order_id);
$items = $order->get_items();
$curents = get_woocommerce_currency_symbol();
@AlexandrKrot
AlexandrKrot / autoDescription.php
Created Feb 15, 2022
Wordpress auto Description
View autoDescription.php
<?php
function autoDescription() {
global $post;
if (!is_singular()) {return; }
elseif(!empty( $post->post_excerpt)) {
echo "<meta name='description' content='$post->post_excerpt' />";
}
else{
$meta = apply_filters('the_content', $post->post_content);
@AlexandrKrot
AlexandrKrot / cart-shipping.php
Last active Jan 21, 2022
shiping method WC change to dropdown
View cart-shipping.php
<?php if ( 1 === count( $available_methods ) ) :
$method = current( $available_methods );
echo wp_kses_post( wc_cart_totals_shipping_method_label( $method ) );
?>
<input type="hidden" name="shipping_method[<?php echo esc_attr( $index ); ?>]"
data-index="<?php echo esc_attr( $index ); ?>"
id="shipping_method_<?php echo esc_attr( $index ); ?>"
value="<?php echo esc_attr( $method->id ); ?>" class="shipping_method"/>
@AlexandrKrot
AlexandrKrot / opencart.js
Last active Jan 18, 2022
summernote basic plugin code
View opencart.js
/**
*
* copyright [year] [your Business Name and/or Your Name].
* email: your@email.com
* license: Your chosen license, or link to a license file.
*
*/
(function (factory) {
/* Global define */
if (typeof define === 'function' && define.amd) {
@AlexandrKrot
AlexandrKrot / Telegram_send.php
Last active Dec 11, 2021
modx snipet telegram send formit
View Telegram_send.php
<?php
$token = "xxxxxxxxxxxxxxxxxxxx";
$chat_id = "0000000";
$values = $hook->getValues();
#Получаем название формы
$formName = $modx->getOption('formName', $formit->config, 'form-'.$modx->resource->get('id'));
#Получаем ip адрес отправителя
@AlexandrKrot
AlexandrKrot / functions.php
Last active Dec 2, 2021
Wooccomerce list attribute by product
View functions.php
<?php
function attributes(){
global $product;
$attributes = $product->get_attributes();
if ( ! $attributes ) {
return;
@AlexandrKrot
AlexandrKrot / functions.php
Created Nov 30, 2021
Telsender image products
View functions.php
<?php
/* Telsender image product */
function meta_wc_function_image($list, $order_id)
{
$order = wc_get_order($order_id);
$items = $order->get_items();
$curents = get_woocommerce_currency_symbol();
@AlexandrKrot
AlexandrKrot / 1.txt
Last active Jan 19, 2022
shortcode Telsender
View 1.txt
{products} - название продукта - количество - цена
{products_v2} - название продукта - количество - цена - артикул
{products_v3} - название продукта - количество - цена - артикул - опции
{order_n} - номер заказа
{total} - Общая сумма
{billing-first_name} - Имя
{billing-last_name} - Фамилия
{billing-address_1} - Адрес