Forums / Managing Customers and Orders / is there a way to calculate prices based on length, width and hright?

is there a way to calculate prices based on length, width and hright?

Started by denniszc on 11 Mar 2013, 9:03 AM · Views: 6,140

Results 1 to 20 of 22
11 Mar 2013, 9:03 AM
#1
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

is there a way to calculate prices based on length, width and hright?

hey guys, my store is gonna deal with making steel doors, shutters, gates and anything related to metal works, the calculations is based on the dimensions of the product, i was wondering, is there a way to make it so that the price is calculated based on length, width and height dimensions?

11 Mar 2013, 11:29 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: is there a way to calculate prices based on length, width and hright?

denniszc:

hey guys, my store is gonna deal with making steel doors, shutters, gates and anything related to metal works, the calculations is based on the dimensions of the product, i was wondering, is there a way to make it so that the price is calculated based on length, width and height dimensions?

There's nothing built in that will do this. There** may **be something in the add-ons area though.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

11 Mar 2013, 9:33 PM
#3
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: is there a way to calculate prices based on length, width and hright?

You can attempt this with attributes such as

width:
24-36 added cost
37-48 added cost

Length:
???-??? added cost
etc

Height:
???-??? added cost
etc

Zen-Venom Get Bitten

12 Mar 2013, 5:18 AM
#4
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

RodG:

There's nothing built in that will do this. There** may **be something in the add-ons area though.

Cheers
Rod

i have searched for it and found a few threads from people who have altered the code to do it, but in that same thread i also see people say it doesnt work with the later version of zen cart..

kobra:

You can attempt this with attributes such as

width:
24-36 added cost
37-48 added cost

Length:
???-??? added cost
etc

Height:
???-??? added cost
etc

good idea, i'll try to see what the exact requirements are. btw just incase it does not meet the requirements, do you have any idea what files and code i should look at to try to make this work? i've learned web programming so i have a little knowledge of html, php, css and jacascript..

12 Mar 2013, 6:35 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: is there a way to calculate prices based on length, width and hright?

just incase it does not meet the requirements, do you have any idea what files and code i should look at to try to make this work
No files or code alterations required - just adding attributes

http://www.zen-cart.com/content.php?99-how-do-i-add-attributes-to-my-products

Zen-Venom Get Bitten

12 Mar 2013, 6:39 AM
#6
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

kobra:

No files or code alterations required - just adding attributes

http://www.zen-cart.com/content.php?99-how-do-i-add-attributes-to-my-products

i mean if what you suggested does oot meet the requirements, anyway, i found out that we're going to calculate the price per square foot, they want something like the client can enter 2 values, X and Y, and the multiplication of X and Y with the base price will be the final price.. i see per square foot in the attribute controller, can i make this work?

12 Mar 2013, 6:46 AM
#7
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: is there a way to calculate prices based on length, width and hright?

i see per square foot in the attribute controller
Someone must have added that as an attribute because "per sq/ft" is not part of a standard install
can i make this work
Yes, if you price the item by the square foot
i.e. $1.00 = 1 square foot

Not through multiplying x*y

You would have to explain to customers that they must determine the sq/ft required and enter this in the qty to purchase

Zen-Venom Get Bitten

12 Mar 2013, 7:17 AM
#8
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

kobra:

Someone must have added that as an attribute because "per sq/ft" is not part of a standard install

Yes, if you price the item by the square foot
i.e. $1.00 = 1 square foot

Not through multiplying x*y

You would have to explain to customers that they must determine the sq/ft required and enter this in the qty to purchase

i'll keep that in my back pocket, i think i'll try to do it by multiplication first.. any ideas which files or code i should look at? and how to call the product price?

12 Mar 2013, 9:08 AM
#9
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

how do i edit the attributes text? for example, i want to add an attribute "custom" and inside i will write a read-only text "for custom dimensions please contact us", i would like to make it so that the "contact us" is a link that links them to the contact us page.. meaning i would like to add a "a href" tag somewhere.. how do i do this?

12 Mar 2013, 5:55 PM
#10
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: is there a way to calculate prices based on length, width and hright?

i would like to make it so that the "contact us" is a link that links them to the contact us page.. meaning i would like to add a "a href" tag somewhere.. how do i do this?
Do this in the product description area

Zen-Venom Get Bitten

12 Mar 2013, 9:56 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: is there a way to calculate prices based on length, width and hright?

Or if you really need it in the attributes area, you can make a read-only attribute in Option Name Manager, then edit it and add a "comment".

13 Mar 2013, 3:09 AM
#13
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: is there a way to calculate prices based on length, width and hright?

In a language file. Use Tools > Developers Toolkit to search for distinctive snippets like Enter your text and Price per Word.

13 Mar 2013, 3:37 AM
#14
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

gjh42:

In a language file. Use Tools > Developers Toolkit to search for distinctive snippets like Enter your text and Price per Word.

thanks i found the price per word and price per letter, but i couldnt find Enter your text anywhere, i look in all files in all 5 options in the dev tool kit

13 Mar 2013, 3:56 AM
#15
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

really couldnt find it anywhere, normally the language pack will have all these translated, but when i changed the language the enter your text text was not translated..

13 Mar 2013, 5:12 AM
#16
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: is there a way to calculate prices based on length, width and hright?

Odd... I couldn't find it either. It must be stored in the database if it is not in a file.
Can you post more context on where this appears? Or a link to see it?

13 Mar 2013, 5:18 AM
#17
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

gjh42:

Odd... I couldn't find it either. It must be stored in the database if it is not in a file.
Can you post more context on where this appears? Or a link to see it?

it showed up in the price section where you add in the attributes

http://img171.imageshack.us/img171/2680/capturerdr.png

add in a text attribute to your product and you should be able to see it too

13 Mar 2013, 5:51 AM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: is there a way to calculate prices based on length, width and hright?

You are using the stock demo product option names, specifically "Line 1" (even if you edited the name), which has that text in its comment field.

The database with demo products installed has in the products_options table a record with products_options_id = 10, products_options_name = Line 1 and products_options_comment = Enter your text up to 64...

13 Mar 2013, 6:28 AM
#19
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

gjh42:

You are using the stock demo product option names, specifically "Line 1" (even if you edited the name), which has that text in its comment field.

The database with demo products installed has in the products_options table a record with products_options_id = 10, products_options_name = Line 1 and products_options_comment = Enter your text up to 64...

thanks i got it, thanks for checking it out for me really appreciate it

13 Mar 2013, 8:22 AM
#20
denniszc avatar

denniszc

New Zenner

Join Date:
Mar 2013
Posts:
95
Plugin Contributions:
0

Re: is there a way to calculate prices based on length, width and hright?

okay, this is abit of a really crude and forceful way, but i manage to add a text that can calculate the price based on widthxlengthxheight (or any 4th dimensional attribute you'd like), first of all go to zencart/includes/functions and edit functions_price.php, go to line 1167 and find the calculate per words price section. edit it to the following

  function zen_get_word_count_price($string, $free=0, $price) {
	 $squareFoot = explode("x",$string);
	 if($squareFoot[0]<=28&&$squareFoot[1]<=9||$squareFoot[1]<=28&&$squareFoot[0]<=9){
		$pricePerSqFoot = $squareFoot[0] * $squareFoot[1] * $price - $price;
		return $pricePerSqFoot;
	 } else{
		return 0;
	 }
  }

the "x" is the delimiter, modify to suit your needs, the if statement is basically the max size range for my metal shop, so modify accordingly if yours is bigger or smaller or just remove them if you dont have a limit.. anyway, to use it add the text attribute to your product and set the price per word to whatever base price your product is and wala! you have a calculation based on dimensions, have fun