0

I have set different user groups on my store. If you are regular account or logged out you see regular prices. For special clients there are special prices set (user group prices, not special price). But when I also set special price to product, then it automatically overwrites the user group price and dont show 'special price' tag in front of it. If it is bigger than user group price then it does'nt do anything (and that is how I want it to be).

I need it to display 'special price' in front of the user group price if special price is even lower than user group price. For that I need to call that price out in my template that I set in admin panel as 'special price'. But I cant seem to find the right callout for that. getSpecialPrice() or specialPrice() just return 0.

Im using the base->default->catalog->product->price.phtml as the template.

              <!-- Get group Id -->
          <?php $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId(); ?>
         <!-- Get customer Group name -->
          <?php $group = Mage::getModel('customer/group')->load($groupId); ?>
      <?php if($group->getCode() == "Hulgiklient"): ?>
          <!-- kuva special price regu price all, kui hulgiklient -->
          <div class="price-box">
              <!-- <span class="price-label"><?php echo $this->__('Regular Price:') ?></span> -->
              <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                  <?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
              </span>
          </div>
      <?php else: ?>
          <p class="old-price">
              <span class="price-label"><?php echo $this->__('Regular Price:') ?></span>
              <span class="price" id="old-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                  <?php echo $_coreHelper->formatPrice($_regularPrice, false) ?>
              </span>
          </p>
      <?php endif; ?>


          <?php if ($_taxHelper->displayBothPrices()): ?>
            <p class="special-price">
                <span class="price-label"><?php echo $_specialPriceStoreLabel ?></span>
                <span class="price-excluding-tax">
                    <span class="label"><?php echo $this->helper('tax')->__('Excl. Tax:') ?></span>
                    <span class="price"
                          id="price-excluding-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                        <?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
                    </span>
                </span>
                <span class="price-including-tax">
                    <span class="label"><?php echo $this->helper('tax')->__('Incl. Tax:') ?></span>
                    <span class="price"
                          id="price-including-tax-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                        <?php echo $_coreHelper->formatPrice($_finalPriceInclTax, false) ?>
                    </span>
                </span>
            </p>
        <?php else: ?>

              <!-- Get group Id -->
              <?php $groupId = Mage::getSingleton('customer/session')->getCustomerGroupId(); ?>
             <!-- Get customer Group name -->
              <?php $group = Mage::getModel('customer/group')->load($groupId); ?>
        <?php if($group->getCode() == "Hulgiklient"): ?>
              <!-- kuva special price regu price all, kui hulgiklient -->
              <!-- <p class="special-price">
                  <span class="price-label"><?php echo $_specialPriceStoreLabel ?></span>
              <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
              <?php  echo $_coreHelper->formatPrice($_finalPrice, false) ?>
              </span>
              </p> -->
        <?php else: ?>
              <p class="special-price">
                  <span class="price-label"><?php echo $_specialPriceStoreLabel ?></span>
              <span class="price" id="product-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
                  <?php echo $_coreHelper->formatPrice($_finalPrice, false) ?>
              </span>
              </p>
        <?php endif; ?>
  • I think this is the default way of working of Magento price. If it is not working like in your case, then that means some extensions customized magento's default price showing behaviour – Rajeev K Tomy Feb 2 '17 at 12:59
  • @RajeevKTomy It is working like I described it, I just cant call out specialPrice(). regularPrice() and finalPrice() are working fine. I need the special price to compare it with final price, so it can decide whether to put 'special price' tag in front of it or no. – raulicious Feb 2 '17 at 13:22
  • what type of products that your site holds ? – Rajeev K Tomy Feb 2 '17 at 13:25
  • @RajeevKTomy simple products – raulicious Feb 2 '17 at 13:27
  • how you are calling that functions. could you please add that to the question ? – Rajeev K Tomy Feb 2 '17 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.