I would like to get a size of the hole designed set. So my customers can actually see what height and length they are going to order.
It would be way more easier to calculare a price with real sizes of the designed product (in my case, plotter film), also you can calculate the area, and get a 100% safe price for their designed products. It would be awesome, if you also can set up pricing rules for specific area sizes.
0 Votes
R
Roman N posted
over 5 years ago
Best Answer
Since I was tired of waiting for a reply. I coded it by myself.
Open assets/js/FancyProductDesigner.js (run in debug mode)
Call a function in this.addView.on("elementAdd"), .on('elementSelect'), .on('elementChange'), .on('elementModify'), .on('elementRemove')
do your stuff you need in that function and than call:
if(allElements.length > 0){
var priceBox = calcPriceBox();
foilSize.width = $(".decal .size .length").val(); //real length of the ding you design e.g. 20cm (val: 20)
foilSize.height = round(foilSize.width / priceBox.aspect,2); //calc the real height of it
var area = foilSize.width * foilSize.height;
//calculate a price. maybe with the area, maybe with a crazy mathematical workarounds
}
return price;
0 Votes
1 Comments
R
Roman Nposted
over 5 years ago
Answer
Since I was tired of waiting for a reply. I coded it by myself.
Open assets/js/FancyProductDesigner.js (run in debug mode)
Call a function in this.addView.on("elementAdd"), .on('elementSelect'), .on('elementChange'), .on('elementModify'), .on('elementRemove')
do your stuff you need in that function and than call:
if(allElements.length > 0){
var priceBox = calcPriceBox();
foilSize.width = $(".decal .size .length").val(); //real length of the ding you design e.g. 20cm (val: 20)
foilSize.height = round(foilSize.width / priceBox.aspect,2); //calc the real height of it
var area = foilSize.width * foilSize.height;
//calculate a price. maybe with the area, maybe with a crazy mathematical workarounds
}
return price;
I would like to get a size of the hole designed set. So my customers can actually see what height and length they are going to order.
It would be way more easier to calculare a price with real sizes of the designed product (in my case, plotter film), also you can calculate the area, and get a 100% safe price for their designed products. It would be awesome, if you also can set up pricing rules for specific area sizes.
0 Votes
Roman N posted over 5 years ago Best Answer
Since I was tired of waiting for a reply. I coded it by myself.
Open assets/js/FancyProductDesigner.js (run in debug mode)
Call a function in this.addView.on("elementAdd"), .on('elementSelect'), .on('elementChange'), .on('elementModify'), .on('elementRemove')
do your stuff you need in that function and than call:
with this function you will get box (in pixels) I made in the post before with my awesome drawing skills.
Of course you need to add every element in an array you can access... I made it dirty and made my own.. IDGAS..
I use it like this: (shortened)
0 Votes
1 Comments
Roman N posted over 5 years ago Answer
Since I was tired of waiting for a reply. I coded it by myself.
Open assets/js/FancyProductDesigner.js (run in debug mode)
Call a function in this.addView.on("elementAdd"), .on('elementSelect'), .on('elementChange'), .on('elementModify'), .on('elementRemove')
do your stuff you need in that function and than call:
with this function you will get box (in pixels) I made in the post before with my awesome drawing skills.
Of course you need to add every element in an array you can access... I made it dirty and made my own.. IDGAS..
I use it like this: (shortened)
0 Votes
Login or Sign up to post a comment