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
global $product; | |
global $woocommerce; | |
$idd = get_the_ID(); | |
//Displaying a WooCommerce product price: | |
$sale_price = $product->get_sale_price(); | |
$regular_price = $product->get_regular_price(); | |
// Displaying a WooCommerce price Currency: |
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
/* HTTP */ | |
UPDATE wp_options SET option_value = replace(option_value, 'http://OLDDOMAIN.com', 'http://NEWDOMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://OLDDOMAIN.com','http://NEWDOMAIN.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://OLDDOMAIN.com', 'http://NEWDOMAIN.com'); | |
/* HTTP + WWW */ | |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.OLDDOMAIN.com', 'http://NEWDOMAIN.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.OLDDOMAIN.com','http://NEWDOMAIN.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.OLDDOMAIN.com', 'http://NEWDOMAIN.com'); |
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 Vendors Bookings Management | |
* Description: Allows vendors to manage their bookings in the frontend | |
* Version: 1.0.0 | |
* Author: Liam Bailey | |
* Author URI: http://webbyscots.com/ | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ |
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 | |
require dirname(__FILE__).'/wp-blog-header.php'; | |
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)"); | |
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')"); |
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 | |
/* | |
* Functionality to set up custom shortcode correctly. | |
* | |
* This function is attached to the 'the_content' filter hook. | |
*/ | |
add_filter( 'the_content', 'run_bbcodes', 7 ); | |
function run_bbcodes( $content ) { |
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 | |
/** | |
* start the customisation | |
*/ | |
function custom_woo_before_shop_link() { | |
add_filter('woocommerce_loop_add_to_cart_link', 'custom_woo_loop_add_to_cart_link', 10, 2); | |
add_action('woocommerce_after_shop_loop', 'custom_woo_after_shop_loop'); | |
} | |
add_action('woocommerce_before_shop_loop', 'custom_woo_before_shop_link'); |
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 | |
/** | |
* Loop Add to Cart -- with quantity and AJAX | |
* requires associated JavaScript file qty-add-to-cart.js | |
* | |
* @link http://snippets.webaware.com.au/snippets/woocommerce-add-to-cart-with-quantity-and-ajax/ | |
* @link https://gist.github.com/mikejolley/2793710/ | |
*/ | |
// add this file to folder "woocommerce/loop" inside theme |