Skip to content

Instantly share code, notes, and snippets.

@Edwynn
Edwynn / functions.php
Created May 19, 2017 20:54 — forked from jameskoster/functions.php
WooCommerce - hide ratings on product loop
// Remove the product rating display on product loops
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
@Edwynn
Edwynn / style.css
Created November 29, 2018 19:18 — forked from grantambrose/style.css
Create a two column WooCommerce Checkout Page to streamline purchasing
/* Large devices (large desktops, 1200px and up) */
@media (min-width: 993px) {
/* ---------------------
WOOCOMMERCE
--------------------- */
body .woocommerce .col2-set .col-1{width:100%;}
.woocommerce-billing-fields h3{margin-top:40px;}
.woocommerce .col2-set, .woocommerce-page .col2-set{width:48%;float:left;}
#order_review_heading, .woocommerce #order_review, .woocommerce-page #order_review{float:left;width:48%;margin-left:2%;}
@Edwynn
Edwynn / woocommerce_custom_checkout_fields.php
Created January 31, 2019 04:00 — forked from viniciusrtf/woocommerce_custom_checkout_fields.php
WooCommerce: Adding custom fields to checkout, order/user meta and emails
<?php
/** ###################################################### *
* *
* Adding custom fields to checkout, order/user meta and emails *
* *
* ####################################################### */
/**
* Add the 'Profissão' field to the checkout
**/
@Edwynn
Edwynn / media-query.css
Created January 24, 2020 00:05 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@Edwynn
Edwynn / Create WooCommerce Blocks tables manually.sql
Created May 29, 2020 17:21 — forked from conschneider/Create WooCommerce Blocks tables manually.sql
Please note the wp_ prefix and change accordingly if needed! Also check the table names so you don't drop data of tables already there!
/*
* Please note the wp_ prefix and change accordingly if needed!
* Also check the table names so you don't drop data of tables already there!
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for wp_wc_reserved_stock
@Edwynn
Edwynn / woocommerce_update_shipping_costs.php
Created October 5, 2020 20:56 — forked from neamtua/woocommerce_update_shipping_costs.php
WooCommerce: Update shipping costs on checkout using ajax
<script type="text/javascript">
/* in order to update info on your checkout page you need to trigger update_checkout function
so add this in your javascript file for your theme or plugin
*/
jQuery('body').trigger('update_checkout');
/* what this does is update the order review table but what it doesn't do is update shipping costs;
the calculate_shipping function of your shipping class will not be called again;
so if you were like me and you made a shipping method plugin and you had to change costs based on payment method then
@Edwynn
Edwynn / functions.php
Created March 7, 2024 01:31 — forked from InpsydeNiklas/functions.php
display icon for ppcp-gateway in the checkout
function woocommerce_paypal_payments_gateway_icon( $icon, $id ) {
if ( $id === 'ppcp-gateway' ) {
return '<img src="https://www.paypalobjects.com/webstatic/mktg/Logo/pp-logo-100px.png" alt="PayPal Payments" />';
} else {
return $icon;
}
}
add_filter( 'woocommerce_gateway_icon', 'woocommerce_paypal_payments_gateway_icon', 10, 2 );