Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

I’m Going Nuts - Please Help
 
jroakes
Jr. Member
 
Total Posts:  19
Joined:  2008-08-09
 

Magento does 99% of what I need except for one thing.  Pricing based on Square Footage.  This should not be so hard.  I can create custom options for height and width (in inches) entry.  I just need to be able to get this to calculate (H*W)/144 and dump into another custom option field for square footage.  Is there a simple solution or am I just headed for a long fall over the deep end?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

I think it’s easier to not dump it in yet another var but just calculate price on the front-end based on the Height and Width. Then add as your 3rd custom var something like “ppsqft” for pricepersquarefoot which is boolean.

Look where the price is calculated (can’t remember off the top of my head) and add a little if statement like:

if ($product->ppsqft && $product->height && $product ->width 0{
$price 
whateveryourformula;
else {
//existing code
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
jroakes
Jr. Member
 
Total Posts:  19
Joined:  2008-08-09
 

Does that code work with virtual products?

 
Magento Community Magento Community
Magento Community
Magento Community
 
J_T_
Mentor
 
Avatar
Total Posts:  1961
Joined:  2008-08-07
London-ish, UK
 

How can a virtual product have a dimension?!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jroakes
Jr. Member
 
Total Posts:  19
Joined:  2008-08-09
 

We make cabinet glass and and as such we cut most pieces out of larger sheets of glass and do other operations on them that add value.  While I know that true virtual products are like downloads, ebooks, etc.  I am using it to sell glass panels.  I have a template set up here on Sunshop.  Click Here

I would rather use Magento as well I just really like the way it works compared to other carts but I need this finctionality.

Magento virtual products let you add a product and then add product options as in Click Here.  Since these options can modify the price I thought it would be an easy bridge to insert a script that would take the value from 3 option values (height, width, and sq. ft. price) and then run a calculation to either return this value to the magento price calculation script or return it to another custom option as the value of price adjustment field.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pauljg1
Sr. Member
 
Avatar
Total Posts:  179
Joined:  2008-02-22
 

Is there a solution for this yet?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top