function uc_cart_links_creation_help in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_cart_links/uc_cart_links.admin.inc \uc_cart_links_creation_help()
- 7.3 uc_cart_links/uc_cart_links.admin.inc \uc_cart_links_creation_help()
1 string reference to 'uc_cart_links_creation_help'
- uc_cart_links_menu in uc_cart_links/
uc_cart_links.module - Implementation of hook_menu().
File
- uc_cart_links/
uc_cart_links.module, line 260 - Allows store owners to create links to add products to carts and send customers on to checkout.
Code
function uc_cart_links_creation_help() {
$items = array(
t('The cart link should be /cart/add/cart_link_content.'),
t('Chain together as many actions as you want with dashes.'),
t('Do not put any spaces or use dashes in any action arguments.'),
t('Use the table below to learn about actions and their arguments.'),
t('Arguments come directly after their action letters.'),
t('Specify the redirection by adding ?destination=url where url is the page to go to.'),
);
$header = array(
t('Action'),
t('Description'),
t('Argument'),
);
$rows = array(
array(
'i',
t('Sets the ID of the cart link.'),
t('A custom text ID for the link.'),
),
array(
'e',
t("Empties the customer's cart."),
t('None.'),
),
array(
'm',
t('Displays a preset message to the customer.'),
t('A message ID.'),
),
array(
'p',
t('Adds a product to the cart.'),
t('A product string using the rules below...'),
),
);
$items2 = array(
t("You must at least specify a node ID immediately after the 'p'."),
t('Add additional specifications separated by underscores.'),
t('Specify the quantity with q followed by the number to add.'),
t('Specify attributes/options using a#o#, replacing # with the ID of the attribute and option.'),
t('Turn off the add to cart message with m0.'),
);
$output = '<div>' . t('There is currently no user interface for creating cart links, but this section includes some basic instructions.<br />Cart links are simple to form using a few actions and arguments with the following rules:') . '<p>' . theme('item_list', $items) . '</p><p>' . theme('table', $header, $rows) . '</p><p>' . theme('item_list', $items2) . '</p><p>' . t('<b>Example:</b> /cart/add/e-p1_q5-imonday_special?destination=cart<br /><br />This example 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. To use this on your site, simply create an HTML link to the URL you create:') . '</p><p><a href="http://www.example.com/cart/add/e-p1_q5-imonday_special?destination=cart">' . t('Link text.') . '</a></p></div>';
return $output;
}