This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> | |
<meta name="description" content="A description of your website"> | |
<meta name="keywords" content=""> | |
<title>Put the title here</title> |
This file contains hidden or 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
# add at bottom file | |
# /etc/php5/fpm/pool.d/www.conf | |
php_value[upload_max_filesize] = 8M | |
php_value[post_max_size]=10M | |
# after reboot the service | |
sudo service php5-fpm restart |
This file contains hidden or 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
# comments.php | |
# update comments.php in child theme | |
<div class="comment-list"> | |
<?php | |
// ref: https://codex.wordpress.org/Function_Reference/wp_list_comments#Arguments | |
$args = [ | |
'walker' => null, |
This file contains hidden or 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
# update config.php: | |
define('DOMAIN_CURRENT_SITE', 'www.newsiteurl.tld'); | |
# update wordpress/wp-content/uploads/nginx-helper/map.conf | |
# this step works only for NginX webserver | |
# update wp_options table | |
UPDATE `db_name`.`wp_options` SET `option_value`='http://www.newsiteurl.tld' WHERE `option_name`='home'; | |
UPDATE `db_name`.`wp_options` SET `option_value`='http://www.newsiteurl.tld' WHERE `option_name`='siteurl'; |
This file contains hidden or 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
# https://www.digitalocean.com/community/tutorials/how-to-enable-sftp-without-shell-access-on-ubuntu-16-04 | |
# https://askubuntu.com/questions/79565/how-to-add-existing-user-to-an-existing-group | |
# mount --bind /path/target /var/sftp/uploads | |
sshd_config add at the bottom of file | |
Match User USERNAME | |
ForceCommand internal-sftp | |
PasswordAuthentication yes | |
ChrootDirectory /var/sftp | |
PermitTunnel no |
This file contains hidden or 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
function remove_product_from_cart() { | |
if( is_cart() || is_checkout() ) { | |
global $woocommerce; | |
$items = $woocommerce->cart->get_cart(); | |
foreach($items as $item_key => $item){ | |
if($item['line_total'] == '0' && $item['line_subtotal'] == '0') { | |
$remove_items = $woocommerce->cart->remove_cart_item($item_key); | |
} | |
} |
This file contains hidden or 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
#!/bin/bash | |
# This file reindex all Magento indexes without any lock table | |
# This is the right order to reindexall via script | |
# I update every 3 sec any Magento product via API. | |
# Before this script I noticed this error | |
# SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction | |
echo "Reindexall via script" | |
php /mage/magento/shell/indexer.php --reindex cataloginventory_stock | |
php /mage/magento/shell/indexer.php --reindex catalog_product_attribute |
This file contains hidden or 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 | |
/** | |
* Schedule this via cron if yuo need to empty Lesti FPC cache for products and categories | |
**/ | |
require_once('app/Mage.php'); | |
umask(0); | |
Mage::app(); |
This file contains hidden or 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 | |
$proxy = new SoapClient("http://www.mydomain.com/api/v2_soap/?wsdl"); | |
$sessionId = $proxy->login("myuser", "mypass"); | |
$update_data = array ( | |
'additional_attributes' => array ( | |
'single_data' => array ( | |
array ('key' => 'foreign_visibility', 'value' => '1') | |
) |
This file contains hidden or 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
/** | |
* Add / Remove product to 'Angolo delle offerte' on product save action | |
**/ | |
function update_product_category( $post_id ) { | |
global $post; | |
if(function_exists('get_product')) { | |
$product = get_product($post->ID); | |
if($product->is_type('variable')) { | |
$available_variations = $product->get_available_variations(); | |
$catarray = array(); |
NewerOlder