Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Anonymous
Monday, May 14th, 2012 at 3:01:58pm MDT 

  1. <?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
  2. mm_showMyFileName(__FILE__);
  3. /** This template is used for the quantity box arrangement of products, within the add-to-cart form */
  4.  
  5. extract( $quantity_options );
  6.  
  7. $html = '';
  8. if(!$child && $display_type != 'hide') {
  9.         $html = '<label for="quantity'.$prod_id.'" class="quantity_box">'.$VM_LANG->_('PHPSHOP_CART_QUANTITY').':&nbsp;</label>';
  10. }
  11. switch($display_type) {
  12.         case "radio" : //Radio Box
  13.                 $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" />';
  14.                 $html .= '<input type="radio" class="quantitycheckbox" id="selItem'.$prod_id.'" name="selItem" value="0" ';
  15.                 if ($quantity > 0 ) {
  16.                         $html .= 'checked="checked" ';
  17.                 }
  18.                 $html .= 'onclick="alterQuantity(this.form)" />';
  19.                 break;
  20.         case "hide" : // Hide box - but set quantity to 1!
  21.                 $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="1" />';
  22.                 break;
  23.         case "check" :
  24.                 $html .= '<input type="hidden" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" style="vertical-align: middle;"/>
  25.                 <input type="checkbox" class="quantitycheckbox" id ="selItem'.$id.'" name="check[]" ';
  26.                 if ($quantity > 0 ) {
  27.                         $html .= 'checked="checked"';
  28.                 }
  29.                 $html .= ' value="1" onclick="javascript: if(this.checked==true) document.getElementById(\'quantity'.$prod_id.'\').value = 1; else {document.getElementById(\'quantity'.$prod_id.'\').value=0;} "/> ';
  30.                 break;
  31.         case "drop" :
  32.                 $code = '<select class="inputboxquantity" id="quantity'.$prod_id.'" name="quantity[]">';
  33.                 for($i=$quantity_start;$i<$quantity_end+1;$i += $quantity_step) {
  34.                         $code .= '  <option value="'.$i.'"';
  35.                         if ($i == $quantity) {
  36.                                 $code .= ' selected="selected"';
  37.                         }
  38.                         $code .= '>'.$i."</option>\n";
  39.                 }
  40.                 $code .= "</select>\n";
  41.                 $html .= $code;
  42.                 break;
  43.         case "none" :
  44.         default:
  45.                 $html .= '<input type="text" class="inputboxquantity" size="4" id="quantity'.$prod_id.'" name="quantity[]" value="'.$quantity.'" />
  46.                 <input type="button" class="quantity_box_button quantity_box_button_up" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty )) qty_el.value++;return false;" />
  47.                 <input type="button" class="quantity_box_button quantity_box_button_down" onclick="var qty_el = document.getElementById(\'quantity'.$prod_id.'\'); var qty = qty_el.value; if( !isNaN( qty ) &amp;&amp; qty > 0 ) qty_el.value--;return false;" />
  48.                 ';                       
  49.                 break;
  50. }
  51. echo $html;
  52. ?>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation