Skip to main content

Force registration for free products

14 years 2 months ago #60723 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

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

14 years 2 months ago #60756 by Jerome
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.

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

14 years 2 months ago #60818 by icronje
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.

14 years 2 months ago #60869 by Jerome
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.

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

14 years 2 months ago #61094 by icronje
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.

14 years 2 months ago #61149 by nicolas
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.

13 years 3 months ago - 13 years 3 months ago #114872 by ScienceDyn
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:
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; }
Thanks for fast answer.
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
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:
Code:
$user = JFactory::getDBO(); if($user->guest) return;

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

13 years 3 months ago #115128 by ScienceDyn
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.

13 years 3 months ago #115259 by Mohamed Thelji
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.

13 years 3 months ago #116437 by ScienceDyn
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.

13 years 3 months ago #116548 by Xavier
Hi,

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
Powered by Kunena Forum