Skip to content

Instantly share code, notes, and snippets.

View PechenkiUA's full-sized avatar
💭
On vacation

Pechenki PechenkiUA

💭
On vacation
View GitHub Profile
@PechenkiUA
PechenkiUA / fix.html
Last active December 21, 2020 12:10
Position Fixed header to scroll
<script>
fixedHeader = () => {
this.fix = () => {
if (window.innerWidth < 768) {
window.onscroll = function () {
myFunction()
};
var header = document.querySelector(".header");
@PechenkiUA
PechenkiUA / List api and description .js
Created December 21, 2020 12:28
Parse edbo help home page
listMethod = document.querySelector('.help-page-table');
var str = [];
listMethod.querySelectorAll(' tr').forEach((index) => {
let row = [];
let td = index.querySelectorAll('td').forEach((index)=>{
var str = index.textContent.replace(/[\n\t' ']/g,'')
row.push({str})
});
str.push(row)
@PechenkiUA
PechenkiUA / Read_local_fle.js
Last active December 21, 2020 12:31
Read_local_fle
document.getElementById('read').addEventListener('click',file=>{
readFile(document.getElementById('file'))
})
function readFile(input) {
console.log(input)
let file = input.files[0];
let reader = new FileReader();
let readerText = new FileReader();
@PechenkiUA
PechenkiUA / test.php
Created December 28, 2020 14:44
Parse string new line to Array
<?php
$str = '/ru/rensoria62
/ru/rubi102
/ru/milton86
/ru/sorrento96
/ru/samanta164
/ru/citywood97
/ru/casablanca249
/ru/finwood236
/ru/moris163
@PechenkiUA
PechenkiUA / item.php
Last active December 29, 2020 09:09
Json Utf-8 php
<?php
json_encode($array, JSON_UNESCAPED_UNICODE)
@PechenkiUA
PechenkiUA / .htaccess
Created January 6, 2021 09:05
Редирект с нескольких сдешей в конце
RewriteCond %{THE_REQUEST} \s/+(.*?)/{2,}([^\s]*)
RewriteRule ^ %1/%2 [R=301,L,NE]
@PechenkiUA
PechenkiUA / Breadcrumb_last_remove_link.ocmod.xml
Created January 6, 2021 09:07
Breadcrumb last remove link
@PechenkiUA
PechenkiUA / seo_default.sql
Last active January 11, 2021 13:18
seo url sql
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'common/home', '');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'account/wishlist', 'wishlist');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'account/account', 'my-account');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'checkout/cart', 'shopping-cart');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'checkout/checkout', 'checkout');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'account/login', 'login');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'account/logout', 'logout');
INSERT INTO `oc_seo_url` (`store_id`, `language_id`, `query`, `keyword`) VALUES ('0', '1', 'account/order', 'order-history');
INSERT INTO `oc_seo_url` (`store_id`, `language_i
elseif ($key == 'route') {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
unset($data[$key]);
} else if ($data['route'] == "common/home") {
$url .= '/';
}
@PechenkiUA
PechenkiUA / functions.php
Last active February 25, 2021 12:50
add fiter shortcode telsender wc
<?php
/* Telsender add action*/
function meta_wc_function ($list, $order_id){
$order = wc_get_order( $order_id);
$items = $order->get_items();
$product_f = '';
foreach ( $items as $item) {