VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product creation => Topic started by: 2cool on March 11, 2019, 20:27:34 PM

Title: downloadable product file for registered users
Post by: 2cool on March 11, 2019, 20:27:34 PM
Hi,
Is is possible to create a downloadable file on product detail page for registered users.
Can this be done with basic special field option and choose shoppergroup?
And how can I add a .step file, did add extention and mime but still not working...

Joomla! 3.9.3 + VirtueMart 3.4.2

Thanks and regards,
Pas
Title: Re: downloadable product file for registered users
Post by: GJC Web Design on March 11, 2019, 22:58:15 PM
custom text field with the url -- display as url and hide if not registered by std. Joomla user snippet

$user = JFactory::getUser();
$userid = $user->get('id');
if($userid > 0{
// show the custom field
}

Title: Re: downloadable product file for registered users
Post by: 2cool on March 12, 2019, 21:56:52 PM
Thanks,

Should I create a new special field (textarea) ?
Sorry not clear how to set this up...

Regards,
Pas
Title: Re: downloadable product file for registered users
Post by: GJC Web Design on March 12, 2019, 22:46:53 PM
normal custom text field .. render it out in the templates as a url
Title: Re: downloadable product file for registered users
Post by: Studio 42 on March 12, 2019, 23:42:37 PM
You cna use my customfield shortcodes See https://shop.st42.fr/en/products/shortcodes.htm
You have an option to render each customfields per shopper group(s)
See https://shop.st42.fr/en/shorcodes-english-doc#url
You can set an icon and many other options.
Note that the plugin provide 18 type of fields currently.
Title: Re: downloadable product file for registered users
Post by: 2cool on April 02, 2019, 12:32:47 PM
Sorry for my late response..

I create a custom field but can't choose 'Custom Group' ? This should be set to registered.
Would be nice to have this option to 'add' a downloadable file to some of our products,
and only show this for registered uses (group).

Maybe I did choose a wrong field?

Attached my setup.

Thanks,
Pas
Title: Re: downloadable product file for registered users
Post by: Jörgen on April 02, 2019, 12:48:26 PM
You can group a number of custom fields together if You like, and they can be placed together in a product layout.

Has nothing to do with user VM or Joomla groups.

Jörgen @ Kreativ Fotografi
Title: Re: downloadable product file for registered users
Post by: 2cool on April 02, 2019, 13:23:00 PM
Hi Jörgen,

Sorry but it's still not clear to me ;(
How can I add a custom field which I can use for some products and is visible for registered user only?
Where can I set the usergroup for this? Could you explain this or is there any info available.

Regards,
Pas
Title: Re: downloadable product file for registered users
Post by: Jörgen on April 02, 2019, 14:01:30 PM
Quote from: GJC Web Design on March 11, 2019, 22:58:15 PM
custom text field with the url -- display as url and hide if not registered by std. Joomla user snippet

$user = JFactory::getUser();
$userid = $user->get('id');
if($userid > 0{
// show the custom field
}



There is no core function at user level ready for this.

Jörgen @ Kreativ Fotografi
Title: Re: downloadable product file for registered users
Post by: 2cool on April 02, 2019, 15:07:25 PM
Where should this be set?
Could you add a simple screen where this is added...
I have 300+ products, should I add every url in each product?

Thanks,
Pas
Title: Re: downloadable product file for registered users
Post by: Jörgen on April 02, 2019, 15:17:57 PM
No this is probably to be done in the productdetails or maybe categories override:

/templates/your template/html/com_virtuemart/productdetails/default.php (https://forum.virtuemart.net/templates/your%20template/html/com_virtuemart/productdetails/default.php)

Jörgen @ Kreativ Fotografi
Title: Re: downloadable product file for registered users
Post by: 2cool on April 02, 2019, 16:14:10 PM
Thanks Jörgen,

But it's totally unclear to me if this can be used as a custom field in vm products.
It should be usable for any product with any file attached.

Hope anyone can explain how this can be done or if some plugin has this options.

Thanks,
Pas