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 | |
add_filter( 'pvkw_get_shipping_methods', 'woocommerce_flatrate_percountry_pvkw_get_shipping_methods' ); | |
function woocommerce_flatrate_percountry_pvkw_get_shipping_methods( $shipping_methods ) { | |
$shipping_methods[] = 'woocommerce_flatrate_percountry'; | |
return $shipping_methods; | |
} |
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 | |
//Disable city field on the WooCommerce cart shipping calculator | |
add_filter( 'woocommerce_shipping_calculator_enable_city', '__return_false' ); | |
//Disable postcode field on the WooCommerce cart shipping calculator | |
add_filter( 'woocommerce_shipping_calculator_enable_postcode', '__return_false' ); |
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 | |
/* Shortcode actualizado por Ajax */ | |
//My shortcode that outputs the DIV and the necessary javascript (which should be external actually) | |
add_shortcode( 'my_shortcode' , 'my_shortcode_function' ); | |
function my_shortcode_function() { | |
ob_start(); | |
echo my_shortcode_function_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
WooCommerce stores tax subtotals rounded with the same number of decimals that are set for the store, which can cause problems when invoicing on external services | |
Example when using 2 decimals and tax 23%: | |
Total itens (without tax): 68.24 | |
Itens tax (rounded with 2 decimals): 15.6952 = 15.70 | |
Shipping (without tax): 4.73 | |
Shipping tax (rounded with 2 decimals): 1.0879 = 1.09 | |
Total taxes: 16.79 | |
Total: 72.97 + 16.79 = 89.76 |
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 | |
add_action( 'wse_screen_new_header', 'wse_screen_new_header_css', 11 ); | |
function wse_screen_new_header_css() { | |
?> | |
<style type="text/css"> | |
#stock-export-table .column-value-image img { | |
max-width: 200px; | |
max-height: 200px; | |
} |
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 | |
// Multibanco IfThen - Use specific Entity and Subentity for some specific order details (Example: depending on the delivery method, or the items bought, the payment must be made with different Ent/Subent) | |
add_filter( 'multibanco_ifthen_base_ent_subent', 'testing_multibanco_ifthen_base_ent_subent', 10, 2 ); | |
function testing_multibanco_ifthen_base_ent_subent( $base, $order ) { | |
//$base is a array with 'ent' and 'subent' keys / values | |
//Test whatever you want here related to the $order object | |
if ( true ) { |
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
# Do NOT use this rules unless you are absolutely sure you do not have any mixed contents issues, or you may be masquerading them | |
# Redirect from http to https without www | |
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] | |
RewriteRule ^(.*)$ https://domain.com/$1 [R=301,L] | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
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 | |
define('WP_USE_THEMES', false); | |
require('./wp-blog-header.php'); | |
$domain = 'woocommerce'; //Change textdomain as needed | |
$arr = array(); | |
$sql = sprintf( "SELECT id FROM ix_icl_strings WHERE context='%s'", $domain ); | |
$strings = $wpdb->get_results( $sql ); |
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 | |
// Multibanco IfThen - Thank you page payment instructions filter | |
add_filter( 'multibanco_ifthen_thankyou_instructions_table_html', 'my_multibanco_ifthen_thankyou_instructions_table_html', 1, 5 ); | |
function my_multibanco_ifthen_thankyou_instructions_table_html( $html, $ent, $ref, $order_total, $order_id ) { | |
ob_start(); | |
?> | |
<h2>Multibanco payment instructions for Order #<?php echo $order_id; ?></h2> | |
<p> | |
<b>Entity:</b> <?php echo $ent; ?> | |
<br/> |
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 | |
// Adicionar campo no plugin Multibanco | |
add_filter( 'multibanco_ifthen_multibanco_settings_fields', 'multibanco_add_quotes_option' ); | |
function multibanco_add_quotes_option( $settings ) { | |
$settings['ix_quotes_title'] = array( | |
'type' => 'title', | |
'title' => 'Invoicing with InvoiceXpress for WooCommerce - Pro', | |
); | |
$settings['ix_quotes'] = array( | |
'type' => 'checkbox', |