getThemeGenShoppingCart

The Responsive Minimal getThemeGenShoppingCart function.

Description

getThemeGenShoppingCart(); 

Usage

  1. if ( !function_exists( 'getThemeGenShoppingCart' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = getThemeGenShoppingCart(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function getThemeGenShoppingCart() { 
  2. global $themename, $shortname; 
  3. $page_product=array('Products', 'All pages'); 
  4. $GLOBALS['tg_shp_show']=get_option('themeshock_shp_cart_show'); 
  5. $shoppinCartUrl = (!get_option($shortname.'_shopping_cart_url'))?'http://www.yourmerchant.com/ ':get_option($shortname.'_shopping_cart_url'); ?> 
  6. <div class="display-block"> 
  7. <div class="display-table-cell table-cell-first"> 
  8. <label for="<?php echo $shortname; ?>_features">Shopping cart</label> 
  9. </div> 
  10. <div class="display-table-cell table-cell-2"> 
  11. <input type="checkbox" name="ts_shopping_cart" value="true" <?php echo (get_option('ts_shopping_cart')==='true')?'checked="checked"':''; ?> /> 
  12. </div> 
  13. </div> 
  14. <div class="display-block"> 
  15. <div class="display-table-cell table-cell-first"> 
  16. <label for="<?php echo $shortname; ?>_features">Show shopping cart in </label> 
  17. </div> 
  18. <div class="display-table-cell table-cell-2"> 
  19. <select name="<?php echo $shortname; ?>_shp_cart_show[]" multiple="multiple"> 
  20. <?php 
  21. foreach ($page_product as $value) { 
  22. if (is_array($GLOBALS['tg_shp_show'])) { 
  23. $tg_shp_sl=''; 
  24. foreach ($GLOBALS['tg_shp_show'] as $page_verify) { 
  25. if ($page_verify===$value) { 
  26. $tg_shp_sl='selected="selected"'; 
  27. }else{ 
  28. $tg_shp_sl=''; 
  29. }?> 
  30. <option value="<?php echo $value; ?>" <?php echo $tg_shp_sl; ?>><?php echo $value; ?></option><?php 
  31. }?> 
  32. </select> 
  33. </div> 
  34. </div> 
  35. <div class="display-block"> 
  36. <div class="display-table-cell table-cell-first"> 
  37. <label for="<?php echo $shortname; ?>_features">Price url</label> 
  38. </div> 
  39. <div class="display-table-cell table-cell-2"> 
  40. <textarea name="<?php echo $shortname; ?>_shopping_cart_url" type="textarea"><?php echo $shoppinCartUrl;?></textarea> 
  41. </div> 
  42. </div> 
  43. <div class="display-block"> 
  44. <div class="display-table-cell table-cell-first"> 
  45. <label for="<?php echo $shortname; ?>_features">Currency</label> 
  46. </div> 
  47. <div class="display-table-cell table-cell-2"> 
  48. <select name="<?php echo $shortname; ?>_shopping_cart_currency" id="<?php echo $shortname; ?>_imgpack"> 
  49. <?php 
  50. $shoppingcart_currency_pack=array("USD", "BRL", "CAD", "CNY", "COP", "EUR", "GBP", "MXN", "JPY" ); 
  51. $get_shopping_cart=get_option($shortname.'_shopping_cart_currency'); 
  52. foreach($shoppingcart_currency_pack as $shoping_cart_item ) {?> 
  53. <option <?php echo ($shoping_cart_item===$get_shopping_cart)?'selected="selected"':''; ?> ><?php echo $shoping_cart_item; ?></option><?php 
  54. ?>  
  55. </select> 
  56. </div> 
  57. </div> 
  58. <small> 
  59. URL where you will receive payment parameters: Parameters to pass (Post method):<br /> 
  60. $_POST['tg_shp_cart'][idproduct]['title']=Prints product name 
  61. $_POST['tg_shp_cart'][idproduct]['quantity']=Prints product quantity 
  62. $_POST['tg_shp_cart'][idproduct]['price']=Prints the total price for the quantity of such product according to the price defined in Edit product item 
  63. $_POST['tg_shp_cart'][price_total]=Prints total price of all products 
  64. $_POST['tg_shp_cart'][total_items]=Prints total quantity of items of all products 
  65. $_POST['tg_shp_cart'][currrency]=Prints the currency selected at Options for Theme Generator 
  66. </small> 
  67. <div class="area-save-btn"><input name="save" type="submit" value="Save" class="button-primary"/></div><!-- end area-save --> 
  68. <?php }