This file contains hidden or 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
/* | |
** source : https://www.cloudways.com/blog/change-display-quantity-select-box-in-woocommerce/ | |
*/ | |
function woocommerce_quantity_input($data = null) { | |
global $product; | |
if (!$data) { | |
$defaults = array( | |
'input_name' => 'quantity', | |
'input_value' => '1', | |
'max_value' => apply_filters( 'woocommerce_quantity_input_max', '', $product ), |
This file contains hidden or 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
<!-- The following code uses object URLs, which is much more efficient than data URL for viewing large images (A data URL is a huge string containing all of the file data, whereas an object URL, is just a short string referencing the file data in-memory): | |
--> | |
<!-- java script only --> | |
<html> | |
<img id="blah" alt="your image" width="100" height="100" /> | |
<input type="file" onchange="document.getElementById('blah').src = window.URL.createObjectURL(this.files[0])"> | |
</html> | |
<!-- version jquery. --> |
This file contains hidden or 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> | |
<form id="form1" runat="server"> | |
<input type='file' id="imgInp" /> | |
<img id="blah" src="#" alt="your image" /> | |
</form> | |
</html> | |
<script> | |
function readURL(input) { |
This file contains hidden or 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
// the function | |
$.urlParam = function(name){ | |
var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href); | |
if (results==null){ | |
return null; | |
} | |
else{ | |
return results[1] || 0; | |
} | |
} |
This file contains hidden or 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
$deal_id = $_POST['deal_id']; | |
if ( get_post_meta($deal_id, 'redo_expired_votes', true) ){ | |
$ex_votes = get_post_meta($deal_id, 'redo_expired_votes', true); | |
$ex_vote = $ex_votes + 1; | |
update_post_meta($deal_id,'redo_expired_votes', $ex_vote); | |
}else{ | |
add_post_meta($deal_id, 'redo_expired_votes', '1', true); | |
} |