- Timestamp:
- Dec 29, 2020 3:18:44 AM (3 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Cart.inc.php
r611 r741 40 40 if ($p = mysql_fetch_assoc($qid)) { 41 41 $cart->add($product_id, $p['price'], 1, array( 42 ' title' => $p['title'],42 'name' => $p['name'], 43 43 'shipping' => $p['shipping'], 44 44 'weight' => $p['weight'], … … 62 62 // User views cart. 63 63 foreach ($cart->getList() as $item) { 64 printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item[' title'], $item['quantity'], $item['price']);64 printf("Item: %s\nQty: %s\nPrice: %s\n\n", $item['name'], $item['quantity'], $item['price']); 65 65 } 66 66 break; … … 132 132 * @param float $price Price-per-quantity-unit for the item 133 133 * @param float $quantity Quantity of items (can be fractional unites?) 134 * @param array $specs An array of additional specifications ( title, weight, etc)134 * @param array $specs An array of additional specifications (name, weight, etc) 135 135 * @return float The new adjusted quantity of this item. 136 136 * @author Quinn Comendant <quinn@strangecode.com> -
trunk/lib/Utilities.inc.php
r738 r741 1683 1683 } 1684 1684 } 1685 1686 /* 1687 * Test if a string is valid json. 1688 * https://stackoverflow.com/questions/6041741/fastest-way-to-check-if-a-string-is-json-in-php 1689 * 1690 * @access public 1691 * @param string $str The string to test. 1692 * @return boolean True if the string is valid json. 1693 * @author Quinn Comendant <quinn@strangecode.com> 1694 * @since 06 Dec 2020 18:41:51 1695 */ 1696 function isJSON($str) 1697 { 1698 json_decode($str); 1699 return (json_last_error() === JSON_ERROR_NONE); 1700 }
Note: See TracChangeset
for help on using the changeset viewer.