Login
Register

VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Name The Price for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!

×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

problem with decimals 19 Sep 2016 15:28 #1

  • herr_schoen
  • herr_schoen's Avatar Topic Author
Hi,
first of all I'd like to say that I really like this plugin. However, I have problem with decimals. I am running a shop with currency EURO only. And of course I use a "," (comma) to separate the cents from the Euro. But, when adding Cents they seem to be cut off. When I use a "." (dot) instead, the cents are shown in the price and also in the basket.
Is there a trick to change to commas?
Thanks and regards
Andreas

problem with decimals 25 Sep 2016 13:58 #2

Dear Andreas,
Unfortunately, that's a JavaScript issue. The interpretation of the number entered is done by JavaScript in the customer's browser, and JS by default uses the dot as a seperator. The plugin simply takes what JS handles it...

Best regards,
Reinhold

problem with decimals 06 Oct 2016 14:25 #3

  • herr_schoen
  • herr_schoen's Avatar Topic Author
We have made a small modification in the template file to replace the ",". Seems to work:

//javascript to update price
	$script = '
/* <![CDATA[ */
var namethepricefunction = function(formProduct) {
	virtuemart_product_id = formProduct.find(\'input[name="virtuemart_product_id[]"]\').val();
	Virtuemart.setproducttype(formProduct,virtuemart_product_id);
};
var registernamethepricefunc = function($) {
	jQuery(".vmcustom-nametheprice").keyup(function() {
		formProduct = $(this).parents("form.product");
		$(this).val($(this).val().replace(",","."));     // This line has beed added.
		namethepricefunction(formProduct);
	});
};
jQuery("body").on("updateVirtueMartProductDetail", registernamethepricefunc);
jQuery(document).ready(registernamethepricefunc);
jQuery(document).ready(function() {
	jQuery(document).find("form.product").each(function() {
		namethepricefunction(jQuery(this));
	});
});
/* ]]> */
	';
$document = JFactory::getDocument()->addScriptDeclaration($script);
	

[SOLVED] problem with decimals 14 Oct 2016 18:27 #4

Problem solved.
  • Page:
  • 1