VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: j45p41 on September 06, 2014, 19:43:18 PM

Title: Virtuemart Checkout force user to register to allow gift coupon usage
Post by: j45p41 on September 06, 2014, 19:43:18 PM
I am using virtuemart 2.6.6 with Joomla 2.5.

I have added gift coupons for users and I want them to use this once when placing their first order. The problem is that when a user is not registered they will try to add the coupon code FREEDEL at site localbutler.co.uk but the one page checkout page first prompts them to add their details and then proceeds to confirm their order but not give the user an opportunity to add the code.

Is there any way that I can force users to register first and then automatically login before the page showing the cart item appears because when a user is previously registered the coupon works fine.
Title: Re: Virtuemart Checkout force user to register to allow gift coupon usage
Post by: jenkinhill on September 06, 2014, 19:49:31 PM
Try enabling "Only registered users can checkout " in Config/Checkout.
Title: Re: Virtuemart Checkout force user to register to allow gift coupon usage
Post by: j45p41 on September 06, 2014, 19:58:34 PM
Hi jenkinhill,

many thanks indeed for the reply, however I do have this option enabled - see attachment.

The funny things is that we were ready to launch until we decided to add free delivery code. Now the best option seems that we have users registered beforehand.

ideally the section crossed out should not appear and the user should be prompted to login, either as part of this page or an intermediate page.

[attachment cleanup by admin]
Title: Re: Virtuemart Checkout force user to register to allow gift coupon usage
Post by: GJC Web Design on September 06, 2014, 21:55:59 PM
Your screen doesn't look like std VM - r u using a 3rd party checkout  (OPC)?
Title: Re: Virtuemart Checkout force user to register to allow gift coupon usage
Post by: j45p41 on September 07, 2014, 01:46:35 AM
I am using checkout from gavick.com template storefront.

However I managed to fix the issue by:

I managed to fix this issue.

I edited the cart php files and inserted the following code:

//JUMP ADDRESS CODE

$user = JFactory::getUser();
$status = $user->guest;

if($status == 1){
echo "not logged in";
goto out_a;
}
else
{
echo "logged in";

}   
?>
I know that using goto is not a great way of coding in php but it allowed me to jump over displaying the address fields when the user was not logged in.