News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart 3 - Show a custom message at product details page

Started by chimairax, October 23, 2017, 11:31:46 AM

Previous topic - Next topic

chimairax

Hello community,

I follow this community a long time now but it is the first time I wanted to ask something.

I want to show to my customers a custom message at the product details page, which message will change depending on the shopping group and the product's category.

For example:
The T-Shirts category on my web site is tax free for some of my customers.
If my customer belongs to the shopper group "Tax Free" [id=2] then when he is browsing on a t-shirt then a message will appear to him "The T-Shirt's price is tax free".

So I want to add a custom code for this to productdetails.php.

I am waiting for your ideas
Thanks in advance

VirtueMart 3.2.4
Joomla 3.6.5
PHP Version 5.4.45
Joomla 3.8.13
Virtuemart 3.4.2

Jörgen

Hello and welcome to the forum.
Please read this first:
http://forum.virtuemart.net/index.php?topic=79799.0

Display the content of $this->user and see if you can find the Array of shopper groups.

regards

Jörgen @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

chimairax

I'm sorry, I just edited my first post.

I need to call the desired shopper group and the desired product category in order my message to be displayed.
I want the "Tax Free" message to be displayed in a big number of customers. Also these customers are being transfered automatically to the tax free shopper group during their registeration.

Something like:

<?php if ($this->product->virtuemart_category_id) {
$category_id =  [category_id_goes_here]'); ?>

}
<?php if ($this->shoppergroup_id) {
                
$shoppergroup_id = [shoppergroup_id_goes_here]?>
}
<?php echo JText::_('The T-Shirt's price is tax free'); ?>


(This code has errors, I wanted to show just an example)
Joomla 3.8.13
Virtuemart 3.4.2

chimairax

To make it easier, how is it possible to get the calc description in product details page?
Joomla 3.8.13
Virtuemart 3.4.2

Studio 42

You can compare the prices with and without tax and show message if this are same.
No need to check shopper groups or more for your case