The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Promo Box Help Needed
JCollier
post Apr 6 2017, 02:16 PM
Post #1





Group: Members
Posts: 4
Joined: 6-April 17
Member No.: 26,370



I am seeking to add to the homepage, a promo box. This box will allow a guest to enter a promotion code, and then be directed to the appropriate coupon for printing. Example: if you type in "FOOD31" into the promo box, hit submit, you would be directed to the Food coupon for printing. Type in code "KIDS15", then the free kids meal coupon comes up for printing.

These coupons will be on the hosting site, as an image. Or can be made as an individual page, but hidden unless directed there by the code they entered. I will have these codes printed on fliers, social media, everywhere. But the guest has to go to the website, enter the code they have, and have access to the corresponding coupon.

I am using GoDaddy Website Builder/Instapage, and only have access to the html code in the body.

Any and all help would be greatly appreciated, as I am getting no where fast. If I need to have a third party application to achieve this, that is not a problem either. Just can not find the one I am looking for to complete this task. I am not selling anything online ,therefore do not have a shopping cart, or checkout. Only apps I have found so far deal with checkout.

I have searched for html coding, promo box apps, even tried a few building apps. But all is foreign to me.

www.HappyDaysArcade.com - My Simple Page, in need of a promo box on the bottom

Help Me Please!!

Joshua
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 6 2017, 03:39 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Is it critical that users are not able to find and print the coupons (by viewing the HTML source) without actually knowing the promo codes? To prevent such snooping you'd need a server-side script, but it sounds like GoDaddy Website Builder doesn't support that. A less secure approach might be done with javascript.

Does each coupon correspond with a single code, or could several codes point to the same coupon?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
JCollier
post Apr 6 2017, 03:50 PM
Post #3





Group: Members
Posts: 4
Joined: 6-April 17
Member No.: 26,370



One code per coupon. At the moment, I am planning on two codes, for two different coupons. But in the future, more codes may be added for different coupons.

I'd also need to be able to go in and modify the code (not the coupon) depending on the timing of the special being offered.

I was hoping the coupon could be created as an image, and when the code was entered it would direct them to a page with only that coupon image on it. But that page would need to be hidden.

I'm not too sure how html smart every customer would be, but i don't think it's critical at this point to worry about people finding source coding info.
I am an arcade, offering token specials specifically to certain marketed groups by promo code, and food specials directed to certain people with other promo codes. These codes will be printed on fliers, marketing materials, etc.

In my head this makes sense, but I have no knowledge how to make it happen, or if it's even possible.

I thank you for your time and assistance, godaddy left me stranded.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 6 2017, 08:28 PM
Post #4


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



Here's a very basic script for two codes (more can be added). If the promo code is valid, the page will redirect to an image with the file name specified (which doesn't have to be the same as the promo code), otherwise an alertbox will show an error message:

CODE
<script type="text/javascript">
function get_coupon()
{
    var promo=document.getElementById('promo');
    var coupon=document.getElementById('coupon');

    // check promo codes and load coupon images
    coupon.onclick=function()
    {
        if(promo.value=='123') // promo code
        {
            window.location.href='abc.gif'; // coupon file name
        }
        
        else if(promo.value=='456')
        {
            window.location.href='xyz.gif';
        }
        
        // add more "else if":s here if needed

        else
        {
            alert('Invalid promo code'); // error message if wrong code is entered
        }
    }
}
if(window.addEventListener)
{
    window.addEventListener('DOMContentLoaded', get_coupon, false);
}
</script>

<p>
Enter promotion code:
<input type="text" value="" id="promo">
<input type="button" value="Get Coupon" id="coupon">
</p>
<noscript><p>Javascript is required to get the promotion coupons.</p></noscript>





User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
JCollier
post Apr 6 2017, 09:41 PM
Post #5





Group: Members
Posts: 4
Joined: 6-April 17
Member No.: 26,370



THANK YOU!!!!!!
I have a promo box, but keeps sending me to the error 404 page.
I've labeled my coupon image, put the name of the image in the spot you provided. Loaded image to host, but not getting it to show up.
It tries to load www.happydaysarcade.com/imagename.jpg but gives error code.
I will contact the host tomorrow to see where the correct spot for me to load the image to is.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 7 2017, 07:21 AM
Post #6


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



The image files should be in the same directory (folder) as the web page. If you want to use another directory for the images the script can be modified.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
JCollier
post Apr 7 2017, 11:35 AM
Post #7





Group: Members
Posts: 4
Joined: 6-April 17
Member No.: 26,370



It is all set now. I thank you greatly!! Web host still was giving me a hard time, but with your help, and reading between his words, its resolved.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Apr 7 2017, 02:28 PM
Post #8


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



You're welcome!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 08:14 AM