I am still a Novice with Miva, so I will try to explain this as best I can.
My store owner has requested that all pricing be rounded to the floor of its value after the price group discount has been applied. (ie...25%, 30%, 40%)
The idea being that there will never be anything after the decimal point. (ie...$275.25 = $275.00 or $363.75 = $363.00).
<mvt:foreach iterator="group" array="basket:groups">
<mvt:assign name="g.discround" value="floor( l.settings:group:price )" />
<mvt:item name="toolkit" param="math_multiply|lineoprice|g.discround|l.all_ settings:group:quantity" />
<mvt:item name="toolkit" param="math_add|basketsubtotal|basketsubtotal|line oprice" />
<mvt:do name="g.formatted_basketsubtotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.basketsubtotal )" />
&mvt:global:formatted_basketsubtotal;
<mvt:foreach iterator="item" array="global_minibasket:groups">
<mvt:assign name="g.minibaskround" value="floor( l.settings:item:price )" />
<mvt:item name="toolkit" param="math_multiply|lineoprice|g.minibaskround|l. all_settings:item:quantity" />
<mvt:item name="toolkit" param="math_add|minibaskettotal|minibasketsubtotal |lineoprice" />
<mvt:do name="g.formatted_minibaskettotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.minibaskettotal )" />
&mvt:global:formatted_minibaskettotal;
<mvt:assign name="g.minitotaftship" value="( g.minibaskettotal + l.settings:basket:charges[1]:amount )" />
<mvt:do name="g.formatted_totaftship" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.totaftship )" />
&mvt:global:formatted_totaftship;
All of this works, and all calculations are generated & displayed correctly. These show pricing correctly all the way through to the (OCST) Page, which is the hurdle I so badly need to overcome. I need these variables that I have created to be applied to the amount that is processed when the customer hits the "Complete Order" button. I can get these values to show on the Invoice page, but I really need this corrected amount to be the value that is processed when the payment is captured.
I am using the Shadows Ready Theme and I have the site set up so that no one can access unless they have a Username & Password. The purpose of the site is to be a Wholesale Ordering Portal for our Wholesale Accounts. If anyone has any advise or can point me in the right direction, it would be greatly appreciated. i realize this probably not something that will be easy to do, I'm just hoping that it can actually be done.
Thank you all. This is my first post in the Forums.
My store owner has requested that all pricing be rounded to the floor of its value after the price group discount has been applied. (ie...25%, 30%, 40%)
The idea being that there will never be anything after the decimal point. (ie...$275.25 = $275.00 or $363.75 = $363.00).
- I have been able to create custom logic using Miva/Toolkit Math Functions in the MiniBasket, Basket pages & the Basket Summary to display these calculations correctly, which looks something like this:
<mvt:foreach iterator="group" array="basket:groups">
<mvt:assign name="g.discround" value="floor( l.settings:group:price )" />
<mvt:item name="toolkit" param="math_multiply|lineoprice|g.discround|l.all_ settings:group:quantity" />
<mvt:item name="toolkit" param="math_add|basketsubtotal|basketsubtotal|line oprice" />
<mvt:do name="g.formatted_basketsubtotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.basketsubtotal )" />
&mvt:global:formatted_basketsubtotal;
- or:
<mvt:foreach iterator="item" array="global_minibasket:groups">
<mvt:assign name="g.minibaskround" value="floor( l.settings:item:price )" />
<mvt:item name="toolkit" param="math_multiply|lineoprice|g.minibaskround|l. all_settings:item:quantity" />
<mvt:item name="toolkit" param="math_add|minibaskettotal|minibasketsubtotal |lineoprice" />
<mvt:do name="g.formatted_minibaskettotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.minibaskettotal )" />
&mvt:global:formatted_minibaskettotal;
- And then Adding shipping charge in the Basket Summary and Final Total:
<mvt:assign name="g.minitotaftship" value="( g.minibaskettotal + l.settings:basket:charges[1]:amount )" />
<mvt:do name="g.formatted_totaftship" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.totaftship )" />
&mvt:global:formatted_totaftship;
All of this works, and all calculations are generated & displayed correctly. These show pricing correctly all the way through to the (OCST) Page, which is the hurdle I so badly need to overcome. I need these variables that I have created to be applied to the amount that is processed when the customer hits the "Complete Order" button. I can get these values to show on the Invoice page, but I really need this corrected amount to be the value that is processed when the payment is captured.
I am using the Shadows Ready Theme and I have the site set up so that no one can access unless they have a Username & Password. The purpose of the site is to be a Wholesale Ordering Portal for our Wholesale Accounts. If anyone has any advise or can point me in the right direction, it would be greatly appreciated. i realize this probably not something that will be easy to do, I'm just hoping that it can actually be done.
Thank you all. This is my first post in the Forums.
Comment