Joomla: 3.5.1
VM: 3.0.16
PHP: 5.5.33
Hello,
I can see how to add different shopper groups to a product to have different prices for the same item, but I can't figure out how to assign price labels for those groups on the product page front end.
What I would like is one price for a guest shopper and another price for logged in shoppers. As an example, I would like the price label for the guest shopper to say: List Price and the price for the logged in shopper to say Your Price.
It would be nice to have a field for the label in the Shopper Group or on the Product Page (Product Information tab) where you assign different shopper group prices. Am I missing something? If so, how do I do it?
Thank you,
Bill
You can use the shopper Group ID and change the name depending shoppergroup.
Of course this is not in the core, because i think it's very specific.
YOu can get first user shopper group with :
$userModel = VmModel::getModel('user');
$user = $userModel->getCurrentUser();
$groupId = $user->shopper_groups[0];
After you can use this to set Jtext in \components\com_virtuemart\sublayouts\prices.php
$label = 'COM_VIRTUEMART_PRODUCT_BASEPRICE'.$groupId ;
If (jText::_($label) === $label ) $label = jText::_( 'COM_VIRTUEMART_PRODUCT_BASEPRICE');
and in Joomla language overides ini file add a language key for each group needing another name
COM_VIRTUEMART_PRODUCT_BASEPRICE1="price for shopper group 1"
COM_VIRTUEMART_PRODUCT_BASEPRICE4="price for shopper group 4"
Thank you, S42. Now, all I have to do is figure out what you told me. Just out of curiosity, do you know if there are any ad-ons that would make this easier?
Thanks again,
Bill
highly unlikely there is a plugin for such a specific thing
all S42 is saying is his code snippet adds the SG id to the end of the lang constant
SG id = 1? the constant = COM_VIRTUEMART_PRODUCT_BASEPRICE1
SG id = 4? the constant = COM_VIRTUEMART_PRODUCT_BASEPRICE4
add your COM_VIRTUEMART_PRODUCT_BASEPRICE4 etc as new lang over rides in the normal way
Thanks, GJC,
What you and S42 are saying doesn't sound too difficult, but as I said in my original post, it would be nice to have a field for the label in the Shopper Group or on the Product Page (Product Information tab) where you assign different shopper group prices. Maybe some future release will have that ability? In the meantime, I can get by with the way it is. VM 3 is a good product and I'm very happy with it. Kudos to you and everyone else who has worked on it to keep improving it.
Thanks again,
Bill
Hi Bill,
I don't think, that this a feature needed for general shops, some other then want this for product description, category display ...
I can give 100 example of core changes for my needs. But i never have requested it, because my request is specific and can be implemented without core hacks, simply using template overrides.
If you cannot do it, you have some developer in forum that can implement the code explained in some hours .
Regards
Thanks again, S42,
I'm good. I appreciate the information and I appreciate your time.
Bill