Any questions about Documents Sellers, post it here .

Required Coupon Codes + Validate Coupon

  • nate.reimnitz
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 weeks ago #12574 by nate.reimnitz
Required Coupon Codes + Validate Coupon was created by nate.reimnitz
I am using Documents Seller to pass purchased music / albums to end users. They've already made their payments via a 3rd party website and I need to simply pass the music to the users 1 time.

I have set up multiple coupon codes that can each only be used 1 time so that a user cannot send the 'download code' to a bunch of friends.

I made a minor adjustment to the default.php file found in ComDMS > Views > Checkout > TMPL so that a coupon code is Required*

<?php
if ($this->config->enable_coupon) {
?>
<tr>
<td class="title_cell">
<?php echo JText::_('Download Code'); ?><span class="required">*</span>

</td>
<td class="field_cell">
<input type="text" class="inputbox" name="coupon_code" value="<?php echo $this->couponCode ; ?>" size="25" />
<?php
if ($this->couponError) {
?>
<span class="error"><?php echo JText::_('The download code you entered is invalid or expired, please try again.'); ?></span>



However, I also need the system to check that the coupon code entered actually exists. If it does they should receive the download, if it doesn't exist (or if it's expired / used already) it should give us an error.

What do I need to do?
Attachments:

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

  • nate.reimnitz
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 2 weeks ago #12575 by nate.reimnitz
Replied by nate.reimnitz on topic Re: Required Coupon Codes + Validate Coupon
I added this which is working...

if (form.coupon_code.value!="FREE") {
alert("<?php echo JText::_('You Must Enter A Valid Download Code'); ?>");
form.coupon_code.focus();
return;
}

Curious how I can replace "FREE" with something to actually check existing coupons & their use status.

Thanks!

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

More
13 years 1 week ago #12671 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Required Coupon Codes + Validate Coupon
Just want to update this post : Discussed with the client via support ticket and found the solution (just used default feature of the extension, no need for modifing code). Everything works well now !

Tuan

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

  • nate.reimnitz
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 1 week ago #12673 by nate.reimnitz
Replied by nate.reimnitz on topic Re: Required Coupon Codes + Validate Coupon
Thanks again Tuan!

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

More
13 years 1 week ago #12674 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Required Coupon Codes + Validate Coupon
:). If you have few minutes, please help me by giving the extension a 5 stars rating and a nice review at extensions.joomla.org/extensions/e-commerce/paid-downloads/5000 to support my development !

Tuan

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

More
12 years 10 months ago #13573 by icandy
Replied by icandy on topic Re: Required Coupon Codes + Validate Coupon
Coupon Code invalid message when I try to use it? Please help.

I have attached image to show my set up:


I created 2 codes SF1X and SF2X

Attachment tuan2.png not found

Attachments:

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

More
12 years 10 months ago #13587 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Re: Required Coupon Codes + Validate Coupon
@icandy : Please submit a support ticket giving me administrator and FTP account of your site so that I can check it ? Also, it seems you are still using 1.4.2, could you please upgrade to version 1.4.3 (the latest version) ?

Regards,

Tuan

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