Best method I could think of is to utilize this same code but rather make a seperate form on product pages that submits to a custom PHP page where you can easily add it to the customers cart, get the calculation, display it to the user and remove the item from the customers cart.
Basically adding and removing the product to the customers cart would be transparent as to get all the needed $cart variables to perform the estimation. Problem with this is if a customer already has something in their cart, the calculation would be for both items instead of one.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
|