News:

Support the VirtueMart project and become a member

Main Menu

Sell products by decimal weight

Started by bilalsaad, April 30, 2015, 12:41:46 PM

Previous topic - Next topic

aftertaf

Quote from: AH on May 28, 2017, 11:18:40 AM
Maybe this plugin might have helped you??

Which allows you to set a price per metre and the variants of length you wish to sell plus lots of other config options

http://forum.virtuemart.net/index.php?topic=127362.0
Hi, it almost would have: the problem is that POSforWebshops has the same limitations, and its the main component in use right now. Ship does physical sales and needed a solution that was pragmatic and simple to implement.
That's why i ended up doing it the way i described.

Using the option Multiply the price *
Config: 1m,2m@*2,3m@*3
Gives prices of: 1m = Retail, 2m = Retail * 2, 3m = Retail * 3



aftertaf

Quote from: aftertaf on May 29, 2017, 12:00:32 PM
Quote from: K&K media production on May 28, 2017, 17:32:37 PM
Quote-hacked the currencydisplay.php to have a new public function createPriceDivPerMetre

You can add your own PHP-File as helper to your Template and call public functions from there.
Thankyou. I didn't know that.


Could you briefly describe how to do this ?
I didn't find any docs and i'm not so good at experimenting in PHP..

K&K media production

new php file inside your template with content like this:


<?php
class myHelperClass {
    public static function 
myFunction() {
        return 
'result';
    }
}
?>



inside your php template files:


if (!class_exists('myHelperClass')) require_once(JPATH_BASE.'/path to your helper file');

$result = myHelperClass::myFunction();



aftertaf

thx: i'll give that a try one of these summer evenings  8)