Announcement

Collapse
No announcement yet.

Return which Price Groups are assigned to a logged in customer

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

    Return which Price Groups are assigned to a logged in customer

    Not sure how to view variables for a customer regarding which specific Price Groups may or may not be assigned to that logged in customer. I see there is a global var [g.customer:pgrpcount] that returns the number of Price Groups attached to a customer but nothing on the Price Group's ID.

    Is there a way to call this info based on the logged in customer?
    Benjamin Smith - Developer
    www.midwestgunworks.com

    #2
    Originally posted by MGWben View Post
    Not sure how to view variables for a customer regarding which specific Price Groups may or may not be assigned to that logged in customer. I see there is a global var [g.customer:pgrpcount] that returns the number of Price Groups attached to a customer but nothing on the Price Group's ID.

    Is there a way to call this info based on the logged in customer?
    Here is a link to a snippet that will get you the information needed.

    https://snippets.cacher.io/snippet/5bbdcccc1a67269615d7

    This snippet is checking if there is a logged in customer then using the PriceGroupAndModuleList_Load_Customer function pulling all the price groups that the customer is assigned and adding it to the g.PriceGroups array. Then if there are price groups assigned it loops through the price groups. There is an added conditional in the snippet that checks for specific price groups if that is something you needed.

    Let me know if you have any questions about the snippet.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      Hey Nick thanks for this answer!

      This is exactly what I was looking for! I had been scouring for a solution but never found anything on how to call the price group module like that. Much appreciated.

      Will also keep those snippets in mind over there on CACHER.
      Benjamin Smith - Developer
      www.midwestgunworks.com

      Comment

      Working...
      X