VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: sideways on November 26, 2014, 11:26:57 AM

Title: Add price in product details
Post by: sideways on November 26, 2014, 11:26:57 AM
Hello

I sell CD print/press products and would like to show the salesprice multiplied with selected quantity in the product details page, in addition to the other prices. I have been looking at this for a while but can't figure out the best way to do it. I guess I need to override components/com_virtuemart/views/productdetails/tmpl/default_showprices.php to achieve this and I have made several attempts but failed. I would be very grateful for some pointers and tips so I can solve this once and for all.
Title: Re: Add price in product details
Post by: GJC Web Design on November 26, 2014, 11:31:38 AM
very unusual behaviour IMHO - no online retailer I know does this.. surely this is what the mini-cart is for?

and it is complex - you have to do it thru ajax calls
Title: Re: Add price in product details
Post by: sideways on November 26, 2014, 11:52:43 AM
Quote from: GJC Web Design on November 26, 2014, 11:31:38 AM
very unusual behaviour IMHO - no online retailer I know does this.. surely this is what the mini-cart is for?

and it is complex - you have to do it thru ajax calls

Unusual? Is it really?

I sell on-demand CD pressing and prints. My products are sold in bulk with prices changing depending on the selected quantity and selected product options/attributes. I want my customers to see the total product cost before adding it to the cart - a higher or lower quantity might mean a better deal. I'd say it's pretty much a requirement.
Title: Re: Add price in product details
Post by: GJC Web Design on November 26, 2014, 12:39:44 PM
As I say - show me a major retailer site that does this...

also as i say - complex -

the "normal" approach is to show a price/quantity table e.g. as I did here http://www.shannon.be/nl/- probably spam --panelen-print-3-mm-detail

Title: Re: Add price in product details
Post by: sideways on November 26, 2014, 13:31:26 PM
Okay, so we established you think it is a somewhat unusual behavior. Noted.  ;D

Would you mind we focus on my actual question? I was hoping someone would explain to me why it is so complicated, or at least give me a brief outline of what steps would be required? What parameters are involved?
Title: Re: Add price in product details
Post by: GJC Web Design on November 26, 2014, 13:45:35 PM
if you don't know what this means
Quoteand it is complex - you have to do it thru ajax calls
then I really don't see the point in my continuing with an explanation

but here goes: the price updates via ajax/JS when you select a quantity/custom field - you have to use that same routine to multiply it by the quantity - core hack probably to vmprices.js
Title: Re: Add price in product details
Post by: sideways on November 27, 2014, 09:16:01 AM
No worries. I know the inner workings of ajax and so do most web developers. Though it obviously seems complex (for you) I assure you it's not that hard to comprehend if you really apply yourself. About my question, never mind, I'll sort it out.

Quote from: GJC Web Design on November 26, 2014, 13:45:35 PM
if you don't know what this means
Quoteand it is complex - you have to do it thru ajax calls
then I really don't see the point in my continuing with an explanation

but here goes: the price updates via ajax/JS when you select a quantity/custom field - you have to use that same routine to multiply it by the quantity - core hack probably to vmprices.js
Title: Re: Add price in product details
Post by: GJC Web Design on November 27, 2014, 18:08:10 PM
Clever chappie - really makes me wonder why you asked the question in the 1st place then..... seeing as you know..