X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show price per foot (https://forum.x-cart.com/showthread.php?t=61000)

proboscidian 09-24-2011 04:27 AM

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?

totaltec 09-24-2011 09:23 AM

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.

proboscidian 09-24-2011 11:02 AM

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.


All times are GMT -8. The time now is 07:24 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.