Hi, anniengo,
I may not be understanding your request, but the pricing information is all available in $_POST for you to grab out. You mentioned the price was included with the product name, but that is the price for the OPTION field associated to a product.
For each of the product fields there will be 3 (2 if using a separate quantity field) pieces of information in $POST for a product field. For instance, if my field is id 10, then input_10_1 is the product name, input_10_2 is the base price, and input_10_3 is the quantity (if your product field includes the quantity field with it). So you would need to get the price of the product, price of the option (which is what you are doing in your example) and multiply that times the quantity. If using a separate quantity field then you would need to grab out the qty from the separate field associated to your product field.
If you need the amount of all products on the page, then using the Total field is the best thing to use, but I understood your question to be in regards to only getting the prices for some of the products.
Let me know if you have any questions about this.
Posted 12 years ago on Tuesday December 13, 2011 |
Permalink