Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tgely

Team
  • Posts

    2,159
  • Joined

  • Last visited

  • Days Won

    51

Everything posted by tgely

  1. Note: the STS system is not compatible with oscommerce v2.31. Just moment! Did you installed oscommerce V2.31? Firstly I suggest you to do one new shop installation. Secondly before the next step backup store and database. Thirdly run SQL modification. And finaly copy all new files from latest contribution Master Products V2.3x V2.0a. If you will get some problem write here. I try to help.
  2. Hi everybody, I searched go-ahead sales functions but not found. If you have got please write here. Problems: I work with shop and I would like to sell products. - I have got some products in stock but more not. - Customers can use Buy now and Add to cart buttons only. Pre Condition: - work with stock. If one customer buy non stocked product I will be agitated and I will avoid conflicts. So, I think the first step is wrong when the customer press cart button. Why? Reason: I will not know about my order possibilities. There would be better to do contact before or get more information. My idea when product is out of stock: 1. The customers can take only an order and not use add to cart or Buy now button 2. Use oscommerce built in functions, offer contact and products notify in this cases 3. Offer products alternatives I started with: 1. define Order button and others in main language file // go-ahead sales define('TEXT_STOCK_NOTIFY', 'Notify me'); define('TEXT_STOCK_CONTACT', 'Contact'); define('TEXT_STOCK_OFFERS', 'Our offers'); define('IMAGE_BUTTON_BUY_NOW_DEFINITELY', 'Order'); // go-ahead sales EOF 2. enhance conditions somewhere in the shop Firstly one example in products_info.php <?php if ($product_info['products_quantity'] > 0) { . . . } else { echo '<p class="stockWarning">' . TEXT_ORDER . '</p>'; echo '<p align="center"><small><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $product_info['products_id'] . '&action=notify') . '">' . TEXT_STOCK_NOTIFY . '</a><br /><a href="' . tep_href_link(FILENAME_CONTACT_US, 'products_id=' . $product_info['products_id']) . '">' . TEXT_STOCK_CONTACT . '</a><br /><a href="' . tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, 'keywords=' . $product_info['products_name'] . '&search_in_description=1&stock=in') . '">' . TEXT_STOCK_OFFERS . '</a></small></p>'; } ?> and insert into referenced language file // go-ahead sales define('TEXT_ORDER', 'This product is out of stock. Click to Order button to buy definitely or choose before other possibilities below.'); // go-ahead sales Secondly code example is in products listing in stock conditions. tep_draw_button(IMAGE_BUTTON_BUY_NOW_DEFINITELY, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id'])); The offers output depends on your skills. You can use other contributions for it. Thirdly write good Condition of Use informations. I have to enhance Contact Us with subject options but this is easy skill. If somebody intrests in it I will take a new contribution. Cheers
  3. Advanced search fix for Buy now button. Code cleaning and change slave_id with master_id. catalog/includes/modules/product_listing.php find in line 142: } elseif ($listing['products_master'] != '0') { $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . (($listing['products_master']) != "0" ? ((strpos(trim(str_replace('_', '', $listing['products_master'])), ' ') !== false) ? ($listing['products_id']) : (trim(str_replace('_', '', $listing['products_master'])))) : $listing['products_id']))) . '</td>'; change to: } elseif ($listing['products_master'] != '0') { $prod_list_contents .= ' <td align="center">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . ((strpos(trim(str_replace('_', '', $listing['products_master'])), ' ') !== false) ? (trim(str_replace('_', '', $listing['products_master']))) : ($listing['products_id'])))) . '</td>';
  4. Find in catalog/includes/functions/general.php $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-' : '') . '</a>'; change to: $sort_suffix = (substr($sortby, 0, 1) == $colnum ? (substr($sortby, 1, 1) == 'a' ? '+' : '-') : '') . '</a>'; Thanks for post! I will take an edit in the next release.
  5. Thanks for edit pdcelec!

  6. Sorry. Download the next Master Products V2.3x V2.0a.zip.
  7. Hi Jack, it looks like to be over sized. Could you separate?
  8. What about Multiple Masters? The previous (cymonguk 2005/09/07) multiple master for single slave pack was similar and very good idea. What's happening when we use multiple master products for a slaves? The contribution goes crash. I found a lot of bugs. My opinion that we need Suggested Masters information at least on products info page. The next release will contain return links to masters from unique slave info page. All masters will be listed with links. In this case customers can use every products listing results with better navigation. NEW standard values for Multiple Masters like this "_ 57 67 557 _". If we use "like %" options in queries we have to use unique values. The old standards not good enough. If we ask for "%57%" we can find "557" too. So we have to use some open and close tags in products_master field: "_" Look at special codes in suggested accessories: trim(str_replace('_', '', $row['products_master'])) Return links with special examination code: $data .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . ((strpos(trim(str_replace('_', '', $row['products_master'])), ' ') !== false) ? ($row['products_id']) : (trim(str_replace('_', '', $row['products_master'])) . '&slave_id=' . $row['products_id']))) . '">' . $row['products_name'] . '</a><br />'; Not simple but usefull, and Master Products has got Multiple Masters. What about search? If we use Suggested Masters, the search results will be optimal for navigation. The navigation more important than anything. What about previous page? In link navigation next release will use slave_id so the program can do highlight in master products listing or something for seo or printing information. I deleted the ugly redirect. I hope this will be usefull as we can read in this forum.
  9. I do not too. I think USU 5 pro seo needs query enhance. Slave_id var have to replace with slave product name. Here is my test http://variants231 dot oscom.hu I am testing. Next step I will send you my pack.
  10. Ok. This is fine! We can do unique links! You need url seo enhance from SEO contributor. We need to list on product_info page about slave product for SEO. For example make bold letter highlight in master listing or print some info about slave product. Master product's Header tags can mix or join with slave product or something like this. It looks like just solved popup page problems and google xml sitemap seo too. We have to reach original product_info page only for slave products without master listing table, so we dont need popup pages. Customers can write reviews and so on.
  11. I changed the New Product config.
  12. change } $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } to $oscTemplate->addBlock($data, $this->group); } } function isEnabled() { return $this->enabled; }
  13. This version of suggested_accessories contains next link process. Could you test it in SEO? Does it work? Can you link to master page from slave products? I hope we don't need some changed codes in ßeta pack. I rewrote all relevated tep_href_links We can write reviews to slave products. Why not?
  14. includes/modules/boxes/bm_suggested_accessories.php change <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ class bm_suggested_accessories { var $code = 'bm_suggested_accessories'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_suggested_accessories() { $this->title = MODULE_BOXES_SUGGESTED_ACCESSORIES_TITLE; $this->description = MODULE_BOXES_SUGGESTED_ACCESSORIES_DESCRIPTION; if ( defined('MODULE_BOXES_SUGGESTED_ACCESSORIES_STATUS') ) { $this->sort_order = MODULE_BOXES_SUGGESTED_ACCESSORIES_SORT_ORDER; $this->enabled = (MODULE_BOXES_SUGGESTED_ACCESSORIES_STATUS == 'True'); $this->group = ((MODULE_BOXES_SUGGESTED_ACCESSORIES_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; $slaves = $this->get_slave_products(); if (tep_not_null($slaves) ) { $max_rows_to_show = 0; $cfg_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = '" . "MASTER_LIST_NUM_ACCESSORIES" . "'"); if (tep_db_num_rows($cfg_query) > 0 ) { $cfg_array = tep_db_fetch_array($cfg_query); $max_rows_to_show = (int)$cfg_array['configuration_value']; } if ( 0 < $max_rows_to_show ) { $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_SUGGESTED_ACCESSORIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">'; foreach ( $slaves as $key => $value ) { $slave = $slaves[$key]; $strquery = "select p.products_id, p.products_master, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd " . "where p.products_id = '" . $slave['products_id'] . "' " . " and p.products_id = pd.products_id"; // echo "<!-- QUERY: " . $strquery . " -->\n"; $query = tep_db_query($strquery); if ( tep_db_num_rows($query)) { $row = tep_db_fetch_array($query); // echo "<!-- QUERY RESULTS: " . $row['products_name'] . " -->\n"; $data .= '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $row['products_master'] . '&slave_id=' . $row['products_id']) . '">' . $row['products_name'] . '</a><br />'; } } $data .= ' </div>' . '</div>'; } else { $data = '<div class="ui-widget infoBoxContainer">' . ' <div class="ui-widget-header infoBoxHeading">' . MODULE_BOXES_SUGGESTED_ACCESSORIES_BOX_TITLE . '</div>' . ' <div class="ui-widget-content infoBoxContents">'; $data .= ' </div>' . '</div>'; } } $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_SUGGESTED_ACCESSORIES_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Suggested Accessories Module', 'MODULE_BOXES_SUGGESTED_ACCESSORIES_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_SUGGESTED_ACCESSORIES_CONTENT_PLACEMENT', 'Right Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_SUGGESTED_ACCESSORIES_SORT_ORDER', '5001', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Entries in Accessories Infobox', 'MASTER_LIST_NUM_ACCESSORIES', '5', 'aximum number of entries in the suggested accessories infobox', '3', '12', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_SUGGESTED_ACCESSORIES_STATUS', 'MODULE_BOXES_SUGGESTED_ACCESSORIES_CONTENT_PLACEMENT', 'MODULE_BOXES_SUGGESTED_ACCESSORIES_SORT_ORDER', 'MASTER_LIST_NUM_ACCESSORIES'); } function get_slave_products() { global $cart; require(DIR_WS_CLASSES . "masters_and_slaves.php"); // first, are there any products in the cart that have slave products // associated with them? $products = $cart->get_products(); $slaves = array(); foreach ( $products as $i => $value ) { $product_id = $products[$i]['id']; $master_prod = new masterProduct($product_id); // second, are any of those slave products in the cart? $slave_array = $master_prod->get_slaves(); foreach ( $slave_array as $i => $value ) { $slave = $slave_array[$i]; $slave_id = $slave['products_id']; if ( $cart->get_quantity($slave_id) <= 0 ) { $slaves[] = $slave; } } } // return array of products. return($slaves); } } ?> is it helped? I dont find this error when happened?
  15. Yes this is good idea but 'products_set_only' maybe redundant. I think would be better to use parameters in links like this: /products_info.php?products_id=xx&slave_id=yy from previous pages or suggested_accessories or anywhere. tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . $HTTP_GET_VARS['products_master'] . '&slave_id=' . $HTTP_GET_VARS['products_id']) or tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . $product_info['products_master'] . '&slave_id=' . $product_info['products_id']) I dont undenstand why use redirects this contrib. We can avoid every problems.
  16. This is more simple. Change in advanced_search_result.php // Master Products $where_str = " where p.products_status = '1' and p.products_master = '0' 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 "; //Master Products EOF to: // Master Products $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 "; //Master Products EOF
  17. I think possible. We take a standard seach and get products_master string as results. After we have to take an array and we can list something. First we try to finish Beta. Would be important to make with something slave popup page. There are a lot of facilities (JQuery popup or something like original JAVASRIPT) I cant see at this moment slave url seo. All of the links go to master so maybe websearchers dont like it. Does somebody have experriencies?
  18. Thanks. Edited. I uploaded Beta release.
  19. Problem solved. I put it as Master Product V2.3x new pack as soon as possible. Cheers
  20. I find shopping cart box bug too. The highlihted new item in cart works. This problem was in previous versions and the reason was while cycle. in catalog/includes/application_top.php find: if (substr($key,0,11) == "Qty_ProdId_") { change to: if (substr($key,0,11) == "Qty_ProdId_" && ($val != 0)) { At this moment I cant find the reason of the linking problem (2-3 bugs). I am affraid that V2.3x change something with $listing_split class doesn't work perfect. This would be perfect if linking works.
  21. No, sorry about it. I forgot to pack in. I rewrote for PHP5.3 <?php /* $ID master_products.php - luckyno - 10/13/2010 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Master Products RC2a - luckyno - 10/13/2010 Released under the GNU General Public License */ require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MASTER_PRODUCTS); $master_query = tep_db_query("select products_master from " . TABLE_PRODUCTS . " where products_master = " . $HTTP_GET_VARS['products_id']); $thisquery = tep_db_fetch_array($master_query); if ($thisquery['products_master'] != '0') { $slave_list = array('MASTER_LIST_MODEL' => MASTER_LIST_MODEL, 'MASTER_LIST_NAME' => MASTER_LIST_NAME, 'MASTER_LIST_MANUFACTURER' => MASTER_LIST_MANUFACTURER, 'MASTER_LIST_PRICE' => MASTER_LIST_PRICE, 'MASTER_LIST_QUANTITY' => MASTER_LIST_QUANTITY, 'MASTER_LIST_WEIGHT' => MASTER_LIST_WEIGHT, 'MASTER_LIST_IMAGE' => MASTER_LIST_IMAGE, 'MASTER_LIST_BUY_NOW' => MASTER_LIST_BUY_NOW, 'MASTER_LIST_OPTIONS' => MASTER_LIST_OPTIONS, 'MASTER_LIST_DESCRIPTION' => MASTER_LIST_DESCRIPTION); asort($slave_list); $column_list = array(); reset($slave_list); while (list($key, $value) = each($slave_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'MASTER_LIST_MODEL': $select_column_list .= 'p.products_model,'; break; case 'MASTER_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'MASTER_LIST_DESCRIPTION': $select_column_list .= 'pd.products_description, '; break; case 'MASTER_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'MASTER_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'MASTER_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case 'MASTER_LIST_WEIGHT': $select_column_list .= 'p.products_weight, '; break; } } $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master = " . $HTTP_GET_VARS['products_id'] . " and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/[1-8][ad]/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'MASTER_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $master_sql .= " order by pd.products_name"; break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); $master_sql .= ' order by '; switch ($column_list[$sort_col-1]) { case 'MASTER_LIST_MODEL': $master_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'MASTER_LIST_NAME': $master_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break; case 'MASTER_LIST_MANUFACTURER': $master_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'MASTER_LIST_QUANTITY': $master_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'MASTER_LIST_IMAGE': $master_sql .= "pd.products_name"; break; case 'MASTER_LIST_WEIGHT': $master_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'MASTER_LIST_PRICE': $master_sql .= "p.products_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; } } include(DIR_WS_MODULES . FILENAME_MASTER_LISTING); ?>
×
×
  • Create New...