• Creator
    Topic
  • #13470

    Anatoly Valyushkin
    Spectator
    Been thanked: 0 times

    I use JavaScript to dynamically change certain content of my pages depending on the URL the visitor used to enter my site. For example:
    – kate.powerofaloe.com opens “Contact Us” page with Kate’s phone number.
    – john.powerofaloe.com opens “Contact Us” page with John’s phone number.
    I use the following line of code: <script>javascript:document.write(getParamValue(‘phone’));</script>
    QUESTION: Where can I add this code for the Contact Page so that the form generates an email to either Kate or John? Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
Replies
  • Alok Maheshwari
    Spectator
    Post count: 303
    Been thanked: 0 times
    #13472 |

    john.powerofaloe.com is not opening.

    Anatoly Valyushkin
    Spectator
    Post count: 26
    Been thanked: 0 times
    #13473 |

    Oh, try marina.powerofaloe.com.

    Alok Maheshwari
    Spectator
    Post count: 303
    Been thanked: 0 times
    #13474 |

    Can you please explain how are you currently making the phone change work and then we can figure out how to do the same for the email.

    Anatoly Valyushkin
    Spectator
    Post count: 26
    Been thanked: 0 times
    #13475 |

    Hi Alok, Here is an example of how I make the change in the footer.

    Appearance -> Theme Options -> Footer -> Copyright Options

    I have the following: This site is provided to you by: <script>javascript:document.write(getParamValue(‘fullName’) + ” Phone: ” + getParamValue(‘phone’));</script>

    <span style=”font-size: 12.8000001907349px;”>The information about marina and kate (their name, phone, email) is recorded in an XML file.</span><span style=”font-size: 12.8000001907349px;”> When you e</span>nter the site as marina.powerofaloe.com or kate.powerofaloe.com, JavaScript reads the name from the tpl value in the URL and drops a cookie. When the page is loaded it reads the cookie and parameters from the XML file and displays them on the page.

    As you may see, I’ve done this for the footer and the contact us page. Where can I do this for the email address in the Contact Form?

    Alok Maheshwari
    Spectator
    Post count: 303
    Been thanked: 0 times
    #13477 |

    Drop an email cookie named distributor_email containing the email address and then you can replace line 62 in contact.php from

    $emailTo = $data['email_address'];

    to

    $emailTo = $_COOKIE['distributor_email']!='' ? $_COOKIE['distributor_email'] : $data['email_address'];

    Anatoly Valyushkin
    Spectator
    Post count: 26
    Been thanked: 0 times
    #13479 |

    Thank you very much. I will give it a try and will let you know.

    Anatoly Valyushkin
    Spectator
    Post count: 26
    Been thanked: 0 times
    #13512 |

    Many thanks again for suggesting the solution. Problem solved!

Viewing 7 replies - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.