Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Looking for help with js in BigCommerce Store

    I have a BigCommerce Store. On the right-hand side of my store under My Favourites see (http://gatesunique.mybigcommerce.com/doodle-daddles/) if I click on add to cart:

    In Chrome it comes back with a blank page with "Add to my designAdd to my designAdd to my designAdd to my design"

    In Firefox it comes back with a blank page with "Add to my design"

    In i.e. it works perfectly and takes me to the fast cart.

    I have script which is supposed to change the label "compare" on the main products page to "add to my design" depending on which category was chosen. Here is the script. If I remove the script the cart works perfectly, but then of course I don't have the label changed as I want it. Please let me know if there is more information I can provide to get help with this.

    [CODE]<script type="text/javascript">
    var doodle= "http://gatesunique.mybigcommerce.com/doodle-daddles/";

    if (location.href==doodle){
    document.write('<label for="compare_%%GLOBAL_ProductId%%">Add to my design</label>');
    } else {
    document.write('<label for="compare_%%GLOBAL_ProductId%%">%%LNG_Compare%%</label>');
    }

    </script>[ICODE]

  • #2
    New Coder
    Join Date
    Sep 2012
    Location
    Dynamic Systems
    Posts
    10
    Thanks
    2
    Thanked 1 Time in 1 Post
    The problem is with getting that vrble. You may use Jquery to get that variable, after which you can use it to output text via normal JS.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •