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.
Best Answer
R
Roman N
said
over 6 years ago
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;
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;
R
Ricard Llordés Espina
said
5 months ago
Hi Roman, I have the same problem. I need to view the size of the image uploaded by the client or the composition of the design made on our personalized t-shirts.
Could you tell me if this code can help me solve it?
Roman N
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.
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)
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstRoman N
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)
Ricard Llordés Espina
Hi Roman, I have the same problem. I need to view the size of the image uploaded by the client or the composition of the design made on our personalized t-shirts.
Could you tell me if this code can help me solve it?
-
Adding Fancy Products to Categories
-
Shortcode for specfic product designer
-
What theme is recommended to use with FPD ?
-
Exclude Image from export
-
Google Font Family adds extras
-
Floating Dialog box
-
Uploadzone not working
-
Image transparency like in T-shirt demo
-
How do I get clipart
-
What does the LOAD button do / what is it for?
See all 2210 topics