Skip to content

Instantly share code, notes, and snippets.

View klihelp's full-sized avatar
🎯
Focusing on life and money farm

klihelp

🎯
Focusing on life and money farm
View GitHub Profile
@woogist
woogist / table.php
Created January 21, 2015 15:40
Shows the order summary tot he customer
<h2><?php _e( 'Order Details', 'woocommerce' ); ?></h2>
<table class="shop_table order_details">
<thead>
<tr>
<th class="product-name"><?php _e( 'Product', 'woocommerce' ); ?></th>
<th class="product-total"><?php _e( 'Total', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php
@woogist
woogist / header.php
Created January 21, 2015 15:39
Shows important informations about the order
<p><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); ?></p>
<ul class="order_details">
<li class="order">
<?php _e( 'Order:', 'woocommerce' ); ?>
<strong><?php echo $order->get_order_number(); ?></strong>
</li>
<li class="date">
<?php _e( 'Date:', 'woocommerce' ); ?>
<strong><?php echo date_i18n( get_option( 'date_format' ), strtotime( $order->order_date ) ); ?></strong>
@woogist
woogist / failed.php
Created January 21, 2015 15:38
Shows a message to the customer when the purchase fails
<p><?php _e( 'Unfortunately your order cannot be processed as the originating bank/merchant has declined your transaction.', 'woocommerce' ); ?></p>
<p><?php
if ( is_user_logged_in() )
_e( 'Please attempt your purchase again or go to your account page.', 'woocommerce' );
else
_e( 'Please attempt your purchase again.', 'woocommerce' );
?></p>
<p>
@woogist
woogist / functions.php
Created January 20, 2015 13:51
Hides the product's weight and dimension in teh single product page.
/**
* Hides the product's weight and dimension in teh single product page.
*/
add_filter( 'wc_product_enable_dimensions_display', '__return_false' );
@woogist
woogist / functions.php
Created January 19, 2015 09:37
Removes the tab "Vendors" in the single product page.
/**
* Removes the tab "Vendors" in the single product page.
*/
function wc_remove_vendor_tab() {
global $wc_product_vendors;
remove_filter( 'woocommerce_product_tabs', array( $wc_product_vendors, 'product_vendor_tab' ) );
}
add_action( 'init', 'wc_remove_vendor_tab' );
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@woogist
woogist / functions.php
Created January 12, 2015 14:31
Add a notice in the registration form
add_action( 'woocommerce_register_form_start', 'wc_registration_notice_vendors' );
function wc_registration_notice_vendors() {
echo __( '<p><strong>Warning</strong>: Please register using the same email of your PayPal.com account.</p>', 'localization-domain' );
}
("abet"
"abroad"
"abstract"
"abuse"
"academic-freedom"
"academic-history"
"academic-life"
"accreditation"
"acknowledgement"
"acm"
@woogist
woogist / functions.php
Created December 24, 2014 14:01
Show the payemnt page URL in the admin page of the order.
/**
* Show the payemnt page URL in the admin page of the order.
*
* @param object $order
* @return void
*/
function wc_admin_show_payment_url( $order ) {
if ( $order->get_status() != 'pending' ) {
return;
}
@bappi-d-great
bappi-d-great / How to use custom post type archive as front page.php
Last active July 30, 2019 22:49
How to use custom post type archive as front page
<?php
/*
* 1. Go to Settings > Permalinks and select any page as home page
* Then use the following code
*
* You can add those codes in your functions.php in the theme, if you think your theme won’t be changed.
* Otherwise mu-plugins is the best solution. To use mu-plugins, go to /wp-content/ and find the folder with name 'mu-plugins'.
* If there is no folder in that name, then create a folder, name it 'mu-plugins', create a file inside that,
* give any name you like and paste the code in there. You don't need to activate that plugin. Mu-plugins means must use plugins,
* so it will be activated automatically always. If you use mu-plugins then add a php start tag at the beginning of the code.