Latest News: (loading..)

LeeFoster

Members
  • Content count

    99
  • Joined

  • Last visited

  • Days Won

    1

LeeFoster last won the day on February 13 2016

LeeFoster had the most liked content!

1 Follower

About LeeFoster

Profile Information

  • Real Name
    Lee Foster
  1. I'm still looking for help changing single radio sets to multiple much like the single/multiple drop downs. Can anyone help?
  2. I got as far as the code below but it only shows one radio button for each attribute and no labels. I know I'm missing a for each loop but not sure how or where to put it. <?php /* QT Pro Version 5.0 pad_multiple_radioset.php Contribution extension to: osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004, 2005 Ralph Day Released under the GNU General Public License Based on prior works released under the GNU General Public License: QT Pro prior versions Ralph Day, October 2004 Tom Wojcik aka TomThumb 2004/07/03 based on work by Michael Coffman aka coffman FREEZEHELL - 08/11/2003 freezehell@hotmail.com Copyright (c) 2003 IBWO Joseph Shain, January 2003 osCommerce MS2 Copyright (c) 2003 osCommerce Modifications made: 11/2004 - Created 12/2004 - Fix _draw_out_of_stock_message_js to add semicolon to end of js stock array 03/2005 - Remove '&' for pass by reference from parameters to call of _build_attributes_combinations. Only needed on method definition and causes error messages on some php versions/configurations ******************************************************************************************* QT Pro Product Attributes Display Plugin pad_multiple_radioset.php - Display stocked product attributes first as one dropdown for each attribute. Class Name: pad_multiple_radioset This class generates the HTML to display product attributes. First, product attributes that stock is tracked for are displayed, each attribute in its own dropdown list. Then attributes that stock is not tracked for are displayed, each attribute in its own dropdown list. Methods overidden or added: _draw_stocked_attributes draw attributes that stock is tracked for _draw_out_of_stock_message_js draw Javascript to display out of stock message for out of stock attribute combinations */ require_once('includes/classes/pad_multiple_dropdowns.php'); class pad_multiple_radioset extends pad_multiple_dropdowns { /* Method: _draw_stocked_attributes draw dropdown lists for attributes that stock is tracked for Parameters: none Returns: string: HTML to display dropdown lists for attributes that stock is tracked for */ function _draw_stocked_attributes() { global $languages_id, $currencies; $out = ''; $attributes = $this->_build_attributes_array(true, false); if (sizeof($attributes)>0) { for($o = 0; $o < sizeof($attributes); $o++) { $s = sizeof($attributes[$o]['ovals']); for ($a = 0; $a < $s; $a++) { $attribute_stock_query = tep_db_query("select products_stock_quantity from products_stock where products_id = '" . (int)$this->products_id . "' AND products_stock_attributes REGEXP '(^|,)" . (int)$attributes[$o]['oid'] . "-" . (int)$attributes[$o]['ovals'][$a]['id'] . "(,|$)' AND products_stock_quantity > 0"); $out_of_stock = (tep_db_num_rows($attribute_stock_query) == 0); if(MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_ATTRIBUTE_ACTUAL_PRICE_PULL_DOWN == 'True') { $attributes[$o]['ovals'][$a]['text'] .= ' ' . $currencies->display_price( $attributes[$o]['ovals'][$a]['price'] + $this->products_original_price, tep_get_tax_rate($this->products_tax_class_id)); } if ($out_of_stock && ($this->show_out_of_stock == 'True')) { switch ($this->mark_out_of_stock) { case 'Left': $attributes[$o]['ovals'][$a]['text'] = MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK . ' - ' . $attributes[$o]['ovals'][$a]['text']; break; case 'Right': $attributes[$o]['ovals'][$a]['text'] .= ' - ' . MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK; break; } } elseif ($out_of_stock && ($this->show_out_of_stock != 'True')) { unset($attributes[$o]['ovals'][$a]); } } $out .= '<div class="col-md-3">' . "\n"; $out .= '<strong>' . $attributes[$o]['oname'] . ':</strong>' . "\n"; $out .= '</div>' . "\n"; $out .= '<div class="col-md-9">' . "\n"; $out .= tep_draw_radio_field('id[' . $attributes[$o]['oid'] . ']',array_values($attributes[$o]['ovals']),$attributes[$o]['default'], "onchange=\"stkmsg(this.form);\"") . "\n"; $out .= '</div>' . "\n"; } $out .= $this->_draw_out_of_stock_message_js($attributes); return $out; } } /* Method: _draw_out_of_stock_message_js draw Javascript to display out of stock message for out of stock attribute combinations Parameters: $attributes array Array of attributes for the product. Format is as returned by _build_attributes_array. Returns: string: Javascript to display out of stock message for out of stock attribute combinations */ function _draw_out_of_stock_message_js($attributes) { $out = ''; $out .= '<span id="oosmsg" class=text-danger></span>' . "\n"; if (($this->out_of_stock_msgline == 'True' | $this->no_add_out_of_stock == 'True')) { $out .= '<SCRIPT><!--' . "\n"; $combinations = array(); $selected_combination = 0; $this->_build_attributes_combinations($attributes, false, 'None', $combinations, $selected_combination); $out .= " function chkstk(frm) {\n"; // build javascript array of in stock combinations $out .= " var stk=".$this->_draw_js_stock_array($combinations).";\n"; $out .= " var instk=false;\n"; // build javascript if statement to test level by level for existance $out .= ' '; for ($i=0; $i<sizeof($attributes); $i++) { $out .= 'if (stk'; for ($j = 0; $j <= $i; $j++) { $out .= "[frm['id[".$attributes[$j]['oid']."]'].value]"; } $out .= ') '; } $out .= "instk=true;\n"; $out .= " return instk;\n"; $out .= " }\n"; if ($this->out_of_stock_msgline == 'True') { // set/reset out of stock message based on selection $out .= " function stkmsg(frm) {\n"; $out .= " var instk=chkstk(frm);\n"; $out .= " var span=document.getElementById(\"oosmsg\");\n"; $out .= " while (span.childNodes[0])\n"; $out .= " span.removeChild(span.childNodes[0]);\n"; $out .= " if (!instk)\n"; $out .= " span.appendChild(document.createTextNode(\"".MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK_MESSAGE."\"));\n"; $out .= " else\n"; $out .= " span.appendChild(document.createTextNode(\" \"));\n"; $out .= " }\n"; //initialize out of stock message $out .= " stkmsg(document.cart_quantity);\n"; } if ($this->no_add_out_of_stock == 'True') { // js to not allow add to cart if selection is out of stock $out .= " function chksel() {\n"; $out .= " var instk=chkstk(document.cart_quantity);\n"; $out .= " if (!instk) alert('".MODULE_CONTENT_PRODUCT_INFO_QTPRO_OPTIONS_OUT_OF_STOCK_MESSAGE."');\n"; $out .= " return instk;\n"; $out .= " }\n"; $out .= " document.cart_quantity.onsubmit=chksel;\n"; } $out .= "//--></SCRIPT>\n"; } return $out; } } ?>
  3. Has anyone had chance to look in to multiple radio buttons instead of dropdowns?
  4. I managed to get this to work as much as I needed it to. I will upload the instructions at some point in the near future for anyone that is interested.
  5. Does this work with QTPro?
  6. @@burt I'm wanting this in the admin section so that when I click on the catalog box instead of having categories/products as an option I have categories and products as 2 separate options. Clicking categories takes me to a list of categories and subcategories and clicking products takes me to a list of all products. Does that make more sense?
  7. I mean have one page for categories/subcategories and one page for products rather than having to go in to a category then the subcategory then to the product. Like a master product list or master category list. I'm using 2.3.4 bootstrap
  8. Hi, Does any one know of an addon that will allow me to split out the category and product pages? Thanks
  9. @@joe122joe Post your application_top.php file
  10. I missed this step when I did my first install and had issues. Once installed everything worked fine. @@joe122joe, it's probably worth you doing the same
  11. I thought as much. I've hard coded the currency symbol in for now and will revisit this at a later date.
  12. But this isn't happening on the main site and they both use the same data don't they? I'll have a look tonight though
  13. Viewing the source says utf-8
  14. On any page where there is a value. It appears to be the encoding but the pages, database and the meta are all setup the same.
  15. I am now getting a ? in black diamond instead of £. I have checked for the usual suspects but still not working. Any ideas?