Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Show price per foot

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-24-2011, 04:27 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Show price per foot

This is for a 4.4.2 cart.

There are products in four categories that we want to sell by the foot. The base price per foot is modified by certain specified lengths and by color. For example, picket 1 costs $0.57 per foot. It is sold in 12 foot lengths, so one picket is $6.84. If it is tan there is a 15% surcharge, so it would cost $7.87.

We want to display the price per foot on both the products list and the product detail page. Because the products have wholesale pricing based on membership we can▓t just write it in the product description, though.

I was able to display the price per foot on the product detail page (not the products list page) using price modifiers for both length and color, but then the calculations are incorrect; both the percentages are just calculated on top of the base price per foot, so that a 12 foot tan picket would only cost $6.93. Using a variant for length gets a correct calculation for total price, but then:
a. I couldn▓t get the price per foot to show, and
b. I couldn▓t add wholesale on the per foot price

To make this even more complicated, we want to have certain bundle sizes specified. If the customer buys a broken bundle, any pieces outside of the bundle should cost 10% more. This last part is less important, but in an ideal world that is our goal.

Does anyone have any ideas about how to do at least the price per foot part?
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
  #2  
Old 09-24-2011, 09:23 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Show price per foot

It sounds like you would have to do some simple math on {$product.taxed_price} in cutomer/main/product_details.tpl.

Go in there and establish another row to display the price per foot. I'm assuming that you have the price per picket established and working, just leave that and divide by 12 next to it to show price per foot. like {$product.taxed_price/12}.

I haven't tested this, but I think you would need to also:
round($somevar,2) to get the decimal place right.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 09-24-2011, 11:02 AM
  proboscidian's Avatar 
proboscidian proboscidian is offline
 

Senior Member
  
Join Date: May 2005
Location: Clearwater, FL
Posts: 146
 

Default Re: Show price per foot

Thanks, that would be a good way to do it but some of the pickets have more than one standard length. I think we'll just leave the price per picket out for now.
__________________
Industrial Webworks
Various xcart versions from 4.1.19 gold - 4.7 gold
http://www.industrialwebworks.net
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:10 AM.

   

 
X-Cart forums © 2001-2020