SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Custom JavaScript for Ecommerce Shopify Site

    Hello,

    I've just finished building a Shopify shop from scratch at: http://www.boostliquidation.com/

    Everything is working great, we're just working out small bugs here and there. We have it set up to where, when someone clicks on the "Add to Pallet" button, it refreshes to the same page and lands back on that particular products div. We used Javascript to do this by using an anchor tag based on that products SKU number. So, if you add a product to your pallet, you can see in the address bar something like: http://www.boostliquidation.com/#ProductsSKUNumber.

    This works fine, but if the user adds another product on the same page, it amends that SKU number to the end of the other one, like so: http://www.boostliquidation.com/#Pro...econdSKUNumber. Which makes the anchor not work.

    So, I was just wondering if there's a way to replace the SKU number every time someone adds another product instead of amending it...?

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,716
    Mentioned
    103 Post(s)
    Tagged
    4 Thread(s)
    Are you using the location object to adjust the URL? For example, you can use location.hash to work with the fragment identifier.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


Bookmarks

Posting Permissions

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