Changeset 46413

Show
Ignore:
Timestamp:
05/17/08 01:29:10 (2 months ago)
Author:
zackdesign
Message:

1.3.5

Location:
quick-shop
Files:
27 added
2 modified

Legend:

Unmodified
Added
Removed
  • quick-shop/trunk/quickshop.php

    r45527 r46413  
    55Description: Quick and easy shopping cart with widget! 
    66Author: Isaac Rowntree 
    7 Version: 1.3.4 
     7Version: 1.3.5 
    88Author URI: http://zackdesign.biz 
    99 
     
    9191function widget_quickshop($args) 
    9292{ 
    93     if (cart_has_items()) 
     93    extract($args); 
     94       
     95      if (cart_has_items()) 
    9496    { 
    9597    $defaultSymbol = get_option('quickshop_symbol'); 
     
    116118    if (!$freeshipt || ($freeshipt == '')) $freeshipt = 'Shipping is free for orders of $200 and upwards.'; 
    117119 
    118     extract($args); 
     120    $title = get_option('quickshop_title'); 
     121      if (($title == '') || !$title ) $title = 'Your Shopping Cart'; 
    119122     
    120123    echo $before_widget; 
    121124    echo '<div class="quickshopcart" style="padding: 5px;">'; 
    122     echo $before_title . 'Your Shopping Cart' . $after_title; 
    123      
    124     echo '<br /><form method="post" action=""><table style="width: 100%;">'; 
     125    echo $before_title . $title . $after_title; 
     126     
     127    echo '<br /><span id="info" style="display: none; font-weight: bold; color: red;">Hit tab or enter to submit new QTY.</span><form method="post" action=""><table style="width: 100%;">'; 
    125128     
    126129    $count = 1; 
     
    139142         
    140143        <tr><td style='overflow: hidden;'><a href='".get_permalink($item['postID'])."'>".$item['name']."</a></td> 
    141         <td style='text-align: center'><form method=\"post\" action=\"\" style='display: inline'> 
     144        <td style='text-align: center'><form method=\"post\" name='cquantity' action=\"\" style='display: inline'> 
    142145        <input type='hidden' name='product' value='".$item['name']."' /> 
    143146         
    144         <input type='hidden' name='cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' /></form></td> 
     147        <input type='hidden' name='cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' onchange='document.cquantity.submit();' onkeypress='document.getElementById(\"info\").style.display = \"\";' /></form></td> 
    145148        <td style='text-align: center'>".output_currency(($item['price'] * $item['quantity']),$symbol, $decimal)."</td> 
    146149        <td><form method=\"post\"  action=\"\"> 
     
    196199     
    197200    } 
     201      else 
     202      { 
     203          $display  = get_option('quickshop_display'); 
     204            if ($display) 
     205            { 
     206                $displayt = get_option('quickshop_displayt'); 
     207                  $title = get_option('quickshop_title'); 
     208                  if (($title == '') || !$title ) $title = 'Your Shopping Cart'; 
     209                if (($displayt == '') || !$displayt ) $displayt = 'Your Shopping Cart is empty'; 
     210                echo $before_widget.'<div class="quickshopcart" style="padding: 5px;">'.$before_title . $title . $after_title.'<p>'.$displayt.'<p></div>'.$after_widget; 
     211            } 
     212      } 
    198213} 
    199214 
    200215function widget_quickshoppaypal($args) 
    201216{ 
    202     if (cart_has_items()) 
    203     { 
    204      
    205217    extract($args); 
     218       
     219      if (cart_has_items()) 
     220    { 
     221     
     222     
    206223     
    207224    $email = get_bloginfo('admin_email'); 
     
    230247    $freeshipt = get_option('quickshop_freeshipt'); 
    231248    if (!$freeshipt || ($freeshipt == '')) $freeshipt = 'Shipping is free for orders of $200 and upwards.'; 
     249       
     250      $title = get_option('quickshop_title'); 
     251      if (($title == '') || !$title ) $title = 'Your Shopping Cart'; 
    232252     
    233253    echo $before_widget; 
    234254    echo '<div class="quickshopcart" style=" padding: 5px;">'; 
    235     echo $before_title . 'Your Shopping Cart' . $after_title; 
    236      
    237     echo '<br /><table style="width: 100%;">'; 
     255    echo $before_title . $title . $after_title; 
     256     
     257    echo '<br /><span id="pinfo" style="display: none; font-weight: bold; color: red;">Hit tab or enter to submit new QTY.</span><table style="width: 100%;">'; 
    238258     
    239259    $count = 1; 
     
    256276         
    257277        <tr><td style='overflow: hidden;'><a href='".get_permalink($item['postID'])."'>".$item['name']."</a></td> 
    258         <td style='text-align: center'><form method=\"post\"  action=\"\" style='display: inline'> 
     278        <td style='text-align: center'><form method=\"post\"  action=\"\" name='pcquantity' style='display: inline'> 
    259279        <input type='hidden' name='product' value='".$item['name']."' /> 
    260280         
    261         <input type='hidden' name='cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' /></form></td> 
     281        <input type='hidden' name='cquantity' value='1' /><input type='text' name='quantity' value='".$item['quantity']."' size='1' onchange='document.pcquantity.submit();' onkeypress='document.getElementById(\"pinfo\").style.display = \"\";' /></form></td> 
    262282        <td style='text-align: center'>".output_currency(($item['price'] * $item['quantity']), $paypal_symbol, $decimal)."</td> 
    263283        <td><form method=\"post\"  action=\"\"> 
     
    331351 
    332352    } 
     353      else 
     354      { 
     355          $display  = get_option('quickshop_display'); 
     356            if ($display) 
     357            { 
     358                $displayt = get_option('quickshop_displayt'); 
     359                  $title = get_option('quickshop_title'); 
     360                  if (($title == '') || !$title ) $title = 'Your Shopping Cart'; 
     361                if (($displayt == '') || !$displayt ) $displayt = 'Your Shopping Cart is empty'; 
     362                echo $before_widget.'<div class="quickshopcart" style="padding: 5px;">'.$before_title . $title . $after_title.'<p>'.$displayt.'<p></div>'.$after_widget; 
     363            } 
     364      } 
    333365} 
    334366 
     
    345377{ 
    346378     
    347     $addcart = get_option('quickshop_add_cart'); 
     379    $addcart = get_option('quickshop_addcart'); 
    348380     
    349381    if (!$addcart || ($addcart == '') ) 
     
    391423 
    392424     echo '<div class="wrap"><h2>QuickShop Options</h2>'; 
    393      if ($_REQUEST['submitform']) { 
    394           //update_quickshop_options(); 
    395      } 
    396425     print_quickshop_form(); 
    397426     echo '</div>'; 
    398427 
    399 } 
    400  
    401 function update_quickshop_options() { 
    402      $updated = false; 
    403  
    404           update_option('quickshop_currency', $_REQUEST['currency']); 
    405           update_option('quickshop_churl', $_REQUEST['churl']); 
    406           update_option('quickshop_symbol', $_REQUEST['symbol']); 
    407           update_option('quickshop_decimal', $_REQUEST['decimal']); 
    408           update_option('quickshop_pemail', $_REQUEST['pemail']); 
    409           update_option('quickshop_add_cart', $_REQUEST['addcart']); 
    410           if (!$_REQUEST['total']) 
    411               $_REQUEST['total'] = 0; 
    412           if (!$_REQUEST['display']) 
    413               $_REQUEST['display'] = 0; 
    414           update_option('quickshop_display', $_REQUEST['display']); 
    415           update_option('quickshop_total', $_REQUEST['total']); 
    416           update_option('quickshop_location', $_REQUEST['location']); 
    417           update_option('quickshop_freeshipv', $_REQUEST['freeshipv']); 
    418           update_option('quickshop_freeshipt', $_REQUEST['freeshipt']); 
    419           $updated = true; 
    420       
    421  
    422      if ($updated) { 
    423            echo '<div id="message" class="updated fade">'; 
    424            echo '<p>Options Updated</p>'; 
    425            echo '</div>'; 
    426       } else { 
    427            echo '<div id="message" class="error fade">'; 
    428            echo '<p>Unable to update options</p>'; 
    429            echo '</div>'; 
    430       } 
    431428} 
    432429 
     
    442439    $defaultChURL = get_option('quickshop_churl'); 
    443440    if (!$defaultChURL || ($defaultChURL == '')) $defaultChURL = 'contact'; 
    444     $addcart = get_option('quickshop_add_cart'); 
    445     if (!$addcart || ($addcart == '')) $addcart = 'Add to Cart'; 
     441    $addcart = get_option('quickshop_addcart'); 
     442    if ($addcart == '') $addcart = 'Add to Cart'; 
    446443     
    447444    if (get_option('quickshop_display')) 
     
    463460    if (!$freeshipv || ($freeshipv == '')) $freeshipv = '0'; 
    464461    $freeshipt = get_option('quickshop_freeshipt'); 
    465     if (!$freeshipt || ($freeshipt == '')) $freeshipt = 'Shipping is free for orders of $200 and upwards.'; 
     462    if (($freeshipt == '') || !$freeshipt) $freeshipt = 'Shipping is free for orders of $200 and upwards.'; 
     463      $displayt = get_option('quickshop_displayt'); 
     464      if (($displayt == '') || !$displayt) $displayt = 'Your cart is empty.'; 
     465       
     466      $title = get_option('quickshop_title'); 
     467      if (($title == '') || !$title) $title = 'Your Shopping Cart'; 
    466468     
    467469 
     
    471473 echo ' 
    472474 <table class="form-table"> 
     475 <tr valign="top"> 
     476<th scope="row">Shopping Cart title</th> 
     477<td><input type="text" name="quickshop_title" value="'.$title.'"  /></td> 
     478</tr> 
    473479<tr valign="top"> 
    474480<th scope="row">Currency</th> 
     
    487493<tr valign="top"> 
    488494<th scope="row">Display Shopping Cart when Empty?</th> 
    489 <td><input type="checkbox" name="quickshop_display" value="1" '.$checked.' /></td> 
     495<td><input type="checkbox" name="quickshop_display" value="1" '.$checked.' /> - Text to display when empty: <input type="text" name="quickshop_displayt" value="'.$displayt.'" size="70" /></td> 
    490496</tr> 
    491497<tr valign="top"> 
     
    526532<tr valign="top"> 
    527533<th scope="row">Notification text</th> 
    528 <td><input type="text" name="quickshop_reeshipt" value="'.$freeshipt.'" size="100" /></td> 
     534<td><input type="text" name="quickshop_freeshipt" value="'.$freeshipt.'" size="100" /></td> 
    529535</tr> 
    530536</table> 
     
    533539<input type="submit" name="Submit" value="Update Options &raquo;" /> 
    534540<input type="hidden" name="action" value="update" /> 
    535 <input type="hidden" name="page_options" value="quickshop_currency,quickshop_churl,quickshop_symbol,quickshop_decimal,quickshop_pemail,quickshop_addcart,quickshop_total,quickshop_display,quickshop_location,quickshop_freeshipv,quickshop_freeshipt" /> 
     541<input type="hidden" name="page_options" value="quickshop_currency,quickshop_churl,quickshop_symbol,quickshop_decimal,quickshop_pemail,quickshop_addcart,quickshop_total,quickshop_display,quickshop_location,quickshop_freeshipv,quickshop_freeshipt,quickshop_displayt,quickshop_title" /> 
    536542</p> 
    537543 
    538544       
    539 <h3>Like what you see? Are you Australian?</h3> 
    540 <p><a href="http://ozedeals.biz">Please help support Zack Design and the author of Quick Shop by shopping online for hardware,  
    541 software, tuition, notebooks, and desktop PCs at our online site. We offer great prices and better support.</a></p> 
    542 <p>Not to mention we have also developed solutions for multiple monitors, seamless integration between  
    543 computer systems so you can control multiple systems at once, and more!</p> 
     545<h3>Do you like QuickShop?</h3> 
     546<h4>Websites</h4> 
     547<p>Zack Design has completed many websites, themes, and plugins. This one is free for you to use and has been perfected over countless hours. Please either <a href="http://zackdesign.biz/wp-plugins/34">donate</a> or <a href="http://zackdesign.biz/">consider using Zack Design for your next project!</a></p> 
     548<h4>Computers</h4> 
     549<p><a href="http://ozedeals.biz">ozEdeals.biz</a> is a new shop Zack Design has opened on-line using QuickShop for all to see. (Note: Shipping to Australian residents only)</p> 
     550<h4>VirtualBox, Synergy, more than 2 Desktop Monitors, Networks, Linux and more!</h4> 
     551<p>Zack Design knows all the tricks when it comes to setting up your office with multiple monitors, seamlessly integrating multiple PCs with different operating systems, virtual machines like VirtualBox for emulating Windows or Linux on your desktop, and can setup and configure wireless and wired networks as well as network servers easily. <a href="http://zackdesign.biz/contact">Contact us today to increase your productivity!</a></p> 
    544552 
    545553 </form> 
     
    566574function cart_has_items() 
    567575{ 
    568     if (get_option('quickshop_display')) 
    569         return 1; 
    570     else  
    571     { 
    572576        $count = 0; 
    573577        if (isset($_SESSION['qscart']) && is_array($_SESSION['qscart'])) 
     
    579583        else 
    580584            return 0; 
    581     } 
    582585} 
    583586 
  • quick-shop/trunk/readme.txt

    r45527 r46413  
    55Requires at least: 2.3 
    66Tested up to: 2.5 
    7 Stable tag: 1.3.4 
     7Stable tag: 1.3.5 
    88 
    99QuickShop has two shopping-cart widgets, automatically adds buttons to your posts, and includes a TinyMCE editor button. 
     
    102102== Latest Changes == 
    103103 
    104 Changelog: 
     1041.3.5 
     105 
     106- Fixed numerous bugs in admin section as well as adding the ability to change the widget title 
     107- Added javascript key checking and form submission to QTY changing field to make it less likely to fail - should work everywhere now! 
    105108 
    1061091.3.4