News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

adding custom price, similar to 'Cart variant'

Started by bjornwebdesign, January 29, 2015, 19:41:48 PM

Previous topic - Next topic

bjornwebdesign

Hi All,

I'm running VM3 with the latest version of Joomla.

I want to recalculate the product price, adding my own custom price data.
Using jQuery I added the following:


formProduct = jQuery(".productdetails-view").find(".product");
Virtuemart.setproducttype(formProduct, virtuemart_product_id);


The 'formProduct' contains all the product data, how do I edit the product price?
For example i want to add 20,-. Can I update 1 price var, or do I need to update all the price vars (basePriceVariant, salesPrice, etc)?

I think I have do something like this:

formProduct.innerHTML=vmPrice.replace(strPrice(strNum(vmPrice)), strPrice(price));


The VM custom fields don't offer what i want, because the price i want to add is calculated by my own php.
I can't provide an URL, because it's running on a local webserver.

Any help is very much appreciated.

Regards,
Bjorn

Milbo

Take a look on the textinput plugin. I would not mess around with the function working for anyone else. that means, do not call the js yourself, it is better to change the data, which is used by the js, => textinput plugin.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/