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
function woo_vou_pdf_template_replace_shortcodes( $voucher_template_html, $orderid, $item_key, $items, $voucodes, $productid ) { | |
$prefix = WOO_VOU_META_PREFIX; | |
$woo_order = wc_get_order( $orderid ); | |
// Check if order exists | |
if ( ! $woo_order ) { | |
return $voucher_template_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 // Do not add this if it's already added in your theme | |
// Remove storefront custom backgroud image which appears on pdf when previewing/downloading | |
function remove_featured_images_from_child_theme() { | |
if( isset( $_GET['post_type'] ) && $_GET['post_type'] == 'woovouchers' ) { | |
remove_theme_support( 'custom-background' ); | |
} | |
} | |
add_action( 'after_setup_theme', 'remove_featured_images_from_child_theme', 11 ); |
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
<Files admin-ajax.php> | |
Order allow,deny | |
Allow from all | |
Satisfy any | |
</Files> |
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 | |
/* | |
* Modify woocommerce tax rule for german | |
* Display the orginal tax without applying discount | |
*/ | |
function woo_vou_german_woocommerce_calc_tax( $tax_totals, $cart ) { | |
$count = 1; | |
foreach ( $cart->cart_contents as $key => $item) { | |
$tax_totals['TAX-'.$count]->amount = $item['line_subtotal_tax']; |
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
var example = 0; | |
var result = total / input; | |
function myFunc() { | |
// Output the string to the browser console | |
console.log('This is console string'); | |
if ( result ) { |
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
body { | |
background-image: url("example.jpg"); /* Inline commenting */ | |
background-repeat: repeat-y; | |
} | |
/* Css for registration form*/ | |
.registration-form { | |
display: block; | |
position: relative; | |
font-size: 12px; | |
padding: 10px 5px 10px 5px; |
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
<html> | |
<head> | |
<title>Page Title</title> | |
<meta charset="utf-8" /> | |
</head> | |
<body> | |
<table> | |
<tr> | |
<td colspan="2">Example 1</td> | |
<td colspan="2">Example 2</td> |
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 | |
if ( (condition1) || (condition2) ) { | |
// Your code | |
} elseif ( (condition3) && (condition4) ) { | |
// Your code | |
} else { | |
// Your code | |
} |
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
var j, k; | |
// Good example | |
for ( i = 0, k = getValues(); i < k; i++ ) { | |
// Your logic | |
} | |
// Bad example | |
for ( i = 0; i < getValues(); i++ ) { | |
// Your logic |
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
// Correct | |
var a, b, c = 'JavaScript'; | |
// InCorrect | |
var a = 'JavaScript'; | |
var b = 'JavaScript'; | |
var c = 'JavaScript'; |
NewerOlder