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
<!-- | |
iOS Web App Basic Html Code. | |
Url:http://devework.com/ios-7-web-app.html | |
Thanks: https://gist.github.com/tfausak/2222823 | |
--> | |
<!--meta tag--> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
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 | |
//woocommerce featured products | |
//来自官方主题 wootique. | |
//CSS 样式请自己定义 | |
//或者采用以下短代码函数 | |
// <?php echo do_shortcode( '[featured_products per_page="12" columns="4"]' ); ?> | |
<div id="featured-products" class="<?php if ( get_option( 'woo_featured_product_style' ) == 'slider' ) { echo 'fp-slider'; } ?>"> | |
<h2><?php _e( 'Featured Products', 'woothemes' ); ?></h2> |
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 | |
// DeveWork.com | |
//这是一个可以修改woocommerce_get_price_html 函数默认输出的html代码的例子, | |
//作用是调换新旧价格的位置 | |
//感谢http://wordpress.stackexchange.com/questions/83367/how-to-edit-the-get-price-html-on-woocommerce | |
add_filter( 'woocommerce_get_price_html', 'dw_change_default_price_html', 100, 2 ); | |
function dw_change_default_price_html( $price,$product ){ | |
if ( $product->price > 0 ) { |
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 | |
//woocommerce中文网关支持paypal | |
// details at http://devework.com/support-paypal-gateway-in-woocommerce.html | |
//本函数解决的问题:贝宝不支持你的商铺货币。Gateway Disabled: PayPal does not support your store's currency. | |
add_filter( 'woocommerce_paypal_supported_currencies', 'enable_custom_currency' ); | |
function enable_custom_currency($currency_array) { | |
$currency_array[] = 'CNY'; | |
return $currency_array; | |
} |
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 | |
//以下用部分代码演示hook ‘woocommerce_checkout_fields’ 这个函数 | |
//参考文章:http://devework.com/woocommerce-custom-override-checkout-fields.html | |
//删除结算页面上多余的表单元素(fields) | |
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); | |
function custom_override_checkout_fields( $fields ) { | |
//unset($fields['order']['order_comments']); | |
unset( $fields['billing']['billing_country'] ); |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Untitled Document</title> | |
<style type="text/css"> | |
<!-- | |
.btn{ | |
font-family: Verdana, Arial, Helvetica, sans-serif; | |
font-size: 12px; |
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 | |
/** | |
* Plugin Name: WooCommerce Subscriptions Product Removed Message | |
* Description: Display a notice on checkout when a product was removed from the cart after a subscription was added. | |
* Author: Gerhard Potgieter & Brent Shepherd | |
* Author URI: | |
* Version: 1.1 | |
* License: GPL v2 | |
*/ | |
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 | |
//测试是否为5.3,5.4、支持zend 组件否、支持一些php 函数否 | |
//原始来源 http://www.smyx.net/ | |
$funs_list = array('close_curl', 'close_fopen', 'close_http', 'file_get_contents', 'zend_loader_enabled'); | |
if (!function_exists('close_curl')) { | |
function close_curl() { | |
if (!extension_loaded('curl')) { | |
return " <span style=\"color:blue\">请在php.ini中打开扩展extension=php_curl.dll</span>"; |
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 | |
//验证是否为5.2、5.3、5.4 、支持zend 组件否、支持一些php 函数否 | |
//原始来源 http://www.smyx.net/ | |
$funs_list = array('close_curl', 'close_fopen', 'close_http', 'file_get_contents', 'zend_loader_enabled'); | |
if (!function_exists('close_curl')) { | |
function close_curl() { | |
if (!extension_loaded('curl')) { | |
return " <span style=\"color:blue\">请在php.ini中打开扩展extension=php_curl.dll</span>"; |
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 | |
// Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts. | |
add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); | |
function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { | |
global $woocommerce; | |
extract( $_POST ); | |
if ( strcmp( $password, $password2 ) !== 0 ) { | |
return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) ); | |
} |
OlderNewer