Force registration for free products

  • Posts: 52
  • Thank you received: 0
12 years 4 months ago #60723

Hi,

I would like to offer free enticers, but would like people to register before getting the product. Is this possible with Hikashop?

Regards

Ic

Please Log in or Create an account to join the conversation.

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
12 years 4 months ago #60756

Hi,

In the HikaShop configuration, you can set the registration method.
System => configuration => checkout (tab) => Registration.
www.hikashop.com/en/support/documentatio...config.html#checkout

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
12 years 4 months ago #60818

Jerome,

Thanks for the reply.

I have this setting set to "Registration".

Maybe I wast not so clear about my problem initially. I have an online store with products that I want to sell on the internet. I would also like to offer free products (programs) for download and would like the user to download it without going throught the entire checkout process, but before they download it they will need to register on Hikashop.

Is this possible to do?

Regards

IC

Please Log in or Create an account to join the conversation.

  • Posts: 26166
  • Thank you received: 4029
  • MODERATOR
12 years 4 months ago #60869

Hi,

You can attach files to HikaShop product.
A file could be a "free download" or not.
A "free download" does not require to make an order, the link is displayed in the product page.
Otherwise, the customer has to make an order to have a secured download link.

You can use "free download" files but modify the product page (thanks to view editing) in order to require authentication.
If the user is authenticated, the download link would be displayed.
I think it could be a good mix.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 52
  • Thank you received: 0
12 years 4 months ago #61094

Jerome,

Thanks for the answer.

I do not have PHP skill though and also do not know the hikashop architecture. Can you give a few pointers, please.

Regards

IC

Please Log in or Create an account to join the conversation.

  • Posts: 83024
  • Thank you received: 13403
  • MODERATOR
12 years 4 months ago #61149

You would have to edit the file show_block_product_files via the menu Display->Views and add such code at the beginning:
<?php $user =& JFactory::getDBO();
if(user->guest) return; ?>

The following user(s) said Thank You: watashi

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
11 years 5 months ago #114872

Dear Nicolas,

we tried to do what you describe above but unfortunatelly we are still getting pars error. Could you be a little more specific on where and how to add this code:

<?php $user =& JFactory::getDBO();
if(user->guest) return; ?> 

We have the last version of Hikashop and Hikamarket business.

This is the beginning of the file we need to edit:
<?php

/**
 * @package	HikaShop for Joomla!
 * @version	2.2.0
 * @author	hikashop.com
 * @copyright	(C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */


defined('_JEXEC') or die('Restricted access');
?><div id="hikashop_product_files_main" class="hikashop_product_files_main">
	<?php
	if (!empty ($this->element->files)) {
		$skip = true;
		foreach ($this->element->files as $file) {
			if ($file->file_free_download)
				$skip = false;
		}
		if (!$skip) {
			global $Itemid;
			$url_itemid='';
			if(!empty($Itemid)){
				$url_itemid='&Itemid='.$Itemid;
			}
Thanks for fast answer.

Last edit: 11 years 5 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #115016

Hi,

First of all, you have to use the php tags only if you are not in a php area in your file.
And Nicolas just forgot a "$", the code to use is:

$user = JFactory::getDBO();
if($user->guest) return;

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
11 years 5 months ago #115128

Dear Xavier,

we have implemented the code in following way:

<?php

/**
* @package HikaShop for Joomla!
* @version 2.2.0
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/

$user = JFactory::getDBO();
if($user->guest) return;

defined('_JEXEC') or die('Restricted access');
?><div id="hikashop_product_files_main" class="hikashop_product_files_main">
<?php
if (!empty ($this->element->files)) {
$skip = true;
foreach ($this->element->files as $file) {
if ($file->file_free_download)
$skip = false;
}
if (!$skip) {
global $Itemid;
$url_itemid='';
if(!empty($Itemid)){
$url_itemid='&Itemid='.$Itemid;
}
?>

But still if I try to download a "free" product as unregistered user it lets me download it without registration.

Try it yourself: www.sciencedynamics.net/index.php/en/sho...oduct/15-test-zdarma

Any suggestions?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
11 years 5 months ago #115259

Hi,

Are you sure that you edited the good show_block_product_files file of the product view of your front-end template that you are currently using ?

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
11 years 4 months ago #116437

Well, there's only one file of that name on our server located in /home/.../public_html/components/com_hikashop/views/product/tmpl/show_block_product_files.php

after adding the code you have created at the beginning of the file, nothing happens - unregistered user still can access the file.

The code is here:
<?php
$user = JFactory::getDBO();
if($user->guest) return;
/**
* @package HikaShop for Joomla!
* @version 2.2.0
* @author hikashop.com
* @copyright (C) 2010-2013 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><div id="hikashop_product_files_main" class="hikashop_product_files_main">
<?php
if (!empty ($this->element->files)) {
$skip = true;

Let us know what to do, pls.
Best,
Mark

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 4 months ago #116548

Hi,

The code to use is:

$user = hikashop_loadUser();
if($user == null) return;

sorry for the previous mistake.

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum