Author Topic: Showing default-group's price (street price) for special shopper group  (Read 4343 times)

Ihvar

  • Beginner
  • *
  • Posts: 5
I have different shopper groups with different discounts:
-Default- and -Gold users-(with 10% discount), etc
I need that gold users could see prices from Default group.
For example:

Playing cards

Price for members: 9$
Price for guests: 10$  

Can anyone help me?

My engines are - Joomla 1.5.21 and Virtuemart 1.1.5

Ihvar

  • Beginner
  • *
  • Posts: 5
Re: Showing default-group's price (street price) for special shopper group
« Reply #1 on: November 04, 2010, 16:18:38 pm »
I've done it!  :)
Look at 2 files:

1)administrator/components/com_virtuemart/classes/ps_product.php
2)components/com_virtuemart/themes/default/templates/common/price.tpl.php


The changes in (1)

if (isset($price_info["product_price_id"])) {
            if( $base_price_info["product_price"]== $price_info["product_price"] ) {
               $price = $base_price = $GLOBALS['CURRENCY']->convert( $base_price_info["product_price"], $price_info['product_currency'] );
               $default_price = $GLOBALS['CURRENCY']->convert( 100*$base_price_info["product_price"]/(100- $auth["shopper_group_discount"]), $price_info['product_currency'] );
            } else {
               $base_price = $GLOBALS['CURRENCY']->convert( $base_price_info["product_price"], $price_info['product_currency'] );
               $default_price = $GLOBALS['CURRENCY']->convert( 100*$base_price_info["product_price"]/(100- $auth["shopper_group_discount"]), $price_info['product_currency'] );
               $price = $GLOBALS['CURRENCY']->convert( $price_info["product_price"], $price_info['product_currency'] );   
            }


The changes in (2)

<?php
if( !empty( $price_info["product_price_id"] )) { ?>
   <span class="productPrice">
      <?php echo $CURRENCY_DISPLAY->getFullValue($base_price) ?>
      <?php echo $text_including_tax ?>
   </span>
   //My own css class
   <span class="productDFPrice">
      <?php
      if ($default_price != $base_price)
      {
      echo "For common users:<br />".$CURRENCY_DISPLAY->getFullValue($default_price);
      }
      ?></span>

<?php

TwiFlash

  • Beginner
  • *
  • Posts: 1
Re: Showing default-group's price (street price) for special shopper group
« Reply #2 on: December 18, 2010, 05:50:26 am »
hi,Ihvar
Thanks for sharing.
I have try the solution.
But I get the $default_price $0.00.
May I know the changes in (1) is in which line?

cjmicro

  • Beginner
  • *
  • Posts: 47
Re: Showing default-group's price (street price) for special shopper group
« Reply #3 on: January 06, 2011, 00:12:18 am »
I also tried that solution, and while it displays it also showed $0.00 for my base price. Can anyone help? Please!!   :-\

Thank you,
Cheryl

Ihvar

  • Beginner
  • *
  • Posts: 5
Re: Showing default-group's price (street price) for special shopper group
« Reply #4 on: January 10, 2011, 18:31:26 pm »
In attachment there are these 2 files in archives. You can just put them instead of your original files. I hope this helps you.

[attachment cleanup by admin]

miamia

  • Jr. Member
  • **
  • Posts: 82
Re: Showing default-group's price (street price) for special shopper group
« Reply #5 on: January 26, 2011, 10:29:55 am »
hello,

please how should I change this code when my -Gold users- don't have percentage discount but every product has special price?

thank you in advance

Ihvar

  • Beginner
  • *
  • Posts: 5
Re: Showing default-group's price (street price) for special shopper group
« Reply #6 on: February 15, 2011, 09:05:30 am »
You don't even have to use this code. Just leave the code as it is (after setup).  Then set the discount for each type of your product

jurgenv

  • Beginner
  • *
  • Posts: 4
Re: Showing default-group's price (street price) for special shopper group
« Reply #7 on: October 12, 2012, 11:10:06 am »
In attachment there are these 2 files in archives. You can just put them instead of your original files. I hope this helps you.

Tried it too, but I also get 0,00 as a price. Only thing I can think of that might be wrong in your code is $default_price though I'm not sure what to change it too tried $product_price to no success $base_price works fine. Downloaded your files and see I put everything exactly as your files but its still showing 0,00, also tried to use your files but then I get an error with shopproduct_details. I guess it works differently with VM 1.1.9