Announcement

Collapse
No announcement yet.

Auto-populate cart fuction?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • nickc12
    replied
    Well it definitely works off site, just change the action to a direct URL.
    Code:
    action="https://mysite-com.3dcartstores.com/add_cart.asp"
    I have been quite busy the past few weeks, and have basically coded my own "quick-order-pad" that works with options.

    fig1.
    productchooser1.jpg

    fig2.
    productchooser2.jpg
    Customers can add as many line items as they need, products are listed in a drop down so they don't need to know/memorize product codes, and they are separated into categories. They can also adjust quantities, and see a running subtotal of everything they have selected. Once done selecting their items, they can add ALL the items to their basket at once, or select 'get link" which will create a URL that they can bookmark, or email etc. that will recreate all the selection they made. This can also be used by 'customer service' to create a 'product package recommendation' for a customer. CS simply fills out the form and emails the customer the link. The best part about the link is that it simply automates the application. Once loaded, the customer can change quantities, and add or remove products.

    I've tried to give it as much intelligence as I possibly can. As well as keeping data-input to a minimum. By utilizing the export feature of 3Dcart, I can export a csv of my product options, upload it to a SQL database. That way, the application shows the exact same information as my store. And if I ever make changes, update pricing, etc. I just make my changes in 3Dcart as I normally would, than simply* export, and upload.

    *Unfortunately there are a few extra steps involved in between exporting and uploading. The 'Products Options' export doesn't have all the data I need, I have to copy over the 'ProductName' column from the 'Advanced Options' export. Also, if you notice the screenshot above of the 'Products Options' in excel, you will see that the productid, catalogid, and featurecaption for products are only listed on the first option, and for my purposes I need them listed next to every option. This is quite easily remedied in excel however with a simple formula and a copy and paste trick.

    But once the 3D cart data-base is 'cloned' that's it. The application does the rest.

    I'm more than happy to share my code if anyone is interested. While it appears to be fairly stable, it is a lot of javascript and PHP so it's very easy to break. I also stumbled my way through this, so I am sure there are far better ways to do what i have done. But with all the features that we needed, and all the other possibilities that having an assessable SQL clone of our 3Dcart data-base can provide, it seems like a slam dunk.
    Last edited by nickc12; 07-20-2015, 09:01 AM.

    Leave a comment:


  • TMS Clint
    replied
    Keep at it! This is really interesting!

    Leave a comment:


  • nickc12
    replied
    I think I have a way of sending multiple products at the same time:

    Code:
    <input type="Button" value="Add to Basket" onClick="document.add.submit(); setTimeout(function(){document.add2.submit();}, 100) ">
    
    <form enctype="multipart/form-data" method="post" action="add_cart.asp" name="add" target="frame1">
    <input type="hidden" name="item_id" value="32"/>
    <input type="hidden" name="itemid" value="UNCANNY"/>
    <input type="hidden" name="Size-32" value="122" checked/>
    <input type="hidden" name="qty-0" value="1"/>
    </form>
    <iframe name="frame2" style="display:none;"></iframe>
    
    <form enctype="multipart/form-data" method="post" action="add_cart.asp" name="add2" target="frame2">
    <input type="hidden" name="item_id" value="30"/>
    <input type="hidden" name="itemid" value="DREAMTREATS"/>
    <input type="hidden" name="Size-30" value="108" checked/>
    <input type="hidden" name="qty-0" value="1"/>
    </form>
    <iframe name="frame1" style="display:none;"></iframe>
    It worked perfectly in Chrome, but firefox was only adding one product. Adding a 'setTimeout' appears to have 'fixed' it.

    I'll be the first to admit, it's clunky, but it ended up with more elegance, than I was expecting.

    Next: Seeing if it will work off-site. If it does, I can use it in a PHP environment and reintroduce some dynamic elements. If it doesn't, I will have to continue finding JavaScript solutions.

    Leave a comment:


  • nickc12
    replied
    @DeanP Thankyou, the Quick Order Pad looks very promising! It looks as though it might have the same issue as the [Buy Button] ... does it work with 'options'?

    @NMTEACO You are quite right about the [Buy Button] not working with options. However, after much 'trial an error' (which is literally what support told me to do: "This is something that would consist of trial and error.") I have managed to make one by striping down a 'baked' product page to nothing but the 'add to cart' button.

    Code:
    <form enctype="multipart/form-data" method="post" action="add_cart.asp" name="add">
    <input type="hidden" name="item_id" value="[ITEMID#]"/>
    <input type="hidden" name="itemid" value="[ITEMID]"/>
    <input type="hidden" name="[OPTIONNAME]-[ITEMID#]" value="[OPTION#]" checked/>
    <input type="hidden" name="qty-0" value="1"/>
    <button type="button" onclick="document.add.submit();">Add to Cart</button>              
    </form>
    e.g.
    Code:
    <form enctype="multipart/form-data" method="post" action="add_cart.asp" name="add">
    <input type="hidden" name="item_id" value="30"/>
    <input type="hidden" name="itemid" value="DREAMTREATS"/>
    <input type="hidden" name="Size-30" value="108" checked/>
    <input type="hidden" name="qty-0" value="1"/>
    <button type="button" onclick="document.add.submit();">Add to Cart</button>              
    </form>
    Now, populating it is a bit tedious, You can get the [ITEMID#], [ITEMID], and the [OPTIONNAME] in the store manager, but the as far as I can tell the only* place to find the [OPTION#] is to pull up the product page and view the code.

    image_428.jpg


    *You can also find all these values by expoting a 'Products Options' *.csv
    >>Products >>Import/Export >>Products Options >> [Export Data] excel.jpg



    Next: Figuring out how to send multiple products at the same time.
    Last edited by nickc12; 07-01-2015, 10:07 AM.

    Leave a comment:


  • DeanP
    replied
    Originally posted by elightbox View Post
    Maybe there is a way to fire several URLs consecutively to add several items?!
    There is, it's called the Quick Order Pad:

    http://apps.3dcart.com/quick-order-pad.html

    My store has one here, albeit customized for an additional cost:

    https://www.allparts.com/order

    Even if you are crafty enough to decipher the method for posting multiple products to your cart at one time, you can't do it unless 3dcart turns that functionality on. Otherwise it just won't work because it's locked down on their end. Purchasing the Quick Order Pad is the only way to unlock that functionality.

    Leave a comment:


  • NMTEACO
    replied
    Please keep us updated on your progress. The link on the advanced tab does not work with items with options, however the continue cart link does... It would be great to be able to have a link to add an item to the cart with options!

    Leave a comment:


  • nickc12
    replied
    @elightbox that is quite helpful, thank you. I will experiment with that.

    Leave a comment:


  • elightbox
    replied
    There is an option to add a single item with a link. The ink is on the advanced tab, you just have strip the html from the URL in the Buy Button field.

    Maybe there is a way to fire several URLs consecutively to add several items?!

    Leave a comment:


  • nickc12
    replied
    Experimenting with the 'abandoned cart/continue order' link, it is actually very interesting. The link appears to be dynamic. If you click the link, any changes you make to your cart are then 'saved' to that link. So anywhere that link was clicked would then reflect those changes. i.e. if a bunch of people had used the same link, their baskets would constantly be updating with each others changes. And my guess is that it is void after an order is placed. So even if I could generate those links "at will" they wouldn't be what I want...

    Leave a comment:


  • nickc12
    started a topic Auto-populate cart fuction?

    Auto-populate cart fuction?

    I would like to have a link, either on the website, and/or that can be emailed to a customer that would automatically populate their cart with a predetermined set of products. The "abandoned cart" system basically has this functionally. I'm wondering if it (or something else) could be manipulated in such a way that these links could be generated at will, i.e. without having to add items to a cart and wait a day to get the link. Also I'm not sure how long those links last.

    e.g. http://www.proteinkey.com/continue_o...GxeDFVfRGw7htb

    Alternately/for reference the function I am after is somewhat similar to Amazon's "Frequently Bought Together" section where you can hit one button that automatically adds 3 different products to your cart.

    Any thoughts anyone has would be appreacheated.

    Thank you,
    Nick
Working...
X