maxxam Posted December 10, 2004 Share Posted December 10, 2004 Creating a plugin isn't a required install step. You only need to do this if you don't like one of the four plugins provided or want to build a separate plug-in with code merged from another contribution. The manual is assuming you are familiar with classes in PHP and how one class gets extended by another. But I'm not a tech writer and realize I can make a lot of assumptions when I try to write technical directions so it still may not be clear. PM me or post with more detail on what you are trying to do and I'll see if I can help clarify things for you. <{POST_SNAPBACK}> When I try to look my product details in my shop I get this: Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/postissa/public_html/catalog/product_info.php on line 138 Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 10, 2004 Share Posted December 10, 2004 When I try to look my product details in my shop I get this: Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/postissa/public_html/catalog/product_info.php on line 138 <{POST_SNAPBACK}> This looks like the config.sql script was not run or failed for some reason. This script sets the initial configuration values in the database. PRODINFO_ATTRIBUTE_PLUGIN is one of the configuration values and should have been replaced with a plug-in name if the configuration value was in the database. Try running config.sql again. If it gets errors you can't sort out post again with the errors. Quote Link to comment Share on other sites More sharing options...
maxxam Posted December 10, 2004 Share Posted December 10, 2004 When I try to look my product details in my shop I get this: Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Warning: main(includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php): failed to open stream: No such file or directory in /home/postissa/public_html/catalog/product_info.php on line 138 Fatal error: main(): Failed opening required 'includes/classes/pad_PRODINFO_ATTRIBUTE_PLUGIN.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/postissa/public_html/catalog/product_info.php on line 138 <{POST_SNAPBACK}> "To select a product attribute display plugin and set the configuration options go to the admin site then select Configuration, Product Information from the left navigation menu." Product Information is not shown in admin. I think this is main problem.. Whitch file install it to admin? Quote Link to comment Share on other sites More sharing options...
royalfunk Posted December 10, 2004 Share Posted December 10, 2004 That's correct. <{POST_SNAPBACK}> I am still getting the same error message even after updating the pad_base.php file. Any other ideas? Thanks, Aaron Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 10, 2004 Share Posted December 10, 2004 I am still getting the same error message even after updating the pad_base.php file. Any other ideas? Thanks, Aaron <{POST_SNAPBACK}> Which plug-in are you using? Also, line 430 is in the middle of a comment block so I assume you must have modified pad_base.php. What are your mods? Would you post a couple of lines either side of line 430 so I can identify for sure what code is throwing the error. Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 10, 2004 Share Posted December 10, 2004 "To select a product attribute display plugin and set the configuration options go to the admin site then select Configuration, Product Information from the left navigation menu." Product Information is not shown in admin. I think this is main problem.. Whitch file install it to admin? <{POST_SNAPBACK}> You must run the config.sql script as described in the install section of the manual. See the bolded line below. There is not a web page that does it like the base osCommerce install. Be sure you have also run the new_install.sql script or the upgrade.sql script depending on your situation. If you don't have PHPadmin I highly recommend it. If you use the command line you must replace storedb in the instructions with the database name where you installed osCommerce. 1. Install osCommerce MS2 and verify it is functioning properly 2. Alter the database tables with the QT Pro new_install.sql script * Using PHPmyadmin, click on your store database, click on the SQL tab, enter the location of the QT Pro new_install.sql script and click go * Or using the command line "mysql storedb < new_install.sql". Make sure you specify the path to the QT Pro folder if needed. 3. Load the configuration data for QT Pro using the config.sql script using the PHPmyadmin or the command line as for new_install.sql 4. Apply the QT Pro code changes to the installation * Simply copy the contents of the QT Pro catalog folder to your store folder Quote Link to comment Share on other sites More sharing options...
royalfunk Posted December 11, 2004 Share Posted December 11, 2004 Here is my entire pade_base.php file. The only thing I changed is from what you suggested before. I hope I did it right.... <?php /* QT Pro Version 4.0 pad_base.php Contribution extension to: osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2004 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 ******************************************************************************** *********** QT Pro Product Attributes Display Plugin pad_base.php - Base Class Class Name: pad_base This base class, although functional, is not intended to be installed and used directly. It is extended by other classes to provide different display options for product attributes on the product information page (product_info.php). Methods: pad_base constructor _SetConfigurationProperties set local properties from DB config constants draw draw the product attributes _draw_table_start draw start of the table to enclose the attributes display _draw_stocked_attributes draw attributes that stock is tracked for _draw_nonstocked_attributes draw attributes that stock is not tracked for _draw_table_end draw end of the table to enclose the attributes display _draw_js_stock_array draw a Javascript array of in stock attribute combinations _build_attributes_array build an array of the attributes for the product _build_attributes_combinations build an array of the attribute combinations for the product Properties: products_id the product id for attribute display products_tax_class_id the products tax class id show_out_of_stock show out of stock attributes flag mark_out_of_stock mark out of stock attributes flag out_of_stock_msgline show out of stock message line flag no_add_out_of_stock prevent add to cart of out of stock attributes combinations */ class pad_base { var $products_id; var $products_tax_class_id; var $show_out_of_stock; var $mark_out_of_stock; var $out_of_stock_msgline; var $no_add_out_of_stock; /* Method: pad_base Class constructor Parameters: $products_id integer The product id of the product attributes are to be displayed for Returns: nothing */ function pad_base($products_id=0) { $this->products_id = $products_id; if ($this->products_id != 0) { $tax_class_query = tep_db_query('SELECT products_tax_class_id FROM ' . TABLE_PRODUCTS . " WHERE products_id = '" . (int)$products_id . "'"); $tax_class_array = tep_db_fetch_array($tax_class_query); $this->products_tax_class_id = $tax_class_array['products_tax_class_id']; } $this->_SetConfigurationProperties('PRODINFO_ATTRIBUTE_'); } /* Method: _SetConfigurationProperties Set local configuration properties from osCommerce configuration DB constants Parameters: $prefix sting Prefix for the osCommerce DB constants Returns: nothing */ function _SetConfigurationProperties($prefix) { $this->show_out_of_stock = constant($prefix . 'SHOW_OUT_OF_STOCK'); $this->mark_out_of_stock = constant($prefix . 'MARK_OUT_OF_STOCK'); $this->out_of_stock_msgline = constant($prefix . 'OUT_OF_STOCK_MSGLINE'); $this->no_add_out_of_stock = constant($prefix . 'NO_ADD_OUT_OF_STOCK'); } /* Method: draw Draws the product attributes. This is the only method other than the constructor that is intended to be called by a user of this class. Attributes that stock is tracked for are grouped first and drawn with one dropdown list per attribute. All attributes are drawn even if no stock is available for the attribute and no indication is given that the attribute is out of stock. Attributes that stock is not tracked for are then drawn with one dropdown list per attribute. Parameters: none Returns: string: HTML for displaying the product attributes */ function draw() { $out=$this->_draw_table_start(); $out.=$this->_draw_stocked_attributes(); $out.=$this->_draw_nonstocked_attributes(); $out.=$this->_draw_table_end(); return $out; } /* Method: _draw_table_start Draws the start of a table to wrap the product attributes display. Intended for class internal use only. Parameters: none Returns: string: HTML for start of table */ function _draw_table_start() { $out =' <table border="0" cellspacing="0" cellpadding="2">'; return $out; } /* Method: _draw_stocked_attributes Draws the product attributes that stock is tracked for. Intended for class internal use only. Attributes that stock is tracked for are drawn with one dropdown list per attribute. All attributes are drawn even if no stock is available for the attribute and no indication is given that the attribute is out of stock. Parameters: none Returns: string: HTML for displaying the product attributes that stock is tracked for */ function _draw_stocked_attributes() { $out = ''; $attributes = $this->_build_attributes_array(true, false); if (sizeof($attributes)>0) { foreach ($attributes as $stocked) { $out .= '<tr><td align="right" class="main">' . $stocked['oname'] . ":</td></tr><tr><td class=main>" . tep_draw_pull_down_menu('id['.$stocked['oid'].']',array_values($stocked['ovals']),$stocked['default']) . "</td></tr>\n"; } } return $out; } /* Method: _draw_nonstocked_attributes Draws the product attributes that stock is not tracked for. Intended for class internal use only. Attributes that stock is not tracked for are drawn with one dropdown list per attribute. Parameters: none Returns: string: HTML for displaying the product attributes that stock is not tracked for */ function _draw_nonstocked_attributes() { $out=''; $nonstocked_attributes = $this->_build_attributes_array(false, true); foreach($nonstocked_attributes as $nonstocked) { $out .= '<tr><td align="right" class=main><b>' . $stocked['oname'] . ":</b></td><td class=main>" . tep_draw_pull_down_menu('id['.$stocked['oid'].']',array_values($stocked['ovals']),$stocked['default']) . "</td></tr>\n"; } return $out; } /* Method: _draw_table_end Draws the end of a table to wrap the product attributes display. Intended for class internal use only. Parameters: none Returns: string: HTML for end of table */ function _draw_table_end() { return ' </table>'; } /* Method: _build_attributes_array Build an array of the attributes for the product Parameters: $build_stocked boolean Flag indicating if stocked attributes should be built. $build_nonstocked boolean Flag indicating if non-stocked attribute should be built. Returns: array: Array of attributes for the product of the form: 'oid' => integer: products_options_id 'oname' => string: products_options_name 'ovals' => array: option values for the option id of the form 'id' => integer: products_options_values_id 'text' => string: products_options_values_name 'default' => integer: products_options_values_id that the product id contains for this option id and should be the default selection when this attribute is drawn. Set to zero if the product id did not contain this option. */ function _build_attributes_array($build_stocked, $build_nonstocked) { global $languages_id; global $currencies; global $cart; if (!($build_stocked | $build_nonstocked)) return null; if ($build_stocked && $build_nonstocked) { $stocked_where=''; } elseif ($build_stocked) { $stocked_where="and popt.products_options_track_stock = '1'"; } elseif ($build_nonstocked) { $stocked_where="and popt.products_options_track_stock = '0'"; } $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$this->products_id . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' " . $stocked_where . " order by popt.products_options_name"); $attributes=array(); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$this->products_id . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($this->products_tax_class_id)) .')'; } } if (isset($cart->contents[$this->products_id]['attributes'][$products_options_name['products_options_id']])) $selected = $cart->contents[$this->products_id]['attributes'][$products_options_name['products_options_id']]; else $selected = 0; $attributes[]=array('oid'=>$products_options_name['products_options_id'], 'oname'=>$products_options_name['products_options_name'], 'ovals'=>$products_options_array, 'default'=>$selected); } return $attributes; } /* Method: _build_attributes_combinations A recursive method for building an array enumerating the attribute combinations for the product Parameters: $attributes array An array of the attributes that combinations will be built for. Format is as returned by _build_attributes_array. $showoos boolean Flag indicating if non-stocked attributes should be built. $markoos string 'Left' if out of stock indication is to be appended in front of the attribute combination text. 'Right' if out of stock indication is to be appended at the end of the attribute combination text. $combinations array Array of the attribute combinations is returned in this parameter. Should be set to an empty array before an external call to this method. 'comb' => array: array of a single attribute combination options_id => options_value_id 'id' => string: options/values string for this combination in the form for the key of the products_stock table opt_id-val_id,opt_id-val_id,... 'text' => string: Text for this combination. Values text is as built by _build_attributes_array and contains the add/subtract price for the option value if applicable. Form is: values_text, values_text $selected_combination integer Index into the $combinations array of the combination that should be the default selection when the combination is drawn is returned in this parameter. Determined from product id. Should be set to zero before an external call to this method. Parameters for internal recursion use only: $oidindex integer Index into the $attributes array of the option to operate on. $comb array Array containing option id/values of combination built so far products_options_id => products_options_value_id $id string Contains string of options/values built so far $text string Text for the options values constructed so far. $isselected boolean Flag indicating if so far all option values in this combination were indicated to be defaults in the product id. Returns: see $combinations and $selected_combination parameters above no actual function return value. */ function _build_attributes_combinations($attributes, $showoos, $markoos, &$combinations, &$selected_combination, $oidindex=0, $comb=array(), $id="", $text='', $isselected=true) { global $cart; foreach ($attributes[$oidindex]['ovals'] as $attrib) { $newcomb = $comb; $newcomb[$attributes[$oidindex]['oid']] = $attrib['id']; $newid=$id.','.$attributes[$oidindex]['oid'].'-'.$attrib['id']; $newtext = $text.", ".$attrib['text']; if (isset($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']])) $newisselected = ($cart->contents[$this->products_id]['attributes'][$attributes[$oidindex]['oid']] == $attrib['id']) ? $isselected : false; else $newisselected = false; if (isset($attributes[$oidindex+1])) { $this->_build_attributes_combinations($attributes, $showoos, $markoos, $combinations, $selected_combination, $oidindex+1, $newcomb, $newid, $newtext, $newisselected); } else { $is_out_of_stock=tep_check_stock(tep_get_prid($this->products_id),1,$newcomb); if (!$is_out_of_stock | ($showoos == true)) { switch ($markoos) { case 'Left': $newtext=($is_out_of_stock ? TEXT_OUT_OF_STOCK.' - ' : '').substr($newtext,2); break; case 'Right': $newtext=substr($newtext,2).($is_out_of_stock ? ' - '.TEXT_OUT_OF_STOCK : ''); break; default: $newtext=substr($newtext,2); break; } $combinations[] = array('comb'=>$newcomb, 'id'=>substr($newid,1), 'text'=>$newtext); if ($newisselected) $selected_combination = sizeof($combinations)-1; } } } } /* Method: _draw_js_stock_array Draw a Javascript array containing the given attribute combinations. Generally used to draw array of in-stock combinations for Javascript out of stock validation and messaging. Parameters: $combinations array Array of combinations to build the Javascript array for. Array must be of the form returned by _build_attributes_combinations Usually this array only contains in-stock combinations. Returns: string: Javacript array definition. Excludes the "var xxx=" and terminating ";". Form is: {optval1:{optval2:{optval3:1,optval3:1}, optval2:{optval3:1}}, optval1:{optval2:{optval3:1}}} For example if there are 3 options and the instock value combinations are: opt1 opt2 opt3 1 5 4 1 5 8 1 10 4 3 5 8 The string returned would be {1:{5:{4:1,8:1}, 10:{4:1}}, 3:{5:{8:1}}} */ function _draw_js_stock_array($combinations) { $out=''; foreach ($combinations[0]['comb'] as $oid=>$ovid) { $out.='{'.$ovid.':'; $opts[]=$oid; } $out.='1'; for ($combindex=1; $combindex<sizeof($combinations); $combindex++) { $comb=$combinations[$combindex]['comb']; for ($i=0; $i<sizeof($opts)-1; $i++) { if ($comb[$opts[$i]]!=$combinations[$combindex-1]['comb'][$opts[$i]]) break; } $out.=str_repeat('}',sizeof($opts)-1-$i).','; if ($i<sizeof($opts)-1) { for ($j=$i; $j<sizeof($opts)-1; $j++) $out.=$comb[$opts[$j]].':{'; } $out.=$comb[$opts[sizeof($opts)-1]].':1'; } $out.=str_repeat('}',sizeof($opts)); return $out; } } ?> Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 11, 2004 Share Posted December 11, 2004 Here is my entire pade_base.php file. The only thing I changed is from what you suggested before. I hope I did it right.... <{POST_SNAPBACK}> Unless I'm blind, the code change I posted earlier isn't in the code you posted. Quote Link to comment Share on other sites More sharing options...
royalfunk Posted December 11, 2004 Share Posted December 11, 2004 Sorry Ralph, I swear I added it but you are correct it doesn't show up. I went back intothe file and pasted in the new function, in whole as scripted in my earlier post. This is the error I get: Parse error: parse error, unexpected T_STRING in /home/username/public_html/store/includes/classes/pad_base.php on line 429 I know this means there is an extra bracket (or possibly not enough brackets), but I don't know where to make the change inside the function. This is the code for the full function: function _draw_js_stock_array($combinations) { if (!((isset($combinations)) && (is_array($combinations)) && (sizeof($combinations) > 0))){ ? ? ? ?return '{}'; ? ? ?} ? ? ?$out=''; ? ? ? ?foreach ($combinations[0]['comb'] as $oid=>$ovid) { ? ? ? ?$out.='{'.$ovid.':'; ? ? ? ?$opts[]=$oid; ? ? ?} ? ? ?$out.='1'; ? ? ? ? ? ?for ($combindex=1; $combindex<sizeof($combinations); $combindex++) { ? ? ? ?$comb=$combinations[$combindex]['comb']; ? ? ? ?for ($i=0; $i<sizeof($opts)-1; $i++) { ? ? ? ? ?if ($comb[$opts[$i]]!=$combinations[$combindex-1]['comb'][$opts[$i]]) break; ? ? ? ?} ? ? ? ?$out.=str_repeat('}',sizeof($opts)-1-$i).','; ? ? ? ?if ($i<sizeof($opts)-1) { ? ? ? ? ?for ($j=$i; $j<sizeof($opts)-1; $j++) ? ? ? ? ? ?$out.=$comb[$opts[$j]].':{'; ? ? ? ?} ? ? ? ?$out.=$comb[$opts[sizeof($opts)-1]].':1'; ? ? ?} ? ? ?$out.=str_repeat('}',sizeof($opts)); ? ? ? ? ? ?return $out; ? ?} ?} Quote Link to comment Share on other sites More sharing options...
sinryder Posted December 11, 2004 Share Posted December 11, 2004 hello Ralph Day, with your help the older version of QTP is working fine for me. The only thing i need now is the ablity to restock the order quantity when its deleted. Is their any way you can tell me the code that i can use with the older version. I dont wana install the whole script again. your help is greatly apprecaited Thankyou Quote Link to comment Share on other sites More sharing options...
sledp0rn Posted December 11, 2004 Share Posted December 11, 2004 Hi, I had the previous version of QTPro installed and managed to get it to fly. I did the upgrade to 4.0_1_2_3 and did the "fantasyland install" (no other mods...just copied files over). And now when I go to the product details I get the following error on products that have size/color options... ANything jump out as to what I screwed up with? I had to work bugs out of the first verios too, not knowing alot of what I was doing, but managed to get it to work. ********** 1054 - Unknown column 'popt.special' in 'field list' select distinct popt.products_options_id, popt.products_options_name, popt.special from products_options popt, products_attributes patrib where patrib.products_id='42' and patrib.options_id = popt.products_options_id and popt.language_id = '1' order by popt.products_options_name ******************* Thanks guys, and Ralph, I love the contribution. worked well for me until now :) Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 11, 2004 Share Posted December 11, 2004 hello Ralph Day, with your help the older version of QTP is working fine for me. The only thing i need now is the ablity to restock the order quantity when its deleted. Is their any way you can tell me the code that i can use with the older version. I dont wana install the whole script again. your help is greatly apprecaited Thankyou <{POST_SNAPBACK}> A database change is needed as well as code changes in a couple of places. Pull the ALTER TABLE orders_products out of new_install.sql and run it against your database. Find the line in checkout_process.php that sets the new column products_stock_attributes in table orders_products and apply to your older version. Use catalog/admin/includes/functions/general.php from QT Pro 4.0 I think that will do it. Good luck. Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 11, 2004 Share Posted December 11, 2004 Hi, I had the previous version of QTPro installed and managed to get it to fly. I did the upgrade to 4.0_1_2_3 and did the "fantasyland install" (no other mods...just copied files over). And now when I go to the product details I get the following error on products that have size/color options... ANything jump out as to what I screwed up with? I had to work bugs out of the first verios too, not knowing alot of what I was doing, but managed to get it to work. ********** 1054 - Unknown column 'popt.special' in 'field list' <{POST_SNAPBACK}> It looks like you are still running the QT Pro 3.1 version of product_info.php as popt.special was renamed to popt.products_options_track_stock in QT Pro 4.0. Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 11, 2004 Share Posted December 11, 2004 Sorry Ralph, I swear I added it but you are correct it doesn't show up. I went back intothe file and pasted in the new function, in whole as scripted in my earlier post. This is the error I get:Parse error: parse error, unexpected T_STRING in /home/username/public_html/store/includes/classes/pad_base.php on line 429 I know this means there is an extra bracket (or possibly not enough brackets), but I don't know where to make the change inside the function. This is the code for the full function: <{POST_SNAPBACK}> The code you posted looks fine so I think you must have inadvertently made another change to the code somewhere before this function or it got mangled in the upload/download. Your line numbers seem to be off too so that would also indicate a problem earlier in the code. Try downloading again. Quote Link to comment Share on other sites More sharing options...
royalfunk Posted December 11, 2004 Share Posted December 11, 2004 (edited) Ralph, Yes I had made one change in the code for the way the options were displayed, but it would not have had any effect on where the error is occuring. I re-downloaded from the Contribution site, made the exact change you mentioned earlier, and I still get the same error (only now it says line 432). Any suggestions? -Aaron Edited December 11, 2004 by royalfunk Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 11, 2004 Share Posted December 11, 2004 Ralph, Yes I had made one change in the code for the way the options were displayed, but it would not have had any effect on where the error is occuring. I re-downloaded from the Contribution site, made the exact change you mentioned earlier, and I still get the same error (only now it says line 432). Any suggestions? -Aaron <{POST_SNAPBACK}> I'd suspect a mismatched quote or something like that in your other change. Apply one change at a time and get it worrking before applying the next change. Line 432 is a comment in the QT Pro code. Quote Link to comment Share on other sites More sharing options...
sinryder Posted December 12, 2004 Share Posted December 12, 2004 Hello Ralph , thankx for replying. This is what i did so far Pull the ALTER TABLE orders_products out of new_install.sql and run it against your database. i added this ALTER TABLE orders_products ADD products_stock_attributes varchar(255) default NULL AFTER products_quantity; Find the line in checkout_process.php that sets the new column products_stock_attributes in table orders_products and apply to your older version. i added this whole code below. Only the Red code was missing in my older checkout_process.php file ++++ QT Pro: Begin Changed codeif (!isset($products_stock_attributes)) $products_stock_attributes=null; $sql_data_array = array('orders_id' => $insert_id, 'products_id' => tep_get_prid($order->products[$i]['id']), 'products_model' => $order->products[$i]['model'], 'products_name' => $order->products[$i]['name'], 'products_price' => $order->products[$i]['price'], 'final_price' => $order->products[$i]['final_price'], 'products_tax' => $order->products[$i]['tax'], 'products_quantity' => $order->products[$i]['qty'], 'products_stock_attributes' => $products_stock_attributes); ++++ QT Pro: End Changed Code Use catalog/admin/includes/functions/general.php from QT Pro 4.0 Replaced it with the new general.php Now this is the error i am getting when i add the item to my cart Fatal error: Call to undefined function: tep_check_stock_new() in /home2/mghatwor/public_html/test/shopping_cart.php on line 133 this is what i have on line 133 $stock_check = tep_check_stock_new($products[$i]['id'], $products[$i]['attributes'], $products[$i]['quantity']); thankyou soo much for your help Quote Link to comment Share on other sites More sharing options...
royalfunk Posted December 12, 2004 Share Posted December 12, 2004 (edited) I am in desperate need to get QTPro working. If anyone has the pad_base.php file working with RalphDay's addition to "function _draw_js_stock_array($combinations), please post the code here so I can test it on my site. I have made only this one recommended change to the code in that file, but it does not work and I am just getting error messages. Thanks!! -Aaron Edited December 12, 2004 by royalfunk Quote Link to comment Share on other sites More sharing options...
fixion Posted December 12, 2004 Share Posted December 12, 2004 tep_check_stock_new() - find that in qtpro40 source- make sure you have it (you do not have it - atleast not in the right place). Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 12, 2004 Share Posted December 12, 2004 Now this is the error i am getting when i add the item to my cart Fatal error: Call to undefined function: tep_check_stock_new() in /home2/mghatwor/public_html/test/shopping_cart.php on line 133 <{POST_SNAPBACK}> I think you replaced the wrong general.php. tep_check_stock_new was in catalog/includes/general.php in QT Pro 3.1 and earlier. I eliminated it in QT Pro 4.0 consolidating it into tep_check_stock. It looks like you replaced this general.php. You need to use the QT Pro 3.1 catalog/includes/general.php and replace admin/includes/general.php with the QT Pro 4.0 version. Quote Link to comment Share on other sites More sharing options...
sinryder Posted December 13, 2004 Share Posted December 13, 2004 I think you replaced the wrong general.php. tep_check_stock_new was in catalog/includes/general.php in QT Pro 3.1 and earlier. I eliminated it in QT Pro 4.0 consolidating it into tep_check_stock. It looks like you replaced this general.php. You need to use the QT Pro 3.1 catalog/includes/general.php and replace admin/includes/general.php with the QT Pro 4.0 version. <{POST_SNAPBACK}> AH MAN , YOU DA BEST :D thankyou soooo much its working. Quote Link to comment Share on other sites More sharing options...
coolcl Posted December 13, 2004 Share Posted December 13, 2004 Hi guys, I did some reading into this tread but I dind?t find answers so here are the questions. The installation works great but the first problem is that when I edit the Track Stock in the product options the option name disappears, (turn blank). The second error message is this one; ''Warning: OpenDir: Invalid argument (errno 22) in c:\apache\htdocs\shop\catalog\admin\includes\functions\general.php on line 681 Fatal error: Call to a member function on a non-object in c:\apache\htdocs\shop\catalog\admin\includes\functions\general.php on line 683'' It appear when I try to Edit the Product Info Attribute Display Plugin, I have double check the file but I don't see where the problem is. Also, for a product that has no options, the image of the product is in the middle of the page crushing into the description text. It is a great contribution and very needed. One more question if I may, why do we you must set the Download to false? Thank you, :thumbsup: ccl Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 13, 2004 Share Posted December 13, 2004 I am in desperate need to get QTPro working. If anyone has the pad_base.php file working with RalphDay's addition to "function _draw_js_stock_array($combinations), please post the code here so I can test it on my site. I have made only this one recommended change to the code in that file, but it does not work and I am just getting error messages. Thanks!! -Aaron <{POST_SNAPBACK}> royalfunk and I worked this out via PM. It appears that cut and paste of code snippets from this forum was causing some stray non-printable characters at the end of some lines - something that is very hard to notice. If you run into similar errors and are pulling your hair out try turning on the display of whitepsace characters in your editor and look for characters at the end of the line that shouldn't be there. Quote Link to comment Share on other sites More sharing options...
ralphday Posted December 13, 2004 Share Posted December 13, 2004 Hi guys, I did some reading into this tread but I dind?t find answers so here are the questions. The installation works great but the first problem is that when I edit the Track Stock in the product options the option name disappears, (turn blank). <{POST_SNAPBACK}> Are you merging QT Pro with another contribution? I've been working on merging QT Pro with a loaded version of osCommerce that contains Attribute Sorter/Copier and ran into a similar problem at first. Attribute Sorter/Copier is a challenge to merge as it was based on a development version of MS2 and a bunch of variable names and code cleanup was done for the final MS2 version. The second error message is this one;''Warning: OpenDir: Invalid argument (errno 22) in c:\apache\htdocs\shop\catalog\admin\includes\functions\general.php on line 681 Fatal error: Call to a member function on a non-object in c:\apache\htdocs\shop\catalog\admin\includes\functions\general.php on line 683'' It appear when I try to Edit the Product Info Attribute Display Plugin, I have double check the file but I don't see where the problem is. <{POST_SNAPBACK}> The only thing I can think of is a configuration problem. Can you post the defines for DIR_FS_CATALOG, DIR_WS_INCLUDES and DIR_WS_CLASSES from admin/includes/configure.php Also, for a product that has no options, the image of the product is in the middle of the page crushing into the description text.It is a great contribution and very needed. <{POST_SNAPBACK}> I never noticed that before. I made a slight tweak to the HTML in product_info.php to make the options always display below the image to prevent problems with the option display when descriptions are short. It introuduced this problem. The problem you describe doesn't occur for products with no options, its products with short description lines. I'll have to play with the HTML a little bit and post back later. One more question if I may, why do we you must set the Download to false? <{POST_SNAPBACK}> The original author of QT Pro made this restriction in the code. The download logic is slightly confusing and since I don't need downloads I haven't sorted it out yet to fix it. But I've been informed that the Gift Vouchers contribution requires download = true and I want to use that contributions so expect to see this fixed soon. Quote Link to comment Share on other sites More sharing options...
coolcl Posted December 13, 2004 Share Posted December 13, 2004 (edited) Are you merging QT Pro with another contribution?? I've been working on merging QT Pro with a loaded version of osCommerce that contains Attribute Sorter/Copier and ran into a similar problem at first.? Attribute Sorter/Copier is a challenge to merge as it was based on a development version of MS2 and a bunch of variable names and code cleanup was done for the final MS2 version.? The only thing I can think of is a configuration problem.? Can you post the defines for DIR_FS_CATALOG, DIR_WS_INCLUDES and DIR_WS_CLASSES from admin/includes/configure.php I never noticed that before.? I made a slight tweak to the HTML in product_info.php to make the options always display below the image to prevent problems with the option display when descriptions are short.? It introuduced this problem. The problem you describe doesn't occur for products with no options, its products with short description lines.? I'll have to play with the HTML a little bit and post back later. The original author of QT Pro made this restriction in the code.? The download logic is slightly confusing and since I don't need downloads I haven't sorted it out yet to fix it.? But I've been informed that the Gift Vouchers contribution requires download = true and I want to use that contributions so expect to see this fixed soon. <{POST_SNAPBACK}> The first problem is solve, it was my testing server. About the "Product Info Attribute Display Plug-in" I am now getting this message; Fatal error: Call to undefined function: tep_cfg_pull_down_class_files() in /home/dison99/public_html/secure/testing_site/shopnature/catalog/admin/configuration.php(125) : eval()'d code on line 1 Here's the defines: define('DIR_FS_CATALOG', '/home/hooo/public_html/secure/testing_site/shop/catalog/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); I understand about the images, what can I do to temper the problem? And finally we work allot with the Gift Vouchers option, so I guest I will have the hold this great QTpro for a while! I thank you very much for your answers, this is very professional. ccl Edited December 13, 2004 by coolcl Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.