Announcement

Collapse
No announcement yet.

Showing Total Discounted Amount on Merch Confirmation

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Showing Total Discounted Amount on Merch Confirmation

    We are looking for a way to have the Merch Confirmation e-mail show the cumulative total of the discount a customer was given on their order.

    In the Admin screen, that amount is displayed at the bottom of the page as shown in the image below:

    FireShot Pro Screen Capture #209 - 'Miva Merchant Administration_ compnchoke' - www_comp-n-choke.jpg

    We've figured out how to get the amount to show for each individual line item (-8.25 per item in this example), but need a total on the printout ($66.00 in this example) so that when the order is entered into our accounting software, it's a single dollar amount.
    Last edited by aubreyd; 10-05-15, 10:44 AM.
    www.kicks-ind.com
    www.comp-n-choke.com

    #2
    Re: Showing Total Discounted Amount on Merch Confirmation

    Basket level discounts will automatically appear in the charges loop with a single line item for the discount since it applied to the entire cart.

    Product level discounts only appear at the product level. If you also need it to appear down by the charges you would need to add up the total discounts yourself of each product in the order and then display that variable before or after the order charges.
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: Showing Total Discounted Amount on Merch Confirmation

      So, I know that I might be using the wrong "for each" and I've tried to make this work even on the BASK page, but so far, I'm stuck. How do I go about adding each discount to come up with a total? Here's what I have so far:

      Code:
      Total Discount Savings:<br />
      <mvt:foreach iterator="item" array="basket:items">
      <mvt:item name="toolkit" param="math_multiply|times|l.all_settings:item:quantity|l.all_settings:item:discount" />
      <mvt:item name="toolkit" param="math_add|sum|g.times|basket:savingstotal" />
      <mvt:item name="toolkit" param="currencyformat|formatted_savings|sum" />
      &mvte:global:formatted_savings;
      </mvt:foreach>
      Last edited by KayfabeRockStar; 10-14-15, 01:10 PM.
      Jason Lindsey
      Dreamchaser Design
      www.dreamchaserdesign.com
      "You Dream. We Design."

      Comment


        #4
        Why didn't anybody finish this? Just curious as I think it would be great to be able to display total discounts on the cart.

        Comment


          #5
          There are both item discount and option discounts (discounts applied to specific attributes).

          Here is an example:

          Code:
          <mvt:foreach iterator="group" array="basket:groups">
          
              <mvt:comment>Item Discounts</mvt:comment>
              <mvt:foreach iterator="discount" array="group:discounts">
              &mvt:group:discount;
                  <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
          
              </mvt:foreach>
          
          
              <mvt:comment>Option Discounts</mvt:comment>
              <mvt:foreach iterator="option" array="group:options">
                  <mvt:foreach iterator="discount" array="option:discounts">
          
                      <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
          
                  </mvt:foreach>
              </mvt:foreach>
          
          
          </mvt:foreach>
          
          <mvt:comment>Format Currency</mvt:comment>
          <mvt:do name="g.total_discount_formatted" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.total_discount )" />
          
          &mvt:global:total_discount_formatted;
          This is only looking at product level discounts. If you also have basket discounts you would need to add these in as well.
          Last edited by Brennan; 03-28-17, 12:34 PM.
          Brennan Heyde
          VP Product
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            I did try this but I don't think this applies. Here are some screen shots. Hope this explains what we are trying to do.
            Attached Files

            Comment


              #7
              That code above should give you a sum of the product level discounts. Are you not getting the value you expect?
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                I get a 0.00

                On this page:

                http://www.jantecneon.com/shopping-cart.html

                Add products form this cat:

                http://www.jantecneon.com/Ice-Cream-Neon-Signs.html
                Last edited by fastees; 03-28-17, 11:48 AM.

                Comment


                  #9
                  Sorry about that, I had the foreach loops incorrect. I just updated the code above and it works in my dev store. Here it is again:

                  Code:
                  <mvt:foreach iterator="group" array="basket:groups">
                  
                      <mvt:comment>Item Discounts</mvt:comment>
                      <mvt:foreach iterator="discount" array="group:discounts">
                      &mvt:group:discount;
                          <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
                  
                      </mvt:foreach>
                  
                  
                      <mvt:comment>Option Discounts</mvt:comment>
                      <mvt:foreach iterator="option" array="group:options">
                          <mvt:foreach iterator="discount" array="option:discounts">
                  
                              <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
                  
                          </mvt:foreach>
                      </mvt:foreach>
                  
                  
                  </mvt:foreach>
                  
                  <mvt:comment>Format Currency</mvt:comment>
                  <mvt:do name="g.total_discount_formatted" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.total_discount )" />
                  
                  &mvt:global:total_discount_formatted;
                  Brennan Heyde
                  VP Product
                  Miva, Inc.
                  [email protected]
                  https://www.miva.com

                  Comment


                    #10
                    That worked. Thank you, I'm sure some other people will want to take advantage of this.

                    Comment


                      #11
                      I know this is an old post BUT the below code still works.. thank you Brennan! I was wondering..if I wanted the same information to be displayed within the order merchant email and the ORDER_INVOICE - Printable Invoice - is there different coding I should be using as I seem to not be able to get it to work - or I missed a step...still looking into now. Thank you!


                      Originally posted by Brennan View Post
                      Sorry about that, I had the foreach loops incorrect. I just updated the code above and it works in my dev store. Here it is again:

                      Code:
                      <mvt:foreach iterator="group" array="basket:groups">
                      
                      <mvt:comment>Item Discounts</mvt:comment>
                      <mvt:foreach iterator="discount" array="group:discounts">
                      &mvt:group:discount;
                      <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
                      
                      </mvt:foreach>
                      
                      
                      <mvt:comment>Option Discounts</mvt:comment>
                      <mvt:foreach iterator="option" array="group:options">
                      <mvt:foreach iterator="discount" array="option:discounts">
                      
                      <mvt:assign name="g.total_discount" value="g.total_discount + l.settings:discount:discount" />
                      
                      </mvt:foreach>
                      </mvt:foreach>
                      
                      
                      </mvt:foreach>
                      
                      <mvt:comment>Format Currency</mvt:comment>
                      <mvt:do name="g.total_discount_formatted" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, g.total_discount )" />
                      
                      &mvt:global:total_discount_formatted;

                      Comment


                        #12
                        The array for the ORDER_INVOICE is different. Instead of basket:groups you would want to use order:groups

                        The other arrays should be the same.
                        Brennan Heyde
                        VP Product
                        Miva, Inc.
                        [email protected]
                        https://www.miva.com

                        Comment


                          #13
                          Originally posted by Brennan View Post
                          The array for the ORDER_INVOICE is different. Instead of basket:groups you would want to use order:groups

                          The other arrays should be the same.
                          Thank you Brennan! But I still can't seem to get it to work. The site is using the Levels Ready Theme.

                          The cart page is using the BASK template, and then through the rest of the checkout process it uses a theme component/content section for the Basket Summary - the displaying of the discounts using the code from 03-28-17 works up until the INVC page and on the INVC page displays nothing at all.

                          On the INVC page it is using/displaying the Order Contents <mvt:item name="order_contents" /> for that page and of course, not displaying the total discount. So..then it doesn't display on the ORDP, Printable Invoice, Customer Order Email and Merchant Email.

                          Does the total savings amount have to be saved/write on the payment screen? so that it can then be called on the INVC and other pages/emails? If so, could you point me in the right direction with the code? Hope I made sense trying to explain it.

                          Thank you in advance.

                          Comment


                            #14
                            Anyone have any ideas on how to get the total amount of discounts to display on the INVC, ORDP, Printable Invoice, Customer Order Email and Merchant Email? Thank you again.

                            Comment

                            Working...
                            X