55 users online (1 members and 54 guests)  


  Results 1 to 6 of 6

Related

  1. Replies: 4
  2. Replies: 2
  3. Replies: 4
  1. #1
    taylor1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2009
    Posts
    4

    Question I can't figure this out...

    Okay I've asked before but many people tell me they can't help b/c they don't know their system and how it works. I have a site with shopify. I like it, don't get me wrong...but i can't figure out this feature i want to change on my site. I have to add in javascript and jquery to get this feature to work.

    is there anyone on here that thinks they may be able to help me with any of these things? if so I'll of course be more detailed but don't want to go on and on for no reason.

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: I can't figure this out...

    While I am not familiar with their system, I am confident I could help you out provided you were willing to give me your login information.

    Before any of that though, have you checked their wiki or the community forums? The help you get from their would probably be the best and fastest.

  3. #3
    rangana's Avatar
    Moderator/Allstar

    Status
    Offline
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    317

    Re: I can't figure this out...

    What script do you mean? Could you also leave us a link to the offending page so we could take a closer look.
    Checkout my porfolio.
    Please click the button when a member helped you.
    Take time to use Forum's Search function.

  4. #4
    taylor1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2009
    Posts
    4

    Re: I can't figure this out...

    Yes I have asked for help over there but many of the knowledgeable people over there are looking to make a buck. I don't blame them, that's how they earn a living. i am just at a point where im trying to teach myself and learn this and would like to do it on my own or learn how and they want to do it for me and simply have me pay for it. i would rather learn how.

    what happens in shopify is there is only a single product page to edit called product.liquid. i can add sku's and shopify will change the options for each product based on each sku i add by itself. but some of my items have near 30 or more skus each. i can see a way to allow the option for each item to only be one sku and have drop down boxes say one for size and one for color. the problem is if i change the product.liquid page it changes every item on my web site to only have those options for every item i sell not just the one i want it to change.

    essentially what i want to do is be able is this:

    say i have two shirts one comes in s,m,and l and white and black and another that has s,m,l, and xl and comes in white, black ,and yellow (that are on different pages not together on the same page i saw the use of a descrambler but that i dont think is what i want or is it?) i dont want to use up 12 sku's i want to be able to use 2 sku's (one item per page with added variables for each instead of each size color using up a sku) but shopify only has a single product page and i can not figure out how to diferentiate the different products to each have their own variables and drop downs.

    not sure if i made that all clear but i tried best i could. ill provide any info i can if someone can help me out. if you have any questions or i was not clear please let me know. and thank you so much for any help you can be.
    Last edited by taylor1; 05-14-2009 at 09:12 AM.

  5. #5
    taylor1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2009
    Posts
    4

    Re: I can't figure this out...

    okay so i figured out how to add the buttons i need to the product pages but when i click add to cart they are not link the choices made from the drop down menus... so new issue... help?? thanks

  6. #6
    taylor1's Avatar
    New User

    Status
    Offline
    Join Date
    May 2009
    Posts
    4

    Re: I can't figure this out...

    Here is the script I used for my product pages (goes in my theme.liquid since I'm using shopify):
    <script type="text/javascript" src="unobtrusivedynamicselect_ex5.js"></script>
    <script type="text/javascript">
    window.onload = function() {
    dynamicSelect("color", "size");
    }
    function dynamicSelect(id1, id2) {
    // Browser and feature tests to see if there is enough W3C DOM support
    var agt = navigator.userAgent.toLowerCase();
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_mac = (agt.indexOf("mac") != -1);
    if (!(is_ie && is_mac) && document.getElementById && document.getElementsByTagName) {
    // Obtain references to both select boxes
    var sel1 = document.getElementById(id1);
    var sel2 = document.getElementById(id2);
    // Clone the dynamic select box
    var clone = sel2.cloneNode(true);
    // Obtain references to all cloned options
    var clonedOptions = clone.getElementsByTagName("option");
    // Onload init: call a generic function to display the related options in the dynamic select box
    refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
    // Onchange of the main select box: call a generic function to display the related options in the dynamic select box
    sel1.onchange = function() {
    refreshDynamicSelectOptions(sel1, sel2, clonedOptions);
    };
    }
    }
    function refreshDynamicSelectOptions(sel1, sel2, clonedOptions) {
    // Delete all options of the dynamic select box
    while (sel2.options.length) {
    sel2.remove(0);
    }
    // Create regular expression objects for "select" and the value of the selected option of the main select box as class names
    var pattern1 = /( |^)(select)( |$)/;
    var pattern2 = new RegExp("( |^)(" + sel1.options[sel1.selectedIndex].value + ")( |$)");
    // Iterate through all cloned options
    for (var i = 0; i < clonedOptions.length; i++) {
    // If the classname of a cloned option either equals "select" or equals the value of the selected option of the main select box
    if (clonedOptions[i].className.match(pattern1) || clonedOptions[i].className.match(pattern2)) {
    // Clone the option from the hidden option pool and append it to the dynamic select box
    sel2.appendChild(clonedOptions[i].cloneNode(true));
    }
    }
    }
    </script>

    And then on my product page (for each one has different options) I have this:
    <form action="/cart/add" method="post">
    <div id="product-variants">
    <div id="price-field"></div>
    <select id="color">
    <option value="select">Select Color</option>
    <option value="white">White</option>
    <option value="black">Black</option>
    <option value="brown">Brown</option>
    </select>
    <select id="size">
    <option class="select" value="select">Select Size</option>
    <option class="white" value="32a">32A</option>
    <option class="white" value="32b">32B</option>
    <option class="white" value="32c">32C</option>
    <option class="black" value="34a">34A</option>
    <option class="black" value="34b">34B</option>
    <option class="black" value="34c">34C</option>
    <option class="brown" value="36a">36A</option>
    <option class="brown" value="36b">36B</option>
    </select>
    <br>
    <input type="image" src="http://i45.photobucket.com/albums/f65/emmi1116/website/add1.gif" name="add" value="Purchase" id="purchase" />
    </div>
    </form>

    the drop down boxes are working EXACTLY like I needed them too. Mission #1 accomplished! whoo hoo!

    but why oh why I can't seem to figure out this cart is driving me mad!

    I have altered this script a thousand times, and can't get what my customers select with the drop down boxes onto my cart pages so that you can see the selection (not only for them but for me) of what they are ordering. Here is my cart.liquid:

    <h2>Your Shopping Cart</h2>
    {% if cart.item_count == 0 %}
    <h3>Your cart is empty</h3>
    <p><a href="/"><img src="{{ 'continueshopping.gif' | asset_url }}" alt="continue shopping" /></a></p>
    {% else %}
    <form action="/cart" method="post" id="cartform" name="cartform">
    {% for item in cart.items %}
    <div id="shoppingcart">
    <div class="shoppingcart-image"> <img src="{{ item.product.images.first | product_img_url: 'medium' }}" alt="{{ item.title | escape }}" /> </div>
    <div>
    <h3>{{ item.title }}<br />
    {{ item.price | money }}</h3>
    <div class="updater">
    <input type="text" name="updates[]" value="{{ item.quantity }}" onfocus="this.select();" class="cart-update" />
    <input type="submit" name="update" value="Update" id="update-cart">
    <br />
    <br />
    <a href="/cart/change/{{ item.variant.id }}?quantity=0">Remove from cart</a> </div>
    </div>
    </div>
    {% endfor %}
    <div class="total">SUBTOTAL: {{ cart.total_price | money }} {{ shop.currency }}</div>
    <div class="checkout">
    <a href="/"><img src="{{ 'continueshopping.gif' | asset_url }}" alt="continue shopping" /></a>
    <input type="image" value="Proceed to Checkout" name="checkout" src="{{ 'checkout.gif' | asset_url }}"/>
    </div>
    </form>
    {% endif %}

    Just to add additional info, b/c the more info I provide the more you guys know and hopefully can help..
    Product.liquid:
    <div id="product">
    <h2>{{ product.title }}</h2>
    <div id="product-main"> {% for image in product.images %}
    {% if forloop.first %}
    <div id="prod-img"> <img src="{{ image | product_img_url: 'large'}}" alt="{{product.title}}" /> </div>
    {% else %}
    <div class="prod-img-small fl"> <a href="{{ image | product_img_url: 'large' }}" class="lbOn"> <img src="{{ image | product_img_url: 'small'}}" alt="{{product.title}}" /> </a> </div>
    {% endif %}
    {% endfor %} </div>
    <div id="variant-add">
    <form action="/cart/add" method="post">
    <div id="product-variants">{% assign variant = product.variants.first %}
    <p class="odd">
    <input type="hidden" name="id" value="{{ variant.id }}" id="hidden_{{ variant.id }}" />
    <label for="hidden_{{ variant.id }}">
    <span class="bold-blue">{{ variant.price | money }}</span>
    {% if variant.price < variant.compare_at_price %}
    <del>{{ variant.compare_at_price | money }}</del>
    {% endif %}
    </label>
    </p>
    </div>
    <div id="description" class="textile"> {{ product.description }} </div>
    <div id="tags">
    <ul>
    <li>Made by {{product.vendor | link_to_vendor }}</li>
    <li>Type: {{product.type | link_to_type }}</li>
    </ul>
    </div>
    </div>


    sorry for the lengthy post but I thought ALL this info might help me get through this huge bump in the road! thanks to anyone who can help...

    BTW: in my cart liquid where I was trying to get the info to show up for the color and size is <h3> between the item title and the amount
    Last edited by taylor1; 05-18-2009 at 09:23 PM.



Tags for this Thread