Honestly, it was 7 months ago and i’m not sure if i remember exactly all i have done.
All i can do is to look into my code; maybe it could help you.
First at all – i’m not sure which version of WooCommerce you’re working on. Mine is older, 2.2.0 if i remember.
Anyway – i haven’t change anything on price.php:
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $product;
<?php if ( $price_html = $product->get_price_html() ) : ?>
<span class="price"><?php echo $price_html; ?></span>
<?php endif; ?>
And i’m not sure why you use this:
$newminimum = ($newminimum - 0.01)
– and why you define $newminimum anyway?
Maybe that’s your problem? Do you use it somewhere else?
Here’s content of my shatner.js:
jQuery(function($){
$('.cart').click(function(){
// Test to see if the price exceeds the minimum price (ie the Suggested Price):
var minimum = $('#minimum_price').val();
var myprice = $('input.name_price').val();
myprice = myprice.replace(",", ".");
if(parseFloat(minimum) > parseFloat(myprice))
{
alert('Please offer a price higher than the Minimum Price.');
return false;
}
// See if the price input is zero (because we want people to be able to choose a free option: NEEDS LOGIC FOR SET MINIMUM
else if(parseFloat($('input.name_price').val()) == 0)
{
return;
}
// Test to see if the input field has been left blank:
else if($('.name_price').length && !parseFloat($('input.name_price').val()))
{
alert('Please enter a price in the Price field!');
return false;
}
// Test to see if input field is non-negative:
else if(parseFloat($('input.name_price').val()) < 0)
{
alert("Look here, old chap, that's just not on. Please enter a positive number, or zero. Tsk tsk.");
return false;
}
});
$('.cart').submit(function(){
$('<input name="price" />').val($('input.name_price').val()).attr('type','hidden').appendTo($('form.cart'));
return;
});
});
Good luck ??