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
#Install pthreads on AWS-EC2 with php5.6 | |
#!/usr/bin/env bash | |
sudo yum update -y | |
sudo yum install httpd | |
cd | |
wget https://mirror.webtatic.com/yum/el6/latest.rpm | |
sudo yum install latest.rpm -y | |
sudo yum-config-manager --enable webtatic | |
sudo yum clean all | |
sudo yum install --enablerepo=webtatic php56w php56w-bcmath php56w-gd php56w-imap php56w-mbstring php56w-mcrypt php56w-mysqlnd php56w-pear php56w-xml php56w-soap php56w-devel -y |
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
function frenchChars($string) | |
{ | |
$normalizeChars = array( | |
'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', | |
'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', | |
'Ï'=>'I', 'Ñ'=>'N', 'Ń'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', | |
'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', | |
'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', | |
'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ń'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', |
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
add_filter( 'product_type_selector', 'remove_product_types' ); | |
function remove_product_types( $types ){ | |
unset( $types['grouped'] ); | |
unset( $types['external'] ); | |
unset( $types['variable'] ); | |
return $types; | |
} |
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
/***** | |
Here, I am assuming that you have already assigned all variants as tags of a product. Because Shopify filter does not work with variant options. | |
And, if you assigns all variants as tags you can not differentiate them from tags. | |
Here I code that is working for 2 filters Size & Length (with mulitple options. ie mulitple sizes, multiple lengths, etc | |
*****/ | |
<div class="filters-toolbar"> | |
<div class="filters-toolbar__item size-filter"> | |
{% assign variant_sizes = "" %} | |
{% assign variant_lengths = "" %} |
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 | |
class Yahoo_Weather | |
{ | |
protected $base_url = "http://query.yahooapis.com/v1/public/yql"; | |
protected $location = false; | |
protected $units = false; | |
protected $current = false; | |
protected $future = false; | |
protected $data = 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
git config --global core.editor "vim" | |
#Run above command in Terminal / git-bash to change git editor from default to "vim" editor |
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
SQL query for renaming the posts: | |
UPDATE `wp_posts` SET `post_type` = '<new post type name>' WHERE `post_type` = '<old post type name>'; | |
SQL query for renaming taxonomy: | |
UPDATE `wp_term_taxonomy` SET `taxonomy` = '<new taxonomy name>' WHERE `taxonomy` = '<old taxonomy name>'; | |
# That should take care of all of the database areas. Just remember to match the new names in the code where the post types or taxonomies are registered. As far as I know, this is not handled in any plugins yet. |
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 | |
// Provide the Host Information. | |
$vHost = 'gateway.sandbox.push.apple.com'; | |
//$vHost = 'gateway.push.apple.com'; | |
$vPort = 2195; | |
// Provide the Certificate and Key Data. | |
$vCert = 'Certificates.pem'; |
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
product_add_to_cart : function(){ | |
var ajx_data = {}; | |
var ajx_grab = {}; | |
$(document).on('change','.single-product .variations_form select',function(e){ | |
var $this = $(this); | |
var pro_id = $(".single-product .variations_form").attr('data-product_id'); | |
var attribute_name = $this.attr('data-attribute_name'); | |
var attribute_value = $this.val(); | |
var post_ajxurl = window.location+"?wc-ajax=get_variation"; |
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
function wc_show_variable_product_stock_out() | |
{ | |
global $product; | |
if( $product->is_type( 'variable' ) ) | |
{ | |
$args = array( | |
'post_type' => 'product_variation', | |
'post_status' => array( 'private', 'publish' ), | |
'numberposts' => -1, | |
'orderby' => 'menu_order', |
OlderNewer