Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ralphday

Archived
  • Posts

    230
  • Joined

  • Last visited

Everything posted by ralphday

  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.
  16. This contribution would just complicate what you are trying to do. I think I would set up a downloadable product using base osC. Then tweak the download section of checkout_process.php to use the file name in the products_attributes_download, generate the next file name, save it back to products_attributes_download and decrement the stock. If your file names have a prefix followed by a sequential number this should be pretty easy. You'll need to tweak product_info.php to change the option dropdown to a hidden field as well.
  17. Stock is not tracked for downloadable products with QT Pro just like in base osCommerce. This would require mods in several places as the stock reduction/addition is somewhat scattered about in osCommerce.
  18. Nice catch. That's definitely a bug. I'll have to work up a test case to replicate your problem and get a patched version out when I get a breather from holiday ramp up. Thanks for the kind words on the class structure. Good luck with your site.
  19. tep_check_stock()/tep_get_products_stock() don't care what order the attributes are in the array passed to them. The SQL products_options_id in ($options_list) doesn't care about order and the order by products_options_id gets things in the right order to build the key to the products_stock table. And as you noticed non-stocked attributes are filtered out when building the key to the products_stock table. The wild stuff is building the attribute combinations. A recursive call is required to build the attribute combinations because its unknown how many attributes a product has and SQL just doesn't handle that. I'm puzzled as to what your problem is. I have some pretty good test cases for combinations of stocked and non-stocked options. The only thing I can think of is an option was added as a stocked option, stock was added using it and then the option was changed to non-stocked. That would leave an orphan entry in the products_stock table that can fool the logic in pad_sequenced_dropdowns that might allow it to add an out of stock attribute combination to the cart. I actually think it would behave differently though. And it sounds like you are dealing with an attribute combination that is in stock.
  20. Sorry, but it isn't easy to add the QT Pro code to the add_mult section and you will need to change other code elsewhere too. As I head into my busy season I don't have the time to dig into the code and help. Unless you are using the add multiple products to the cart from a product page feature, I'd suggest you change add_mult to add_product on the product information page.
  21. It looks like you have other contribs applied. One has changed the form tag to: <form name="cart_quantity" action="http://www.parfumary.com/creed-himalaya-p-309.html?action=add_mult&osCsid=90359d0849aaade238778bdfcdeb07f5" method="post"> Regular osC has action=add_product. You have two choices: Change back to add_product Fix the code in application_top that handles the add_mult action to incorporate the same changes QT Pro makes to add_product. Triple check your applicaito of the mods - it sounds like you might be getting a PHP error. Also, check your error log for errors.
  22. Check to be sure you have properly applied the QT Pro changes to application_top.php.
  23. Your screenshot seems to show the original osC admin/products_attributes.php, not the QT Pro modified version. You also appear to be using a non-standard install as your URL is ...backendpar/products_attributes.php and not ...admin/products_attributes.php. Be sure you have QT Pro installed in the correct directory and/or are testing in the proper directory.
  24. It sounds like you haven't set Track Stock to yes for any options.
  25. I'm not sure exactly what you are asking. If you want another option (like show quantity available) added to the admin page for Product Information (where you select the plugin) then take a look at the config.sql file that comes with QT Pro. If you just want to add your plugin to the selection on that page just name it pad_something and put it in catalog/includes/classes and it will show up automagically.
×
×
  • Create New...