VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: ercankoc on August 16, 2012, 02:00:18 AM

Title: Products Price Problem
Post by: ercankoc on August 16, 2012, 02:00:18 AM
Hi (:

I want only the members to see the price of the products and don't want guests to see any prices. Settings in the pricing section are as seen below and still guests can see the prices.

Thanks for your help..


(http://www.globalithalat.com.tr/problems.jpg)


Joomla; 2.5.6
Virtuemart; 2.0.8e
Title: Re: Products Price Problem
Post by: John2400 on August 23, 2012, 10:12:14 AM
you could clone all your products -

then set  prices for guest products to $.00-

They see the The words "call for price"- but only registered guest could purchase? infact you could change the call for price option to another word setting in language. OR just leave it as it is quite good and change the availability words to say - only registered users can purchase.  Call us or sign up.



Title: Re: Products Price Problem
Post by: ivus on August 23, 2012, 12:34:55 PM
Hi ercankoc,

I could be wrong, but I haven't seen this feature in VM... but as I said, I could be wrong.

I hope you know how to code and edit templates?

One solution that would work 100% of the time is to wrap all your code that you don't want guests to see with the following code snippet:



if ( ! $user->get('guest')) {

CODE SNIPPET TO HIDE FROM PRYING EYES HERE

}



Be sure to define to USER object once on every page you want to use it on.



$user =& JFactory::getUser();



Good luck ;D
Title: Re: Products Price Problem
Post by: John2400 on August 27, 2012, 11:18:24 AM
saw this maybe?
http://forum.virtuemart.net/index.php?topic=106642.msg356716#msg356716
Title: Re: Products Price Problem
Post by: Optimalu on April 01, 2013, 02:04:25 AM
Hi I am using latest joomla and virtuemart. I am trying to get the code to work from Ivus, but I need some more directions.

I have the adjusted the default.php to following

code:
<?php
                  if ( ! $user->get('guest')) {
                  // Add the button
                  $button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
                  $button_cls = 'addtocart-button'; //$button_cls = 'addtocart_button';
                  $button_name = 'addtocart'; //$button_cls = 'addtocart_button';


                  // Display the add to cart button
                  $user =& JFactory::getUser();
                  $stockhandle = VmConfig::get('stockhandle','none');
                  if(($stockhandle=='disableit' or $stockhandle=='disableadd') and ($this->product->product_in_stock - $this->product->product_ordered)<1){
                     $button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY');
                     $button_cls = 'notify-button';
                     $button_name = 'notifycustomer';
                  }
                  vmdebug('$stockhandle '.$stockhandle.' and stock '.$this->product->product_in_stock.' ordered '.$this->product->product_ordered);
                  }?>
                       
                        <span class="addtocart-button">
                     <input type="submit" name="<?php echo $button_name ?>"  class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
                  </span>


but this is giving an error message, maybe that has to do with the fact that I am not doing anything with the define user object. But I really don't know where to do that. Some help please or maybe some more eloborate explanation? Thank a lot in advance