Announcement

Collapse
No announcement yet.

How can I hide product prices from people who are not assigned to a price group?

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

    How can I hide product prices from people who are not assigned to a price group?

    Hi,

    We need to hide product prices and possibly other product data such as stock dates etc. from people who view our site that aren't already registered on our site and assigned to 1 of 3 price groups I created called "wholesale1", "wholesale2" and "wholesale3"
    .
    Product prices on our site are only intended for viewing by approved wholesale customers who register on our site and we then manually add them to one of those 3 price groups.
    Basically either a customer is assigned to one of those 3 price groups and can then see prices, or they are not assigned and see no prices is the desired effect we want.

    I know there are simple scripts for hiding prices etc. in Miva from non registered customers.
    Does anyone know an example script to do this in Miva 9?

    *I have done it before in Miva 5.5. using a script similar to this one below (*but I think this script might need some editing to work in Miva 9):

    <mvt:if expr="g.wholesale_customer">
    &mvt:product:formatted_price;
    <mvt:else>
    *You need to have a pre-approved account to see pricing.<br>
    <a href="/wholesale.html" target="_self">CLICK HERE</a> to apply for an account with us.
    </mvt:if>

    Any help with this would be greatly appreciated.
    Last edited by rcm1234; 03-23-17, 12:36 AM. Reason: price groups,hide prices,hide script

    #2
    That code snippet looks OK, but the variable g.wholesale_customer is not a standard part of the store. Probably that version-5 store had a 3rd-party module that was generating that variable. The Store Morph language has advanced to the point where I think you can do all this with template code, by using mvt:do tags to call functions in the store that will let you determine what price groups a customer is assigned to.

    HTH --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      For anyone who's interested, I was able to resolve this problem by using the following script.

      <mvt:if expr="g.customer:pgrpcount GT 0">
      &mvt:product:formatted_price;
      <mvt:else>
      *You need to have a pre-approved account to see pricing.<br>
      CLICK HERE to apply for an account with us.
      </mvt:if>

      This works perfectly... only people assigned to one of my 3 price groups can view product prices.

      Comment


        #4
        The only problem with this is that it won't work if you use any of the Marketing Price group features for things like discounts, coupons etc, since its valid for ANY price group, but yea, it might work for you.
        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