Price Calculation

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 yıl önce
I want to offer 4 different price based on dynamic calculations. So at the product page I would like to add a button which says for example

Price 1.
Price 2
Price 3
Price 4

Where Price 1 / Price 2 / Price 3 / Price 4 are 4 different pricing which would be calculated outside of NOPCommerce.

How do we develop a plug-in for this functionality?

I think what I am looking for is the Master Product Page, 4 buttons for 4 prices would come in each product page and on clicking any of those buttons, say someone clicks Price1, it will query my URL and return with results.

Second part I would guess will be effected into the Javascript page; the first page from some Master Page code?

Thanks for your help.
12 yıl önce
anandg wrote:
I want to offer 4 different price based on dynamic calculations. So at the product page I would like to add a button which says for example

Price 1.
Price 2
Price 3
Price 4

Where Price 1 / Price 2 / Price 3 / Price 4 are 4 different pricing which would be calculated outside of NOPCommerce.

How do we develop a plug-in for this functionality?

I think what I am looking for is the Master Product Page, 4 buttons for 4 prices would come in each product page and on clicking any of those buttons, say someone clicks Price1, it will query my URL and return with results.

Second part I would guess will be effected into the Javascript page; the first page from some Master Page code?

Thanks for your help.



if you really calculate the price outsitde-nop you could *just* jquery it in:

by: ( this code was not tested, just illustrates what todo ( look jquery-api to find out in detail )

say you give your price - html elements  a "onclick" that returns the price with json  , and append them to nop's output once the page is ready..
      
$(priceID).children().append(price2).append(price3).append(price4)

( of course you need to give the product - id or current-price or whatever you calculate on to that onclick method )
i really don't think it is very vise to calculate prices outside-nop - but thats your beer ...
12 yıl önce
You may want to consider using product variant's "Customer enters price:" field.
The controller would call a plugin that would get the dynamic rates, set them in the (modified) model, and some javascript in the View would set the customer entered price for return (based on radio buttons, etc.)  You may even be able to avoid the javascript if your radio buttons have the expected Name (rather than the customer entered price textbox).
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.