Announcement

Collapse
No announcement yet.

Show Message When Specific Attribute is Chosen

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

    Show Message When Specific Attribute is Chosen

    On the PROD page we have some custom coding that checks to see if the logged in user is in a specific availability group and if they are looking at a couple of specific product categories.

    <mvt:comment>Load Availability Group by Name</mvt:comment>
    <mvt:do file="g.Module_Feature_AGR_DB" name="l.success" value="AvailabilityGroup_Load_Name('Dealers', g.availabilitygroup)" />

    <mvt:comment>Check if customer is assigned to the group</mvt:comment>
    <mvt:do file="g.Module_Feature_AGR_DB" name="l.success" value="AvailGroupXCustomer_Load(g.availabilitygrou p:id, g.basket:cust_id, l.settings:availgroupxcustomer)" />

    <mvt:comment>Customer is in the availability group and the category is EQ to one of these 2 product categories</mvt:comment>
    <mvt:if expr="NOT ISNULL l.settings:availgroupxcustomer:agrp_id AND g.category_code EQ 'Clips' OR g.category_code EQ 'StandardClips'">
    Note: Special Finishes are not available at wholesale pricing.<br>
    Please contact Casey with any questions about ordering.
    <mvt:else>
    </mvt:if>

    When the criteria is met, it looks like this:
    Screen Shot 2023-08-17 at 1.33.53 PM.png

    If the criteria is not met, then nothing is displayed.

    What I really want to do is add one more check so that this message only shows up if the above criteria is all met, but ALSO check the FinishTypeTEST dropdown field and only show this message when SPECIAL is chosen from the drop down menu. The message doesn't apply when STANDARD (the default) is selected.

    What field would you use to add a check for the FinishTypeTEST attribute being EQ to SPECIAL?
    Thank you!
    Mark
    Attached Files

    #2
    assuming those Finish types are attributes, you are going to have to use JS or jQuery to display/augment the message. Once the page is loaded. miva logic is no longer available.

    something like


    if($( "#attribute_id option:selected" ).val()=='custom'){

    $("#message_box").append('<p>you cannot have custom finishes with wholesale</p>);

    }

    where message_box is the id of the area that contains the original messaging.
    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
      Ok, thank you Bruce!

      Comment


        #4
        I think you can also modify the attribute template so that it doesn't display the Special option when the customer and category conditions are met. If there's only one other option, you can suppress the menu completely. Customers don't like clicking a button and being told, "you can't do that." They'll have a better experience if you adjust the page so that the prohibited option isn't offered at all.
        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

        Working...
        X