Announcement

Collapse
No announcement yet.

Easily Determine if Customer is Part of Business Account?

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

    Easily Determine if Customer is Part of Business Account?

    So, I've run into a little problem using Business Accounts, and hoping there is a really easy fix for this.

    Is there a conditional similar to detecting whether a customer is in a price or availability group, that allows you to detect if that customer is part of a business account group? I know it must be in there somewhere, since those price group discounts pass through to those customers who are assigned to the business account (and who are not already part of that price group), but I cannot find the correct expression. It's not a huge deal if there isn't a way; I will simply have to assign those customers to the same price group to further segregate them from other customers, but it would be nice if I could just detect if they're part of that umbrella business account group instead.

    Thanks for any ideas!

    #2
    Not positive, but I checked a site we work on using our Inspector module (finds miva variables) and I don't see any variable that represents a "business account" associated with a customer account. My guess is that this is ONLY something that exists in the admin.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Interesting. I wonder how the engine knows what price group discounts to apply without assigning some kind of variable to the customer (that isn't price group, since those customers do not seem to throw price group variables when they are only part of a business account). I think for now I am just stuck assigning those customers to the price group itself so we can identify them throughout the site.

      Thank you for the reply, Bruce!

      Comment


        #4
        I had not choice but to find this info.
        I found it by luck more than anything. I have no guarantees. But basically this is what I found:

        Code:
        <mvt:if expr="g.basket:cust_id">
        <mvt:do file="g.Module_Feature_CUS_DB" name="l.success" value="Customer_Load_ID(g.basket:cust_id, l.cust_obj_data)" />
        <mvt:do file="g.Module_Feature_CUS_DB" name="l.result_account" value="CustomerAndBusinessAccount_Load_CustomerID( g.basket:cust_id, l.cust_obj_data, l.settings:business_account)" />
        &mvt:business_account:title;
        </mvt:if>
        First it gets the entire customer object and then passes that and the customer ID to the CustomerAndBusinessAccount_Load_CustomerID.

        The "CustomerAndBusinessAccount_Load_CustomerID" API is not listed here https://docs.miva.com/api-functions (unless I'm totally blind) Can this API please be added to the API functions page? Brennan


        Colin Puttick
        Miva Web Developer @ Glendale Designs

        Comment


          #5
          this works as of June 2024

          <mvt:comment>
          Check if customer is assinged to a business account
          </mvt:comment>
          <mvt:if expr="g.customer:account_id">
          <mvt:comment> Load business account information </mvt:comment>
          <mvt:do file="g.Module_Feature_CUS_DB" name="l.business_count" value="BusinessAccount_Load(g.customer:account_id, l.settings:businessaccount)" />
          <mvt:if expr="l.business_count GT 0">
          <mvt:if expr="l.settings:businessaccount:title EQ 'NY Tax Exempt'">YOUR MESSAGE
          <mvt:else> ELSE SOME OTHER MESSAGE
          </mvt:if>
          </mvt:if>
          </mvt:if>
          James Byrne, (USMC Vet.)
          After Dark Grafx
          "We Work After Dark So You Don't Have To!"
          E-Commerce - Design - Hosting - Printing
          Miva Standard Partner. Get up and running fast!
          http://www.afterdarkgrafx.com :: sales [ at ] afterdarkgrafx.com

          Comment


            #6
            Bravo. Since the API docs are gone, these types of nuggets are going to be even more golden.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              Bruce - PhosphorMedia Everything that was shown on the old Miva API functions page list can be found in the LSK, it is just a matter of understanding how to find them.

              I also have a snippet repository that might be helpful: https://snippets.cacher.io/user/MivaLearn

              The one that afterdark is located there: https://snippets.cacher.io/snippet/b3188a3c43e4aec7b445
              Nicholas Adkins
              Technical Training Specialist / Miva, Inc.
              [email protected]
              https://www.miva.com/mivalearn

              Comment


                #8
                thanks Nick I bookmarked the MivaLearn page
                James Byrne, (USMC Vet.)
                After Dark Grafx
                "We Work After Dark So You Don't Have To!"
                E-Commerce - Design - Hosting - Printing
                Miva Standard Partner. Get up and running fast!
                http://www.afterdarkgrafx.com :: sales [ at ] afterdarkgrafx.com

                Comment


                  #9
                  Originally posted by Nick View Post
                  Bruce - PhosphorMedia Everything that was shown on the old Miva API functions page list can be found in the LSK, it is just a matter of understanding how to find them.

                  I also have a snippet repository that might be helpful: https://snippets.cacher.io/user/MivaLearn

                  The one that afterdark is located there: https://snippets.cacher.io/snippet/b3188a3c43e4aec7b445
                  Thanks Nick, that's helpful but it still would be nice to have the ole API list. Much faster than culling through the LSK.
                  Bruce Golub
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment

                  Working...
                  X