Announcement

Collapse
No announcement yet.

Emporium Toolkit coding question pgroup and pgroup-p

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

    Emporium Toolkit coding question pgroup and pgroup-p

    Looking for some help from the coders out there.

    One thing to note, all new accounts are created manually and are screened. We have locked down the ability to create a user account on the fly.

    What I'm trying to do...

    I'd like for when a user views a miva site without logging in (Public), to see the price on specific items replaced with "call for pricing".

    We can set then set them up with an account tied into specific price groups for specific price breakdowns.

    I was hoping to use the pgroup function and the pgroup-p function from the toolkit to accomplish this.

    To start, I tried to add this code (for testing) to the Product page, to hide the price, but it seems to hide the price for everyone regardless if they are in the TEST Price Group or not.

    Code:
    <mvt:item name="toolkit" param="pgroup|pcount" />
    <mvt:if expr="g.pcount GT 0">
       <mvt:foreach iterator="customer_pgroup" array="customer_pgroups">
           <mvt:if expr="l.settings:customer_pgroup:name NE 'TEST'">
           Please call for Pricing
           <mvt:else>
          <span class="style8">&mvt:sub_product:formatted_price;</span>
          </mvt:if>
      </mvt:foreach>
    </mvt:if>
    Any help would be appreciated, I will try to keep this updated as I experiment. I have no idea how to tie this into the pgroup-p so Items in Price Group Test2 are the only items that would be effected.

    Any suggestions on a different direction would be more then welcome as well.
    Last edited by NorthpointMarketing; 03-09-12, 08:03 AM.

    #2
    Re: Emporium Toolkit coding question pgroup and pgroup-p

    So, I've been working the code but this only works if I only have users assigned to one Price Group. If the user is assigned to more then one price group and the item is assigned to the same group, the information is display multiple times.

    Code:
      <mvt:item name="toolkit" param="pgroup-p|prdcount|g.Product_Code" />
       <mvt:if expr="g.prdcount GT 0">
       <mvt:foreach iterator="product_pgroup" array="product_pgroups">
        <mvt:if expr="l.settings:product_pgroup:name EQ 'TEST'">
         <mvt:item name="toolkit" param="pgroup|pcount" />
         <mvt:if expr="g.pcount GT 0">
          <mvt:foreach iterator="customer_pgroup" array="customer_pgroups">
           <mvt:if expr="l.settings:customer_pgroup:name NE 'TEST'">
            Please call for Pricing
           <mvt:else>
            <b> &mvt:product:formatted_price;</B>
           </mvt:if>
          </mvt:foreach>
         <mvt:else>
          Please call for Pricing
         </mvt:if>
        <mvt:else>
         <i> &mvt:product:formatted_price; </i>
        </mvt:if>
       </mvt:foreach>
      <mvt:else>
       <b><i>&mvt:product:formatted_price;</i></b> 
      </mvt:if>
    Any ideas???

    Comment

    Working...
    X