- Posts: 52
- Thank you received: 0
Force registration for free products
14 years 2 months ago #60723
by icronje
Force registration for free products was created by icronje
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
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.
14 years 2 months ago #60756
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Re: Force registration for free products
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,
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.
Please Log in or Create an account to join the conversation.
14 years 2 months ago #60818
by icronje
Replied by icronje on topic Re: Force registration for free products
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
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.
14 years 2 months ago #60869
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Re: Force registration for free products
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,
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.
Please Log in or Create an account to join the conversation.
14 years 2 months ago #61094
by icronje
Replied by icronje on topic Re: Force registration for free products
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
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.
14 years 2 months ago #61149
by nicolas
Replied by nicolas on topic Re: Force registration for free products
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; ?>
<?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.
Less
More
- Posts: 5
- Thank you received: 0
13 years 3 months ago - 13 years 3 months ago #114872
by ScienceDyn
Replied by ScienceDyn on topic Force registration for free products
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:
We have the last version of Hikashop and Hikamarket business.
This is the beginning of the file we need to edit:
Thanks for fast answer.
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:
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:
Code:
<?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;
}
Last edit: 13 years 3 months ago by Jerome.
Please Log in or Create an account to join the conversation.
13 years 3 months ago #115016
by Xavier
Replied by Xavier on topic Force registration for free products
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:
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:
Code:
$user = JFactory::getDBO();
if($user->guest) return;
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 5
- Thank you received: 0
13 years 3 months ago #115128
by ScienceDyn
Replied by ScienceDyn on topic Force registration for free products
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?
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.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 3 months ago #115259
by Mohamed Thelji
Replied by Mohamed Thelji on topic Force registration for free products
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 ?
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.
Less
More
- Posts: 5
- Thank you received: 0
13 years 3 months ago #116437
by ScienceDyn
Replied by ScienceDyn on topic Force registration for free products
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
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.
13 years 3 months ago #116548
by Xavier
Replied by Xavier on topic Force registration for free products
Hi,
The code to use is:
sorry for the previous mistake.
The code to use is:
Code:
$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.101 seconds