This module is now in Ubercart core, so the download has been removed.
The Cart Links API is a module that enables store owners to create specially crafted links that add products to customer shopping carts and redirect customers to any page on the site. A store owner might enable this module to provide a link in an e-mail or on any node in a site that functions as a "Buy it now" link for any product on the site. There is also a reports page that lets administrators track the effectiveness of cart links by seeing how many times they've been clicked.
Use this link to test the module on the Livetest:
Buy 2 Tin Can Telephones Now!
There are a few simple rules used when crafting links. These are taken from the module's settings page:
Cart links are simple to form using a few actions and arguments with the following rules:
- The cart link should be /cart/add/cart_link_content.
- Chain together as many actions as you want with dashes.
- Do not put any spaces or use dashes in any action arguments.
- Use the table below to learn about actions and their arguments.
- Arguments come directly after their action letters.
- Specify the redirection by adding ?destination=url where url is the page to go to.
|i||Sets the ID of the cart link.||A custom text ID for the link. |
|e||Empties the customer's cart.||None. |
|m||Displays a preset message to the customer.||A message ID. |
|p||Adds a product to the cart.||A product string using the rules below... |
- You must at least specify a node ID immediately after the 'p'.
- Add additional specifications separated by underscores.
- Specify the quantity with q followed by the number to add.
- Specify attributes/options using a#o#, replacing # with the ID of the attribute and option.
- Turn off the add to cart message with m0.
This will empty the cart, add 5 of product 1 to the cart, track clicks with the ID "monday_special", and redirect the user to the cart.