Jump to content


  • Content count

  • Joined

  • Last visited

Profile Information

  • Real Name
    Ralph Day
  1. I'm sorry to announce I will no longer be supporting this contribution or monitoring this thread. I have decided another shopping cart meets my needs better. Hopefully, someone else will pick up support of this contribution or a similar feature will appear in base osCommerce soon. Ralph Day
  2. In product_info.php you can add whatever you want for products without attributes like this: if ($products_attributes['total'] > 0) { //++++ QT Pro: Begin Changed code $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']); require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php'); $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN; $pad = new $class($products_id); echo $pad->draw(); //++++ QT Pro: End Changed Code //+++ Above code is part of qtpro already. Changes below for products without attributes } else { Put code here for products without attributes. } You can check the stock for the product by testing $product_info['products_quantity']. If its less than 1 output some HTML to tell the customer. You can also output some JS for a popup if the customer tries to add it to the cart. Something like this: $out="<script LANGUAGE=\"JavaScript\"><!--\n"; $out.=" document.cart_quantity.onsubmit=alert('".TEXT_OUT_OF_STOCK_MESSAGE."');\n"; $out.="//--></SCRIPT>\n"; echo $out; You could actually make the add to cart button go away, but thats more work and will be left as an exercise for the reader.
  3. Note that this is NOT a problem introduced by QT Pro. This is a base osCommerce problem. QT Pro only adds attribute inventory tracking, it doesn't attempt to change the inventory stock check points in the base code. osCommerce really needs to use database transactions at a minimum around key updates to avoid things like this and to avoid internal database inconsistencies when errors occur.
  4. Did you wrap the multiple lines in braces? Like this: $out.=" if (!instk) {\n"; $out.=" span.appendChild(document.createTextNode(\"".TEXT_OUT_OF_STOCK_MESSAGE."\"));\n"; $out.=" span.appendChild(document.createTextNode(\"Please \"));\n"; $out.=" anchor=document.createElement(\"A\"));\n"; $out.=" anchor.href=\"http://overtherainbow.com\";\n"; $out.=" anchor.appendChild(document.createTextNode(\"click here\"));\n"; $out.=" span.appendChild(anchor);\n"; $out.=" span.appendChild(document.createTextNode(\" for more info\"));\n"; $out.=" } else\n"; - Ralph
  5. Try appending the message in 3 pieces: a text node, an anchor node and another text node. Something like: $out.=" span.appendChild(document.createTextNode(\"Please \"));\n"; $out.=" anchor=document.createElement(\"A\"));\n"; $out.=" anchor.href=\"http://overtherainbow.com\";\n"; $out.=" anchor.appendChild(document.createTextNode(\"click here\"));\n"; $out.=" span.appendChild(anchor);\n"; $out.=" span.appendChild(document.createTextNode(\" for more info\"));\n"; If you want the link to open in a new window you can set the target property of the anchor. My waist is already too big!
  6. This is a base osCommerce problem. There is another contribution for attribute sorting. It can be merged with QT Pro though it gets a little tricky, particularly in products_attributes.php because it was built on a pre-MS2 final version of osCommerce.
  7. Merging QT Pro with Option isn't straightforward. Different control types take different Javascript to do stock checking for one thing. What if a text box is spedified for an option that stock is tracked for? In other words, there are some design issues to be thought out before the merge can happen. As for hacking product_info, the plugin is called with this code in product_jnfo.php: require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php'); $class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN; $pad = new $class($products_id); echo $pad->draw(); PRODINFO_ATTRIBUTE_PLUGIN comes from the configuration you do in the admin site. You can change the above to something like this: if (whatever you want) { $plugin = "some plugin"; } else { $plugin = PRODINFO_ATTRIBUTE_PLUGIN; } require(DIR_WS_CLASSES . 'pad_' . $plugin . '.php'); $class = 'pad_' . $plugin; $pad = new $class($products_id); echo $pad->draw(); It looks like category isn't already available in product_info.php so you'd have to run a query to get the categories a product is in. Or maybe easier SELECT * FROM TABLE_PRODUCTS_TO_CATEGORIES WHERE products_id=xxx AND categories_id in (cat1,cat2,...) and test if any rows are returned.
  8. Sorry, only one plugin sitewide. Its an enhancement I thought would we be good - override the plugin at the category or product level. But I don't think I'll get the time to do it. You could probably hack your product.php to look at the category and call the plugin you want for that category pretty easily. A mix of plugins within a single product would be a fair chunk of work.
  9. If you have verified that column 'products_options_track_stock' exists in the products_options table, then your osC store must be using a different database than you ran the SQL against.
  10. new_install.sql is for an existing store without a previous version of QT Pro installed whether or not it already has products loaded. I highly recommend installing it in a test instance of your store first.
  11. If you look at this change to html_output.php it makes it so that it can never draw a selected radio button or checked check box. And since its a function used everywhere its guaranteed to break lots of things besides QT Pro. This is very bad and there seems to be no good reason for it. I think the author didn't know how to pass a false value to tep_draw_checkbox_field and in trying to work around it for the delete checkboxes in the cart broke all checkbox and radioset selections. Try this: 'text' => tep_draw_checkbox_field('cart_delete[]', $products[$i]['id'], false, 'onClick="DoSubmission();"')); instead of the code the author provided and don't make the changes to html_output.php and I think it will work just fine and not break QT Pro and every other radioset and checkbox in osCommerce.
  12. Doh! I've been working too many hours lately. Yes, you did say *radiosets* which can be left unselected. QT Pro will automatically select the first option in the radioset when product_info isn't invoked from the cart and it will select the option corresponding to the item clicked on if invoked from the cart. This is handled in the pad_singleradioset plugin _draw_stocked_attributes method. This line of code draws each selection in the radioset: $out.=tep_draw_radio_field('attrcomb', $combinations[$combindex]['id'], ($combindex==$selected_combination)) . $comb['text']; When ($combindex==$selected_combination) evaluates to true tep_draw_radio_field adds CHECKED to the input type="radio" html tag causing that option to be the selected option. $combindex is the index into the array of options being built starting at zero. Earlier in the code $selected_combination is set to zero then _build_attribute_combinations is called which updates it to the correct value if the page was linked to from the cart. If it didn't come from the cart its left alone at zero so that the first option is selected. An easy fix to make sure an option is selected but that will break the selecting of the correct option when linked to from the cart is to replace ($combindex==$selected_combination) with true. This adds CHECKED to all options. The browser will recognize it as nonsense that all options in a radioset can be selected and select only the first one.
  13. There is no code to post. Either you have setup a color with a blank name that is showing up in your dropdown or you have tweaked _draw_stocked_attributes in one of the pad_... plugins to make it generate an extra entry at the beginning of the dropdown.
  14. There is always an item selected in a dropdown list. You must have a blank option in your list.
  15. Depends on which dropdown. For multiple dropdowns look at catalog/includes/classes/pad_multiple_dropdowns. In method _draw_stocked_attributes the dropdown html is generated. It includes an onchange to call a javascript function stkmsg to display an out of stock message if the selected combination is out of stock. You can change that to call your javascript and have your javascript call stkmsg. If its the single dropdown look at catalog/includes/classes/pad_single_dropdown. In method _draw_stocked_attributes the dropdown html is generated. It does not have an onchange. Add your onchange to it. Look at pad_multiple_dropdowns for an example of how that is done.