Skip to content

Instantly share code, notes, and snippets.

<?php
/*
Plugin Name: WooCommerce New Fields
Plugin URI: https://georgejipa.com/
Description: Add new billing fields
Version: 1.0
Author: George Jipa
Author URI: http://georgejipa.com
*/
@rad73
rad73 / WC Snippets
Created November 6, 2018 14:15 — forked from mairagall/WC Snippets
WooCommerce Snippets
//Add a stylesheet after WC styles
add_action( 'wp_enqueue_scripts', 'maira_add_stylesheet' );
function maira_add_stylesheet() {
wp_register_style( 'woocommerce', get_stylesheet_directory_uri() . '/woocommerce/woocommerce.css' );
if ( class_exists( 'woocommerce' ) ) {
wp_enqueue_style( 'woocommerce' );
}
}
//Full Width Pages on WooCommerce - Genesis
@rad73
rad73 / gist:4fb18a0515e3239b6f6553a964c0c58b
Created November 6, 2018 14:13 — forked from basepack/gist:09fdbdd569020e2a0ff1
WooCommerce : add custom fields to product variations v2.0
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_save_product_variation', 'save_variable_fields', 10, 1 );
/**
@rad73
rad73 / woocommerce.php
Created November 6, 2018 14:13 — forked from melissajclark/woocommerce.php
woocommerce page with sections for product categories
<?php
/**
* The WooCommerce Template
*
* This is the template that displays all WooCommerce pages by default.
*
* @package THEMENAME
*/
get_header(); ?>
@rad73
rad73 / wc-product-slider-vertical-styling.css
Created November 6, 2018 14:12 — forked from zeshanshani/wc-product-slider-vertical-styling.css
WooCommerce Product Slider Vertical Styling. The CSS code will make your slider vertical aligned. This code will enable product gallery slider: https://gist.github.com/zeshanshani/5e634af86e49ce07c87b44728c62f64b
/* ==================================== */
/* WooCommerce Product Image Slider */
/* This code will enable product gallery slider: */
/* gist.github.com/zeshanshani/5e634af86e49ce07c87b44728c62f64b */
/* ==================================== */
.woocommerce .woocommerce-product-gallery.woocommerce-product-gallery--with-images {
padding-left: 115px;
box-sizing: border-box;
position: relative;
@rad73
rad73 / Create-Custom-Fields-in-Woocommerce-Checkout-Page.md
Created November 6, 2018 14:11 — forked from nadeem-khan/Create-Custom-Fields-in-Woocommerce-Checkout-Page.md
Create Custom Fields in Woocommerce Checkout Page and Display them in Orders Details Page in Admin Area

Create Custom Fields in Woocommerce Checkout Page and Display them in Orders Details Page in Admin Area with this WordPress plugin:

<?php


/**
 * Plugin Name: Flowershop - WooCommerceCustomOverrides
 * Plugin URI: http://chillopedia.com
 * Description: Overrides WooCommerce Checkout Form Fields
  • Version: 1.0
@rad73
rad73 / importer.php
Created November 6, 2018 14:10 — forked from dancr13/importer.php
Importer to Woocomerce
<?php
require __DIR__ . '/vendor/autoload.php';
use Automattic\WooCommerce\Client;
use Automattic\WooCommerce\HttpClient\HttpClientException;
function getWoocommerceConfig()
{
@rad73
rad73 / wc-css-make-storefront-product-tabs-horizontal
Created November 6, 2018 14:08 — forked from vanbo/wc-css-make-storefront-product-tabs-horizontal
WooCommerce: CSS to make Storefront product tabs horizontal again
.product .woocommerce-tabs ul.tabs {
width: 100%;
float: none;
margin-right: 5.8823529412%;
}
.woocommerce div.product .woocommerce-tabs ul.tabs {
list-style: none;
padding: 0 0 0 1em;
margin: 0 0 1.618em;
@rad73
rad73 / woocommerce.css
Created November 6, 2018 13:58 — forked from catchthemes/woocommerce.css
Make the WooCommerce Cart Table Responsive for Mobile Devices
/* START Make the WooCommerce Cart Table Responsive for Mobile */
/* CSS published in http://www.jeremycarter.com.au/optimising-woocommerce-checkout-for-mobile/ */
@media screen and (max-width: 600px) {
/* Force table to not be like tables anymore */
.woocommerce-page table.shop_table,
.woocommerce-page table.shop_table thead,
.woocommerce-page table.shop_table tbody,
.woocommerce-page table.shop_table th,
@rad73
rad73 / functions.php
Created November 6, 2018 13:58 — forked from ChromeOrange/functions.php
Managing WooCommerce Product Tabs
<?php
/**
* Standard Tab Code from woocommerce-hooks.php
*/
/* Product page tabs */
add_action( 'woocommerce_product_tabs', 'woocommerce_product_description_tab', 10 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_attributes_tab', 20 );
add_action( 'woocommerce_product_tabs', 'woocommerce_product_reviews_tab', 30 );
add_action( 'woocommerce_product_tab_panels', 'woocommerce_product_description_panel', 10 );