Jump to content

ecartz

♥Ambassador
  • Content count

    2,899
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by ecartz

  1. ecartz

    Part number direct to basket?

    There was a contribution called something like "Add a Quickie." The code I used with MS2 was includes/boxes/quick_order.php : <?php /* $Id: add_a_quickie.php,v 1.10 2001/12/19 01:37:55 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2001 osCommerce Released under the GNU General Public License */ ?> <!-- Quick Order //--> <tr> <td> <table width="144" border="0" cellspacing="0" cellpadding="1" class="infoboxborder"> <tr> <td> <table width=100% border=0 cellpadding=0 cellspacing=0 class="infoBoxContents"> <tr> <td colspan=3 width="100%"> <img src="images/boxes/table_quickie.jpg"></td> </tr> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('form' => '<form name="quick_add" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=quick_order', 'NONSSL') . '">', 'align' => 'left', 'text' => '<div align="center"><input type="text" name="quick_prod" size="10"> ' . tep_image_submit('button_add_quick.gif', BOX_HEADING_ADD_PRODUCT_ID) . '</div>' . BOX_ADD_PRODUCT_ID_TEXT ); new infoBox($info_box_contents); ?> </td> </tr> </table> </td> </tr> </table> </td> </tr> <!-- Quick Order eof //--> and the following action case added to includes/application_top.php : case 'quick_order' : if (isset($HTTP_POST_VARS['quick_prod'])) { $id_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_model = '" . tep_db_input($HTTP_POST_VARS['quick_prod']) . "'"); if ($id = tep_db_fetch_array($id_query)) { if (tep_has_product_attributes($id['products_id'])) { tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $id['products_id'])); } else { $cart->add_cart($id['products_id'], $cart->get_quantity($id['products_id'])+1); } } } tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters))); break; Hth, Matt
  2. ecartz

    YASU

    $link .= preg_replace(array('/%2F/', '/+/'), array('%20', '-'), implode('/', $cPath_list)); should be $link .= preg_replace(array('/%2F/', '/[+]/'), array('%20', '-'), implode('/', $cPath_list)); Hth, Matt
  3. ecartz

    YASU

    To change + signs into dashes, change the following line from html_output.php $link .= preg_replace('/%2F/', '%20', implode('/', $cPath_list)); to $link .= preg_replace(array('/%2F/', '/+/'), array('%20', '-'), implode('/', $cPath_list)); In rewrite.php, change $piece = urldecode(preg_replace(array('/[+]/', '/%20/'), array(' ', '%2F'), $piece_encoded)); to $piece = urldecode(preg_replace(array('/-/', '/%20/'), array(' ', '%2F'), $piece_encoded)); Or more generally, $piece = urldecode(preg_replace(array('/[+]/', '/%20/'), array('_', '%2F'), $piece_encoded)); and change the SQL queries to use LIKE rather than =. For example, $category_query = tep_db_query("select cd.categories_id from categories_description cd, categories c where cd.categories_id=c.categories_id and cd.categories_name='" . tep_db_input($piece) . "' and c.parent_id='" . (int)$current_category_id . "'"); would become $category_query = tep_db_query("select cd.categories_id from categories_description cd, categories c where cd.categories_id=c.categories_id and cd.categories_name like '" . tep_db_input($piece) . "' and c.parent_id='" . (int)$current_category_id . "'"); as the _ will match any character when used this way. Hth, Matt
  4. ecartz

    Master Products - MS2

    They are just saying that it is likely that you missed some changes to application_top.php that need to be made. I would recommend using a file comparer to compare your file to the one that comes with the contribution. I use ExamDiff and Matti uses Beyond Compare. Either should work for your needs. ExamDiff has a free beer version; I think that Beyond Compare is only available for free as a 30 day trial. Hth, Matt
  5. ecartz

    Master Products - MS2

    I'm pretty sure that if you have two rows in Easy Populate with the same products_model but different category paths that it creates a linked product automatically. Same deal if you just change a category path in a row, it adds the product to the new category as a link. The issue with duplicate products_model values in an Easy Populate file is that all the rest of the data will get overwritten (product name, description, price, etc.). However, in the case of a link, that's what you want to happen, so it's not a problem. Hth, Matt
  6. ecartz

    Master Products - MS2

    You can use copy as link (rather than duplicate) on the Master Product, and the slaves will show under the master in both categories. Copy as link on slave products would require a pretty complete rewrite of the slave/master association mechanism. Hth, Matt
  7. ecartz

    Master Products - MS2

    echo TEXT_QUANTITY . ' ' . tep_draw_input_field('Qty_ProdId_' . $product_info['products_id'], '', 'size="4"'); With a period, not a comma, between the 'Qty_ProdId_' and the $product_info['products_id'], and it needs to have something (a blank string here) entered for the initial value to push the parameters string to the proper place. To make the master show rather than the slave, you could try replacing p.products_id with IF((p.products_master > 0), p.products_master, p.products_id) as products_id in the column lists (between select and from) of all the tep_db_query calls. E.g. in whats_new.php: if ($random_product = tep_random_select("select IF((p.products_master > 0), p.products_master, p.products_id) as products_id, products_image, products_tax_class_id, products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_RANDOM_SELECT_NEW)) { that might produce the effect that you want. Hth, Matt
  8. I would check that the MessageStack class is available. If not, you should comment out the lines using it. Hth, Matt
  9. ecartz

    easy populate with 3 image contrib?

    $query .= . $v_products_mimage . '", "') should be $query .= $v_products_mimage . '", "') Hth, Matt
  10. ecartz

    Virtual Mall 1.2 Support Thread

    I have installed it both ways, but it is intended to be installed first. You may still have to make some changes after the install. Hth, Matt
  11. Can't you just upload the same products_model with two category paths? I.e. two lines that are identical except for the category paths? Hth, Matt
  12. ecartz

    Virtual Mall 1.2 Support Thread

    No, that's how it is supposed to work when you have a store ID set for the login. I haven't done anything with the specials, products attributes, etc. Hth, Matt
  13. ecartz

    Virtual Mall 1.2 Support Thread

    It may help to know that the original concept that I had for this was an online Art Gallery (a project on which I was actually working at one point). In that case, it is reasonable to use the Manufacturer field to store Artist info. The store then could be a separate seller (dealer, agent, etc.). The same issue arises with, for example, a used book store (manufacturer stores author info). Thus my reluctance to hack up the manufacturers' tables into stores' tables in my version of the contribution. The same issue arose with the Products Attributes - Option Type Feature contribution and the File Upload contribution. The file upload contribution actually includes the entire Option Type Feature contribution, but it is still uploaded separately, as Chandra did not feel that all of the existing users would want the added complexity of the File Upload code. Hth, Matt
  14. ecartz

    Master Products - MS2

    Around lines 170 and 179 of includes/modules/master_listing.php, change code that looks like $lc_text = tep_draw_pull_down_menu('Qty_ProdId_' . $listing['products_id'], $qty_array); to something that looks like $lc_text = tep_draw_checkbox_field('Qty_ProdId_' . $listing['products_id'], '1'); This will change it to a checkbox instead of a pull down menu. Checked means purchasing 1. You could also replace the 20s in the code with 1s and get a drop down menu like you describe. Hth, Matt
  15. ecartz

    Virtual Mall 1.2 Support Thread

    I would consider that to be an alternative version rather than an update. You might want to check with John and see what he thinks. I'll send you an email separately (I don't like posting my email address on web sites; however, my email link does work). Cheers, Matt
  16. ecartz

    BTSv1.2 Support

    Try looking here to see how to turn on error reporting. Hth, Matt
  17. ecartz

    Virtual Mall 1.2 Support Thread

    I would call an update version 1.2a or something like that, since it would be bug fixes rather than new functionality. In terms of shipping, my suggested solution would be to include shipping in the product price or implement the individual shipping contribution. Other solutions are possible but not simple (for example, shipping could conceivably be calculated per store with different methods per store). Hth, Matt
  18. ecartz

    Virtual Mall 1.2 Support Thread

    $store_index = $order->products[$i]['store_id'] needs a ; at the end: $store_index = $order->products[$i]['store_id']; Hth, Matt
  19. ecartz

    Admin Access With Levels

    You have to add the new files to the list as Greg did for invoice.php above. Hth, Matt
  20. I would try changing the function to //// // Return a product ID with attributes function tep_get_uprid($prid, $params) { $uprid = $prid; if ( (is_array($params)) && (!strstr($prid, '{')) ) { while (list($option, $value) = each($params)) { //CLR 030714 Add processing around $value. This is needed for text attributes. $value_str = (tep_not_null(stripslashes(trim($value))) ? htmlspecialchars(stripslashes(trim($value)), ENT_QUOTES) : ''); $uprid = $uprid . '{' . $option . '}' . $value_str; } //CLR 030228 Add else stmt to process product ids passed in by other routines. } else { $uprid = htmlspecialchars(stripslashes($uprid), ENT_QUOTES); } if ( (is_array($params)) && (!strstr($prid, '{')) ) { while (list($option, $value) = each($params)) { $uprid = $uprid . '{' . $option . '}' . $value; } } return $uprid; } Hth, Matt
  21. ecartz

    Master Products - MS2

    Around line 207 of advanced_search_result.php, change $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; to $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price "; Around line 223, change $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id "; to $from_str .= " left join " . TABLE_PRODUCTS . " pm on pm.products_master = p.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pdm on pm.products_id = pdm.products_id"; $where_str = " where p.products_status = '1' and p.products_listing_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id "; Around line 238, change $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'"; to $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and pdm.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'"; Around lines 258-9, change $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'"; if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'"; to $where_str .= "(pdm.products_name like '%" . tep_db_input($keyword) . "%' or pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'"; if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pdm.products_description like '%" . tep_db_input($keyword) . "%' or pd.products_description like '%" . tep_db_input($keyword) . "%'"; I don't think that I made any other changes except adding an index on products_master to the database. Hth, Matt
  22. ecartz

    Virtual Mall 1.2 Support Thread

    Did you get any errors during the osCommerce install? It's saying that it can't find one of the basic osCommerce tables. I would check that the tables were created properly with something like phpMyAdmin. You would upload the Adminstrators.sql file with phpMyAdmin or similar utility. Copy all the PHP files to the equivalent places in the store's admin area. Hth, Matt
  23. ecartz

    EasyPopulate help

    I would start by reading the instructions. :) They suggest that you download a copy of the default database as a complete text file and then upload it back to make sure that it worked. Oh, and don't forget to read the configuration section. Hth, Matt
  24. ecartz

    Flat and Percentage based module does any one need

    If you just want percentage rate shipping, I think that this contribution: http://www.oscommerce.com/community/contributions,1222 will provide it. You process credit cards using a merchant account and a gateway. Some examples of gateways are Authorize.net, PayFlow Pro, and LinkPoint API. The merchant account provider (a bank) should know which gateways they support. Hth, Matt
  25. ecartz

    Master Products - MS2

    Around lines 1360-4 of admin/categories.php: if (isset($HTTP_GET_VARS['search'])) { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_master, p.products_master_status, p.products_listing_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by p.products_master"); } else { $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.products_master, p.products_master_status, p.products_listing_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by p.products_master"); } changing the two order by clauses to order by IF(p.products_master_status, p.products_id, p.products_master), p.products_master_status DESC, p.products_id might work. I haven't tried it. That's where you would need to make the changes though. Hth, Matt
×