Hello,

I have two questions.

  1. In VirtueMart, I set that product prices can only be seen by registered users and it works as it should, which you can see in the Main Menu: Sale (VirtueMart Category Lajout). The problem is that JA Megafilter shows product prices to all users (registered and unregistered), although in VirtueMart it is set so that only registered users can see the prices - you can see them in the Main Menu: Webshop.

  1. How do I modify JA Megafilter so that it does not show the “Add to Cart” button in Megafilter Listing Stjle 1, to users who are not registered? I already did that in the VirtueMart Category Layout, but I don't know how to do it in JA Megafilter?

    mbabic Hi

    1/ I will report to our developer for this registered view issue.

    2/ You can edit this file: ROOT/templates/ja_atoms/html/layouts/jamegafilter/virtuemart/default/product-item.php

    Comment or remove this snippet of code:

    <div class="product-item-actions">
    {?is_salable}
    <div class="addtocart-area">
    <form method="post" class="product js-recalculate" action="<?php echo JRoute::_ ('index.php?option=com_virtuemart',false); ?>">
    <div class="addtocart-bar">
    <span class="quantity-box">
    <input class="quantity-input js-recalculate" name="quantity[]" data-errstr="<?php echo JText::_('COM_JAMEGAFILTER_ERROR_CAN_ONLY_BUY'); ?> %s <?php echo JText::_('COM_JAMEGAFILTER_ERROR_CAN_ONLY_BUY_PIECES'); ?>!"
    value="{init}" 
    init="{init}" 
    step="{step}" 
    {maxOrder}
    type="text"
    >
    </span>
    <span class="quantity-controls js-recalculate">
    <input class="quantity-controls quantity-plus" type="button">
    <input class="quantity-controls quantity-minus" type="button">
    </span>
    <span class="addtocart-button">
    <input name="addtocart" class="btn btn-default" value="<?php echo JText::_('COM_JAMEGAFILTER_ADD_TO_CART'); ?>" title="<?php echo JText::_('COM_JAMEGAFILTER_ADD_TO_CART'); ?>" type="submit">             
    </span>             
    <input name="virtuemart_product_id[]" value="{id}" type="hidden">
    <noscript><input type="hidden" name="task" value="add"/></noscript>
    </div> 
    <input type="hidden" name="option" value="com_virtuemart"/>
    <input type="hidden" name="view" value="cart"/>
    <input type="hidden" name="virtuemart_product_id[]" value="{id}"/>
    <input type="hidden" name="pname" value="{name}"/>
    <input type="hidden" name="pid" value="{id}"/>
    </form>
    </div>
    {:else}
    <div class="stock unavailable"><span><?php echo JText::_('COM_JAMEGAFILTER_OUT_STOCK'); ?></span></div>
    <a class="btn btn-default" href="{url}"><?php echo JText::_('COM_JAMEGAFILTER_VIEW_DETAIL'); ?></a>
    {/is_salable}
    </div>

      saguaros Thank you!
      The issue of displaying prices to unregistered users I solved in the following way:
      <?php
      $user = JFactory::getUser();
      if ($user->id != 0) { // User is logged in
      ?>
      <div data-product-id="{id}" data-role="priceBox" class="price-box price-final_price">
      {?basePriceWithTax}<span style="text-decoration: line-through;" class="PricebasePriceWithTax"> {basePriceWithTax|s} </span>{/basePriceWithTax}
      <span class="price-container price-final_price tax weee">
      <span class="price-wrapper " data-price-type="finalPrice" data-price-amount="{price}" id="product-price-{id}">
      <span class="price">{frontend_price|s}</span>
      </span>
      </span>
      </div>
      <?php
      }
      ?>

      I hid the 'Add to Cart' button for unregistered users in the same manner.

      Write a Reply...
      You need to Login to view replies.