VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: chimairax on October 23, 2017, 11:31:46 AM

Title: Virtuemart 3 - Show a custom message at product details page
Post by: chimairax on October 23, 2017, 11:31:46 AM
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
Title: Re: Virtuemart 3 - Show a custom message at product details page
Post by: Jörgen on October 23, 2017, 13:11:17 PM
Hello and welcome to the forum.
Please read this first:
http://forum.virtuemart.net/index.php?topic=79799.0 (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
Title: Re: Virtuemart 3 - Show a custom message at product details page
Post by: chimairax on October 23, 2017, 13:21:06 PM
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)
Title: Re: Virtuemart 3 - Show a custom message at product details page
Post by: chimairax on October 23, 2017, 15:59:46 PM
To make it easier, how is it possible to get the calc description in product details page?
Title: Re: Virtuemart 3 - Show a custom message at product details page
Post by: Studio 42 on October 23, 2017, 17:17:38 PM
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