Jump to content

randyroy

Members
  • Content count

    23
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Randy

Recent Profile Visitors

1,680 profile views
  1. Thanks. That function inside of a function is part of the Enhanced Categories Box addon. I didn't write it; I only added it to my store. And it works fine. It just doesn't offer the "hide the category if it has no products or subcategories with products in it". I'm just trying to make this feature a little bit more useful for what I would like my store to do. That's all. And, yes, there are several addons that hide categories with no products. But I haven't found any that work with Bootstrap 2.3.4. I'm sorry to have bothered you. My apologies. Randy
  2. Thanks, Jim. I took your suggestion and wrote a bit of code. This is the entire function from the includes/functions/general.php file. I added comments to show what I changed... function tep_build_category_info_array() { function bci_get_paths($categories_array = '', $parent_id = 0, $level = 0, $path='') { global $languages_id; if (!is_array($categories_array)) $categories_array = array(); //I changed this... //$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); //To this... $categories_query = tep_db_query("select c.categories_id, cd.categories_name, p2c.categories_id, p2c.products_id, p.products_id, p.products_status from " . TABLE_CATEGORIES . " c left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on c.categories_id = p2c.categories_id left join " . TABLE_PRODUCTS . " p on p2c.products_id = p.products_id, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p2c.products_id <> '' and p.products_status <> '0' and parent_id = '" . (int)$parent_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); while ($categories = tep_db_fetch_array($categories_query)) { if (SHOW_COUNTS == 'true') { $count_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = " . (int)$categories['categories_id']); $products = tep_db_fetch_array($count_query); $count = $products['total']; } else { $count = 0; } $categories_array[$categories['categories_id']] = array('name' => $categories['categories_name'], 'path' => $path . $categories['categories_id'], 'id' => $categories['categories_id'], 'indent' => str_repeat(' ', $level), 'level' => $level, 'has_subcat' => false, 'prod_count' => $count, 'parent' => $parent_id, 'direct_children' => array(), 'all_children' => array(), 'with_children' => array($categories['categories_id'])); $categories_array[$parent_id]['has_subcat'] = true; $categories_array[$parent_id]['direct_children'][] = $categories['categories_id']; if ($categories['categories_id'] != $parent_id) { $categories_array = bci_get_paths($categories_array, $categories['categories_id'], $level + 1, $path . $categories['categories_id'] . '_'); } } return $categories_array; } // end bci_get_paths $cat_array = bci_get_paths(); unset($cat_array[0]); foreach ($cat_array as $cat) { $parent = $cat['parent']; while ($parent > 0 ) { // add category product count to parent category product counts $cat_array[$parent]['prod_count'] += $cat['prod_count']; // build all_children and with_children arrays $cat_array[$parent]['all_children'][] = $cat['id']; $cat_array[$parent]['with_children'][] = $cat['id']; $parent = $cat_array[$parent]['parent']; } } return $cat_array; } // end tep_build_category_info_array This seems to work great, but only for the main categories. I don't know how to make it look in the subcategories to find products. For example, I have a category called wheels. Inside that I have a subcategory called hubcaps. The wheels category will only show up if I have a product directly inside of it. It doesn't matter that I have a product in the hubcaps category; it doesn't look for that and the whole tree gets hidden if it doesn't find a product in the wheels category. Can you please help point me in the right direction? Thanks, Randy
  3. Thanks, Jim. That works great. I appreciate your help. Can you please tell me if there is a way to hide empty categories in Bootstrap? I only want to hide them if there are no products in them. I have 2.3.4. Thanks, Randy
  4. I think this might be better still and more efficient. In the includes/modules/content/header/cm_header_logo.php file, change this... function isEnabled() { return $this->enabled; } to this function isEnabled() { global $cPath, $PHP_SELF; $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if (strpos($url,'index.php')) { //echo $url; $this->enabled = false; }else{ return $this->enabled; } }
  5. I think I figured it out. Here is what I did. In the includes/modules/content/header/cm_header_logo.php file, change this function isEnabled() { return $this->enabled; } to this function isEnabled() { global $cPath, $PHP_SELF; if (strpos($_SERVER['SCRIPT_NAME'], 'index.php') !== false) { $this->enabled = true; }else{ return $this->enabled; } } Now, when my logo and carousel are both enabled, only the carousel displays on the index.php page. Only the logo displays on all of the other pages. Hopefully that can help someone else. :)
  6. I installed the carousel mod into my store and it works great. Thanks for that. I see that it is on the home page (index.php) but not on any other pages. And that's fine as I would like to use my regular logo on the other pages. But if I enable the logo in the admin panel, it displays on all pages including the one with the carousel. Is there a way to disable the logo just on the index.php page where the carousel is being displayed? I am using 2.3.4 bootstrap. Any assistance is greatly appreciated. Thanks much.
  7. Is it possible to change the left and right arrow colors? My images have white backgrounds and I'd like to make the arrows black. Also, can the gray shading be removed from the sides?
  8. randyroy

    Multi_Vendor_Shipping new thread

    Ok. I think I see the problem. I looked at the orders_products table and all of the products in all of the orders have a vendors_id of 1. So whenever an order is placed in the store, the vendors_id is set to 1. Can you please tell me which file is responsible for setting the vendors_id in the orders_products table when the order is entered? I would bet there is a static entry in that file that was changed at some point for testing. Thanks, Randy
  9. randyroy

    Multi_Vendor_Shipping new thread

    Correction. I don't have a vendors_id field in the orders table. But looking back through the code, I don't see where it pulls that value directly from the orders table. I do have an orders_status field and there is data for each order in this field. The same is true for the orders_id fields.
  10. randyroy

    Multi_Vendor_Shipping new thread

    I have data in all fields in the orders table except the 4 cc credit card fields, and the suburb fields. (I would guess this is correct since those aren't used in this store.) The only other field in question is the orders_date_finished field which has NULL for all 6 orders in the store currently. Also, the queries use variables for languages_id and vendor_orders_data['orders_id']. I am not sure how to rewrite the query for running it directly in phpMyAdmin. Thanks, Randy
  11. randyroy

    Multi_Vendor_Shipping new thread

    Hey Jim, It looks like I am getting somewhere here. I uncommented the 2 print orders query statements in the file that you sent me and one of them displayed the queries and listed 4 id's. That worked. The problem now is that the part where it's supposed to list the results and turn them into hyperlinks is still not working. I believe that is this section of code in the orders_by_vendor.php file: while ($vendors_orders = tep_db_fetch_array ($orders_query) ) { $date_purchased = $vendors_orders['date_purchased']; ?> <tr class="dataTableRow"> <td class="dataTableContent" align="left"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $vendors_orders_data['orders_id'] . '&action=edit') . '" TARGET="_blank"><b>View this order</b></a>'; ?></td> <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_id']; ?></td> <!-- <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'action=new_product&pID=' . $vendors_orders_data['v_products_id']) . '" TARGET="_blank"><b>' . $vendors_products_data['products_name'] . '</a>'; ?></td> --> <td class="dataTableContent"><?php echo ' from <a href="' . tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $vendors_orders['customers_id'] . '&action=edit') . '" TARGET="_blank"><b>' . $vendors_orders['customers_name'] . '</b></a>'; ?></td> <td class="dataTableContent" align="left"><?php echo strip_tags($vendors_orders['order_total']); ?></td> <td class="dataTableContent" align="left"><?php echo tep_date_short ($date_purchased); ?></td> <td class="dataTableContent" align="left"><?php echo $vendors_orders['orders_status_name']; ?></td> <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS_EMAIL_SEND, '&vID=' . $vendors_id . '&oID=' . $vendors_orders_data['orders_id'] . '&vOS=' . $vendors_orders_data['vendor_order_sent']) . '"><b>' . $vendors_orders_data['vendor_order_sent'] . '</a></b>'; ?></td> </tr> <?php ​Does any of that look incorrect? I am not sure how to print out individual results from each line to see where the problem is. Thanks, Randy
  12. randyroy

    Multi_Vendor_Shipping new thread

    Thanks for the file. That gives me the exact same results. So at this point, my best guess is that there is some order id or vendor id that is being left out of the order table at the point of order creation. Can you please tell me which file controls the order being added to the database table? Is it checkout_process.php?
  13. randyroy

    Multi_Vendor_Shipping new thread

    Thanks, Jim. I have gone back and tried all of the orders_by_vendors.php files from every revision of MVS that I could find. (V1, V1.1, V1.2, V1.2.1, V1.2.2, V1.2.3, and V1.3). I can't find any that work and actually display the list of orders for the selected vendor. I have sent a PM to another user who claimed in an older post to have gotten it working and hope they can point me in the right direction. I appreciate your help and will continue to work on this. Thanks again. :) Randy
  14. randyroy

    Multi_Vendor_Shipping new thread

    Sorry about the <> code block button. I didn't know I needed to use that to post code. Also uncommenting the last two yielded no change. Is there a working version of MVS that I can download where the orders_by_vendor page works? I have MVS 1.3 installed but am not sure if that is the most recent, or if it works in that version. It is the most recent that I could find. Does your MVS orders by vendor work? Thanks, Randy
  15. randyroy

    Multi_Vendor_Shipping new thread

    Thanks. Here is the section that I think is causing the trouble. There are commented statements that provide direction, but the lines that it says to modify either don't exist or cannot be found For example: // comes here but status is blank echo 'in admin/orders by vendor php line 219 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id']. ' and status = ' . $status; But there is nothing in line 219 that matches that. Here is line 219: <td class="dataTableContent" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS_EMAIL_SEND, '&vID=' . $vendors_id . '&oID=' . $vendors_orders_data['orders_id'] . '&vOS=' . $vendors_orders_data['vendor_order_sent']) . '"><b>' . $vendors_orders_data['vendor_order_sent'] . '</a></b>'; ?></td> And here are the sections that I am questioning. Can you please confirm that these look correct? <?php if ($line_filter == 'asc') { if ($status > 0) { ?> <td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link (FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line=desc' . '&sent=' . $sent . '&status=' . $status) . '"><b>DESCENDING</a></b> order'; ?></td> <?php } else { ?> <td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link (FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line=desc' . '&sent=' . $sent) . '"><b>DESCENDING</a></b> order'; ?></td> <?php } } else { if (isset ($status) ) { ?> <td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=asc' . '&sent=' . $sent . '&status=' . $status) . '"><b>ASCENDING</a></b> order'; ?></td> <?php } else { ?> <td class="main" align="right"><?php echo 'Change to <a href="' . tep_href_link(FILENAME_ORDERS_VENDORS, '&vendors_id=' . $vendors_id . '&line_filter=asc' . '&sent=' . $sent) . '"><b>ASCENDING</a></b> order'; ?></td> <?php } } $orders_statuses = array (); $orders_status_array = array (); $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int) $languages_id . "'"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array ('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name'] ); $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } ?> <td class="main" align="right"><?php echo tep_draw_form('status_report', FILENAME_ORDERS_VENDORS . '?&vendors_id=' . $vendors_id . '?&sent=' . $sent) . HEADING_TITLE_STATUS . ' '; ?><?php echo tep_draw_pull_down_menu('status', $orders_statuses, '','onChange="this.form.submit()";');?></form></td> </tr> </table> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_VENDOR; ?></td> <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ORDER_ID; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_CUSTOMERS; ?></td> <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td> <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td> <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_SENT; ?> </td> </tr> <?php $vend_query_raw = "select vendors_name as name from " . TABLE_VENDORS . " where vendors_id = '" . $vendors_id . "'"; $vend_query = tep_db_query($vend_query_raw); $vendors = tep_db_fetch_array($vend_query); ?> <tr class="dataTableRow"> <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_VENDORS, '&vendors_id=' . $vendors_id . '&action=edit') . '" TARGET="_blank"><b>' . $vendors['name'] . '</a></b>'; ?></td> <td class="dataTableContent"><?php echo ''; ?></td> <td class="dataTableContent"><?php echo ''; ?></td> <td class="dataTableContent"><?php echo ''; ?></td> <td class="dataTableContent"><?php echo ''; ?></td> <td class="dataTableContent"><?php echo ''; ?></td> <td class="dataTableContent" align="right">Click To<br>Send Email</td> </tr> <?php if ($sent == 'yes') { $vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' and vendor_order_sent='yes' group by orders_id " . $line_filter . ""); } elseif ($sent == 'no') { $vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' and vendor_order_sent='no' group by orders_id " . $line_filter . ""); } else { $vendors_orders_data_query = tep_db_query ("select distinct orders_id, vendor_order_sent from " . TABLE_ORDERS_SHIPPING . " where vendors_id='" . $vendors_id . "' group by orders_id " . $line_filter . ""); // echo 'in admin/orders by vendor php line 224 line filter = ' . $line_filter . ' and orders id = ' . $vendors_orders_data['orders_id']; } while ($vendors_orders_data = tep_db_fetch_array ($vendors_orders_data_query)) { if ($status > 0) { // $status = '1'; $orders_query = tep_db_query ("select distinct o.customers_id, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from (" . TABLE_ORDERS . " o) left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = '" . $status . "' and o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' and o.orders_id = '" . $vendors_orders_data['orders_id'] . "' order by o." . $sort_by_filter . " ASC"); // comes here but status is blank echo 'in admin/orders by vendor php line 219 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id']. ' and status = ' . $status; } else { $orders_query = tep_db_query ("select distinct o.customers_id, o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from (" . TABLE_ORDERS . " o) left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . $languages_id . "' and ot.class = 'ot_total' and o.orders_id = '" . $vendors_orders_data['orders_id'] . "' order by o." . $sort_by_filter . " ASC"); // echo 'in admin/orders by vendor php line 223 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id']; } while ($vendors_orders = tep_db_fetch_array ($orders_query) ) { // echo 'in admin/orders by vendor php line 227 vendors id = ' . $vendors_id . ' and orders id = ' . $vendors_orders_data['orders_id']; $date_purchased = $vendors_orders['date_purchased']; ?> Any assistance that you can provide is greatly appreciated. Thanks, Randy
×