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_filter( 'manage_edit-product_columns', 'admin_add_in_promo', 10, 2 ); | |
function admin_add_in_promo($columns){ | |
//remove column | |
//unset( $columns['tags'] ); | |
//add column | |
$columns['in_promo'] = __( 'Promo'); | |
return $columns; | |
} | |
add_action( 'manage_posts_custom_column', 'admin_show_in_promo', 10 ); | |
function admin_show_in_promo( $column) { |
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
/** | |
* is_type can be simple, variable, grouped, external | |
* woocommerce_single_product_summary is hook! | |
* Put this into your functions.php (child-theme) | |
**/ | |
add_action( 'woocommerce_single_product_summary', 'get_product_type', 5 ); | |
function get_product_type() { | |
global $post; | |
if( function_exists('get_product') ){ | |
$product = get_product( $post->ID ); |
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 functions.php into child theme | |
this script works for | |
http://www.iograficathemes.com/documentation/woocommerce-iva-field-premium/ | |
See: https://docs.woothemes.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ | |
**/ | |
remove_action( 'woocommerce_billing_fields', 'wciva_custom_billing_fields'); | |
add_action( 'woocommerce_billing_fields', 'override_cf'); | |
function override_cf( $fields ) { |
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 | |
/** Use this file to flush your cache via cron job | |
is useful to invalidate varnish cache | |
Magento 1.8.1 | |
**/ | |
require_once('app/Mage.php'); | |
Mage::app()->getCacheInstance()->flush(); | |
?> |
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 | |
require_once 'app/Mage.php'; | |
umask(0); | |
Mage::app(); | |
$order_id = '200000832'; | |
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id); | |
$order->setData('state', "complete"); | |
$order->setStatus("complete"); | |
$history = $order->addStatusHistoryComment('Order status changed via script.', false); |
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 | |
require_once 'app/Mage.php'; | |
umask(0); | |
Mage::app(); | |
$orders = array('200000674','200000676','200000678'); | |
foreach ($orders as $k => $v) { | |
$order_id = $v; | |
$order = Mage::getModel('sales/order')->loadByIncrementId($order_id); |
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
C{ | |
#include <errno.h> | |
#include <netinet/in.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef void vas_f(const char *, const char *, int, const char *, int, int); | |
extern vas_f *VAS_Fail; |
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
# Configuration file for varnish | |
# | |
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK | |
# to be set from this shell script fragment. | |
# | |
# Note: If systemd is installed, this file is obsolete and ignored. You will | |
# need to copy /lib/systemd/system/varnish.service to /etc/systemd/system/ and | |
# edit that file. | |
# Should we start varnishd at boot? Set to "no" to disable. |
NewerOlder