VirtueMart Forum

VirtueMart 2 + 3 + 4 => 3rd party extension => Topic started by: jibon57 on July 25, 2014, 12:23:03 PM

Title: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: jibon57 on July 25, 2014, 12:23:03 PM
Using this plugin you can perform mathematical operations like Percentage,  Multiply, Add, Subtract custom filed value with main products. For example: If your main product is Business Card & Standard price is $10. But in your custom field you want to put 2 sided color option & that will be 20% extra of main price. With this extension you can do this easily :).
(http://extensions.hoicoimasti.com/images/mathsign.png)


More detail & free download: http://extensions.hoicoimasti.com/products/9-virtuemart-extension/7-vm-custom-field-price-based-on-mathmatical-sign.html
demo: http://demo.hoicoimasti.com/component/virtuemart/headgear/hats/classic-hat-detail.html

Special thanks @PRO for his great plug-in dropbox :). I used his code in this extension :)
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: cilijus on September 22, 2014, 15:05:09 PM
Excellent plg but has a problem with entering decimal numbers eg +%1.25...... somehow I managed to edit it (a total novice developer), it took me a while to do it. But now appeared another problem .... calculates only the basic price of the product regardless of what other custom plg added amount. Does anyone know what the problem is? Thanks
php is in attachment

[attachment cleanup by admin]
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: Adwans on March 19, 2016, 14:09:11 PM
Hello Jibon57!
Plugin works great on VM 2.5. It is really  cool. Have you considered upgrading to VM3?
I ve  tried to rewrite your plugin regarding new VM3 triggers, database fields, and so on, have still no progress yet.
Cannot register input's values in $varsToPush, tried also $this->varsToPush

Best regards
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: Adwans on April 07, 2016, 13:29:38 PM
Quote from: cilijus on September 22, 2014, 15:05:09 PM
Excellent plg but has a problem with entering decimal numbers eg +%1.25...... somehow I managed to edit it (a total novice developer), it took me a while to do it. But now appeared another problem .... calculates only the basic price of the product regardless of what other custom plg added amount. Does anyone know what the problem is? Thanks
php is in attachment
Hello!
Look here into the plugin's trigger function:
public function plgVmPrepareCartProduct(&$product, &$customfield,$selected,&$modificatorSum){

some versions are like:
public function plgVmPrepareCartProduct(&$product, &$customfield,$selected,&$modificatorSum=0){
Maybe this is why it cancells (resets) what all other had added? Due to this =0 at the argument list end ?
In my version I deleted this. And works fine.

Now I m working on upgrading it to the VM3 version...
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: AH on April 07, 2016, 15:19:17 PM


It appears as though you might be re-inventing the wheel

Have you considered using the VM3 version of the dropbox plugin - which has some additional functionality

http://forum.virtuemart.net/index.php?topic=127362.0 (http://forum.virtuemart.net/index.php?topic=127362.0)

Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: GJC Web Design on April 07, 2016, 16:22:56 PM
an excellent plugin but poorly named..  :( --
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: Adwans on April 07, 2016, 21:43:06 PM
OK OK, no more wheels.. ;)
But, I dont want to modify db tables, I mean ALTER tables, literally hate it.
Quotean excellent plugin but poorly named..  :( --
BTW, which one?  :)
Title: Re: Custom Field Based on Mathmatical Sign (Percentage,add,Multiply,subtract) free
Post by: GJC Web Design on April 07, 2016, 21:59:00 PM
the one AH mentioned..  http://forum.virtuemart.net/index.php?topic=127362.0

does all u want and more.. no core hacks etc is a kosher VM plugin