News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Show all avaible shopper group prices for specific group only

Started by MekkE, March 09, 2014, 18:33:58 PM

Previous topic - Next topic

MekkE

Hi,

I use multiple price to usergroups:
1. for everyone (anonymous and "simple" registered users)
2. just for "VIP" users

I would like to show multiple prices to VIP members. So they see the VIP and the "for everyone" prices too.

I found this modification on daycounts.com (ty for this), its almost made my task but it show xy group price to everyone.
I need some modification: show xy group price to VIP members (xyz group) only.

Can you help me please?


<?php
/*****************************************/
/* DAYCOUNTS : Show Member price : BEGIN */


$loadForShopperGroupId 8//This is the id of the shopper group prices to display
$productModel VmModel::getModel('product');
$shoppergroupsprices $productModel->loadProductPrices($this->product->virtuemart_product_id,$quantity,array($loadForShopperGroupId),true);
foreach (
$shoppergroupsprices as $sgPrice) {
    if (
$sgPrice['virtuemart_shoppergroup_id'] == $loadForShopperGroupId) {
        
$clubprice $sgPrice['product_price'];
        if (
$sgPrice['override']==1) {
            
$clubprice $sgPrice['product_override_price'];
        } else if (
$sgPrice['override']==-1) {
            
//get VatTax
            
$total_vat_tax 0;
            foreach (
$this->product->prices['VatTax'] as $vat_tax) {
                
$total_vat_tax $total_vat_tax $vat_tax[1];
            }
            
$total_vat_tax + ($total_vat_tax 100);
            
$clubprice $sgPrice['product_override_price'] * $total_vat_tax;
        }
        echo 
'Member price: '$this->currency->priceDisplay($clubprice,0,1,false,2,'Member price' );
    }
}
/* DAYCOUNTS : Show Member price : END */
/***************************************/
?>

Mathalis

Hello,

Not sure to undestand yOur needed.

So try to create a price with a dedicated group for each.
On virtuemart user, set groups you want they see.

Hope this help u.

Hugues

MekkE

Hi,

Thank you, but you don't understand me :)

" create a price with a dedicated group for each. On virtuemart user, set groups you want they see."

I want to show multiple group prices to specific ("VIP") group members, please check the copied code:)