Announcement

Collapse
No announcement yet.

variable for total price, including the attribute cost?

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

    variable for total price, including the attribute cost?

    Hi all,

    Can anyone tell me the variable for a product price, including the cost of the attribute that is selected? I'd like to use that instead of &mvt:product:formatted_price; in a few places.
    Or, even better, tell me how or where I would find that sort of thing myself? Would that be on http://www.mivascript.com/ somewhere?

    Thanks!
    Chad
    chad oesterreich ·director of corporate optimization

    www.soul-flower.com · 651.251.1028 · [email protected]

    #2
    Re: variable for total price, including the attribute cost?

    If you're on PR8 Update 5, make sure you've installed the Token List module (under Utilities) and then you can see each variable available on a page by page basis.

    It's covered in the reference guide for more info: http://www.mivamerchant.com/support/docs
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      Re: variable for total price, including the attribute cost?

      If you can't find a variable for that, there is a function in the Emporium Plus Tool Kit to get the combined base + attribute prices.
      Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
      Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
      Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
      Facebook http://www.facebook.com/EmporiumPlus
      Twitter http://twitter.com/emporiumplus

      Comment


        #4
        Re: variable for total price, including the attribute cost?

        Thanks guys I did try the Token List module first but it gave me 1500 options and not knowing exactly what to look for I didn't find it. Still don't see it there so I will try the toolkit. Are you referring to the math_add function Bill?
        Thanks-
        Chad
        chad oesterreich ·director of corporate optimization

        www.soul-flower.com · 651.251.1028 · [email protected]

        Comment


          #5
          Re: variable for total price, including the attribute cost?

          You could do it that way but it would be cumbersome. There is a new function in the Tool Kit which sums it with one token and then you just change the name of the variable you are displaying for the price. I haven't mentioned Tool Kit's latest version in Facebook or Twitter yet as I am waiting for PR8 Update 6 to come out. There is a new feature related to it. However, you can update now and get that Update 6 feature (which is not operational until you update Merchant) and the bask/invc sum functions (which are operational at this time).
          Bill Weiland - Emporium Plus http://www.emporiumplus.com/store.mvc
          Online Documentation http://www.emporiumplus.com/tk3/v3/doc.htm
          Question http://www.emporiumplus.com/mivamodu...vc?Screen=SPTS
          Facebook http://www.facebook.com/EmporiumPlus
          Twitter http://twitter.com/emporiumplus

          Comment


            #6
            Re: variable for total price, including the attribute cost?

            Originally posted by Soul-flower View Post
            &mvt:product:formatted_price;
            This actually correct but you need to have it inside a span that says price-value (matching what you have in the element id of the attribute machine tab)

            Actually I need to add to this...I read your post real fast and assumed this is what you were trying to do so this may not be an option for you

            If you use inventory variants and Variant Price is set by the Inventory Product this will work


            Last edited by Mark Hood; 05-22-12, 12:50 PM.
            Mark Hood
            Vermont Gear

            Comment


              #7
              Re: variable for total price, including the attribute cost?

              Let's reopen this topic ...

              Since the release of 9.4, the template code has been rewritten and the variables that can be replaced using the toolkit function bask_getsum to combine the attribute and price are no longer in the template. it's all rewritten for a group array ... the good news is that the volume pricing (built in) is part of this display to show you the subtotal after savings with "&mvt:group:formatted_subtotal;" I basically need the same type of token to give me an attribute + base price total ...

              The toolkit function bask_getsum was my hope for this, but with the way the template code has been changed to a "group" array, replacing the said variables with the bask_getsum variables is no longer an option, thus no way that I can see to make this happen.

              When I revert my template to the version before the "strike though/volume pricing savings" I can use the bask_getsum to replace the variables suggested by the toolkit and it works fine ... but those "item:formatted_price" variables are replaced by
              "group:formatted_price" with the 9.4 template updates.

              This is on the BASK page for now ...

              Thoughts? Thanks!
              Jason Lindsey
              Dreamchaser Design
              www.dreamchaserdesign.com
              "You Dream. We Design."

              Comment


                #8
                Re: variable for total price, including the attribute cost?

                I'll talk to development and see if this is something we want to add, but it can be done now using some template code. You need to add up the sum of all the attributes, then add it to the product price to get the total with attributes.

                Here is some sample code. On BASK (and other checkout screens):

                Replace
                Code:
                <td class="item-total">
                	<mvt:if expr="l.settings:group:subtotal_base_price NE l.settings:group:subtotal">
                		<span style="text-decoration: line-through;">&mvt:group:formatted_subtotal_base_price;</span>
                	</mvt:if>
                	&mvt:group:formatted_subtotal;
                </td>

                with
                Code:
                <td class="item-total">
                	<mvt:if expr="l.settings:group:subtotal_base_price NE l.settings:group:subtotal">
                		<span style="text-decoration: line-through;">&mvt:group:formatted_subtotal_base_price;</span>
                	</mvt:if>
                
                
                	<mvt:comment>Reset Values</mvt:comment>
                	<mvt:assign name="l.settings:combined_formatted_subtotal" value="''" />
                	<mvt:assign name="l.settings:attribute_total" value="''" />
                
                
                	<mvt:foreach iterator="option" array="group:options">
                		<mvt:assign name="l.settings:attribute_total" value="l.settings:attribute_total + l.settings:option:subtotal" />
                	</mvt:foreach>
                
                
                	<mvt:assign name="l.settings:price_with_attributes" value="l.settings:attribute_total + l.settings:group:subtotal" />
                	<mvt:do name="l.settings:group:combined_formatted_subtotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:price_with_attributes )" />
                	&mvt:group:combined_formatted_subtotal;
                </td>
                You can then hide the attribute prices from showing by removing them or hiding them form the template.
                Brennan Heyde
                VP Product
                Miva, Inc.
                [email protected]
                https://www.miva.com

                Comment


                  #9
                  Re: variable for total price, including the attribute cost?

                  This works great, thanks! One more wrinkle ... can I target this to run if only a certain attribute is selected? I've gotten it to work like you mentioned above and it adds every "extra" charge into the product total for each line item (GREAT) ...

                  I tried to put it in the options loop and targeted a specific attribute code, but then the "total" is placed as the attribute charge leaving the line item still at the base price:

                  Example:

                  ITEM A -- 50.00
                  GOLD .... 75.00 (whereas the gold attribute charge is an additional 20)

                  Make sense?
                  Jason Lindsey
                  Dreamchaser Design
                  www.dreamchaserdesign.com
                  "You Dream. We Design."

                  Comment


                    #10
                    Re: variable for total price, including the attribute cost?

                    Not sure I follow, do you have a product I can look at to help illustrate it?
                    Brennan Heyde
                    VP Product
                    Miva, Inc.
                    [email protected]
                    https://www.miva.com

                    Comment


                      #11
                      Re: variable for total price, including the attribute cost?

                      Let me try to explain better. I can't leave it running because it messes up all the math in cart.

                      Using the replacement code like you've provided adds all the "non-base price" charges (attributes, volume pricing) and gives me the actual cost of the product. This is great and works like I expected it to. It runs on every single item in the cart and rather than showing:

                      ITEM A - 5.00
                      - Silver Option +2.00

                      It shows like this:

                      ITEM A - 7.00
                      - Sliver Option

                      GREAT! ... and I've hidden the attribute charges, etc. so it make sense.

                      Now, we'd like for this to run ONLY when a certain attribute is selected:

                      ITEM A - 5.00
                      - Silver Option + 2.00

                      ITEM B - 10.00
                      - Gold Option *
                      *In this case, let's say the item is $5 with a $5 additional cost for gold, bringing the total to $10.

                      We want it to TOTAL on the Gold options, but not the Silver options, for example.

                      I tried to put it this type of IF/THEN in the options loop and target a specific attribute code, but doing so places the TOTAL as the attribute charge leaving the line item still at the base price:

                      Example:

                      ITEM B -- 5.00
                      GOLD .... 10.00 (whereas the gold attribute charge is actually only an additional 5)

                      It should make ITEM B $10 ... and I want to hide the price on the attribute.

                      The total in the cart is still correct ... $10.00

                      Does this make more sense?
                      Jason Lindsey
                      Dreamchaser Design
                      www.dreamchaserdesign.com
                      "You Dream. We Design."

                      Comment


                        #12
                        Re: variable for total price, including the attribute cost?

                        Bump.
                        Jason Lindsey
                        Dreamchaser Design
                        www.dreamchaserdesign.com
                        "You Dream. We Design."

                        Comment


                          #13
                          Re: variable for total price, including the attribute cost?

                          I'm sure what you're trying to do is possible but it is going to take more logic in the attribute template to get what you're looking for. You're probably best off contacting our solutions department and see if can have one of our developer dig into it.
                          Brennan Heyde
                          VP Product
                          Miva, Inc.
                          [email protected]
                          https://www.miva.com

                          Comment


                            #14
                            Re: variable for total price, including the attribute cost?

                            Originally posted by Brennan View Post
                            I'll talk to development and see if this is something we want to add, but it can be done now using some template code. You need to add up the sum of all the attributes, then add it to the product price to get the total with attributes.

                            Here is some sample code. On BASK (and other checkout screens):

                            Replace
                            Code:
                            <td class="item-total">
                            	<mvt:if expr="l.settings:group:subtotal_base_price NE l.settings:group:subtotal">
                            		<span style="text-decoration: line-through;">&mvt:group:formatted_subtotal_base_price;</span>
                            	</mvt:if>
                            	&mvt:group:formatted_subtotal;
                            </td>

                            with
                            Code:
                            <td class="item-total">
                            	<mvt:if expr="l.settings:group:subtotal_base_price NE l.settings:group:subtotal">
                            		<span style="text-decoration: line-through;">&mvt:group:formatted_subtotal_base_price;</span>
                            	</mvt:if>
                            
                            
                            	<mvt:comment>Reset Values</mvt:comment>
                            	<mvt:assign name="l.settings:combined_formatted_subtotal" value="''" />
                            	<mvt:assign name="l.settings:attribute_total" value="''" />
                            
                            
                            	<mvt:foreach iterator="option" array="group:options">
                            		<mvt:assign name="l.settings:attribute_total" value="l.settings:attribute_total + l.settings:option:subtotal" />
                            	</mvt:foreach>
                            
                            
                            	<mvt:assign name="l.settings:price_with_attributes" value="l.settings:attribute_total + l.settings:group:subtotal" />
                            	<mvt:do name="l.settings:group:combined_formatted_subtotal" file="g.Module_Root $ g.Store:currncy_mod:module" value="CurrencyModule_AddFormatting( g.Store:currncy_mod, l.settings:price_with_attributes )" />
                            	&mvt:group:combined_formatted_subtotal;
                            </td>
                            You can then hide the attribute prices from showing by removing them or hiding them form the template.
                            What about the INVC Page, Mini Basket, Customer and Merchant Emails?
                            Last edited by Viscott; 12-02-15, 12:45 PM.
                            Jon

                            Viscott Limited
                            www.viscott.com

                            Comment

                            Working...
                            X