Skip to content

Instantly share code, notes, and snippets.

View MarkPraschan's full-sized avatar

Mark Praschan MarkPraschan

View GitHub Profile
@perezfigueroa
perezfigueroa / wc-attribute-links.php
Created August 15, 2012 12:01 — forked from coenjacobs/wc-attribute-links.php
Display WooCommerce product attribute archive links on product page, right below the add to cart button.
@kloon
kloon / functions.php
Last active March 4, 2024 19:36
WooCommerce total order weight column on orders page
<?php
add_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' );
function woo_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 );
function woo_custom_order_weight_column( $column ) {
global $post, $woocommerce, $the_order;
@BFTrick
BFTrick / update-tax-status.sql
Created July 25, 2013 16:25
Update the tax status of all WooCommerce products.
UPDATE `wp_postmeta`
SET meta_value='taxable'
WHERE meta_key='_tax_status'
@RiaanKnoetze
RiaanKnoetze / function.php
Created November 4, 2016 05:31
Remove the WooCommerce Dashboard Status widget in WP Admin for all users that don't have "subscriber" role capabilities.
if (current_user_can('subscriber')) {
function remove_dashboard_widgets() {
// remove WooCommerce Dashboard Status
remove_meta_box( 'woocommerce_dashboard_status', 'dashboard', 'normal');
}
add_action('wp_user_dashboard_setup', 'remove_dashboard_widgets', 20);
add_action('wp_dashboard_setup', 'remove_dashboard_widgets', 20);
} // if
@tankbar
tankbar / functions.php
Created December 14, 2017 10:50
WooCommerce - Add GTIN/EAN meta field for product and product variations
/**
* Adding Custom GTIN Meta Field
* Save meta data to DB
*/
// add GTIN input field
add_action('woocommerce_product_options_inventory_product_data','woocom_simple_product_gtin_field', 10, 1 );
function woocom_simple_product_gtin_field(){
global $woocommerce, $post;
$product = new WC_Product(get_the_ID());
echo '<div id="gtin_attr" class="options_group">';
@mailenkno
mailenkno / gutenberg-sample-content.html
Last active November 5, 2024 07:48
WordPress Gutenberg Sample Content
<!-- wp:paragraph {"align":"center","customTextColor":"#000000","backgroundColor":"very-light-gray","fontSize":"small"} -->
<p style="color:#000000;text-align:center" class="has-background has-small-font-size has-very-light-gray-background-color">Gutenberg Sample Content.<br/>Put together with ❤️ by <a href="https://artisanthemes.io/">Artisan Themes</a>.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":1} -->
<h1>This is a heading (H1)</h1>
<!-- /wp:heading -->
<!-- wp:heading -->
<h2>This is a heading (H2)</h2>