Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. There would have to be a lot more code to make this indicator sortable. However, the indicator does not need to add a sorter to the query. The most it should accomplish is to filter the query. That is, "Show only those products that have a Quantity Discount schedule assigned." That said, here are instructions to do that: In products.index.inc.php, in the code following near line 1102: } else { // List all products $GLOBALS['main']->addTabControl($lang['catalogue']['title_product_list'], 'general'); Find the statements and make the changes. Find: foreach ($GLOBALS['hooks']->load('admin.product.table_head_sort') as $hook) include $hook; Change to: $thead_sort['discount'] = "QuanDisc";$thead_sort['discount_link'] = (isset($_GET['has_quan_discount'])) ? currentPage(array('has_quan_discount')) : currentPage(null,array('has_quan_discount' => "1")) ; foreach ($GLOBALS['hooks']->load('admin.product.table_head_sort') as $hook) include $hook; Find: if (($where === false || strlen($where) > 0) && ($results = $GLOBALS['db']->select('CubeCart_inventory', false, $where, $_GET['sort'], $per_page, $page)) !== false) { $pagination = $GLOBALS['db']->pagination(false, $per_page, $page, 9); Change to: $quan_discounts_products = $GLOBALS['db']->select('CubeCart_pricing_quantity', array('DISTINCT' => 'product_id')); if ($quan_discounts_products) { foreach ($quan_discounts_products as $prod) { $has_quan_discounts_products[$prod['product_id']] = $prod['product_id']; } } if (isset($_GET['has_quan_discount']) && !empty($_GET['has_quan_discount'])) { if (!$where){ $where = ''; } else { $where .= ' AND '; } $where .= '(product_id IN (' . implode(",",$has_quan_discounts_products) . '))'; } if (($where === false || strlen($where) > 0) && ($results = $GLOBALS['db']->select('CubeCart_inventory', false, $where, $_GET['sort'], $per_page, $page)) !== false) { $pagination = $GLOBALS['db']->pagination(false, $per_page, $page, 9); Find: foreach ($GLOBALS['hooks']->load('admin.product.products_list') as $hook) include $hook; $GLOBALS['smarty']->assign('PRODUCTS', $smarty_data['products']); $GLOBALS['smarty']->assign('PAGINATION', $pagination); Change to: foreach($smarty_data['products'] as &$result) { $result['has_quan_discount'] = (isset($has_quan_discounts_products[$result['product_id']])) ? true : false ; } foreach ($GLOBALS['hooks']->load('admin.product.products_list') as $hook) include $hook; $GLOBALS['smarty']->assign('PRODUCTS', $smarty_data['products']); $GLOBALS['smarty']->assign('PAGINATION', $pagination); In the admin skin template products.index.php, find: <th nowrap="nowrap">{$THEAD.stock_level}</th> <th nowrap="nowrap">{$THEAD.updated}</th> Change to: <th nowrap="nowrap">{$THEAD.stock_level}</th> <th nowrap="nowrap">{if $THEAD.discount_link}<a href="{$THEAD.discount_link}">{$THEAD.discount}</a>{else}{$THEAD.discount}{/if}</th> <th nowrap="nowrap">{$THEAD.updated}</th> Find: <td align="center">{$product.stock_level}</td> <td> {if $product.updated == '0000-00-00 00:00:00'} Change to: <td align="center">{$product.stock_level}</td> <td align="center"><img src="{$STORE_URL}/{$SKIN_VARS.admin_folder}/skins/default/images/{if $product.has_quan_discount}1{else}0{/if}.png" /></td> <td> {if $product.updated == '0000-00-00 00:00:00'} What you will now see is a column labeled QuanDisc. It is a link back to this page, but has a flag in the URL (the querystring) that will affect the filtering of the query. The WHERE component of the query will now look for records with specific product_id values - along with any other filtering choice made previously or to follow. The specific product_id values are those that have been identified as having records in the Quantity Discounts database table. To switch off this particular filtering, click the link QuanDisc again.
  3. bsmither

    Product sorting

    MySQL does not do "natural sorting". There are hacks to get the same result, but it is a hassle to implement them in already written code.
  4. Claudia M

    Product sorting

    I think that ACC-81 has to be ACC-081 and all product codes have to have the same amount of characters.
  5. peterp

    Product sorting

    Hi All, I have just changed the sorting sequence of the storefront using the store settings in admin to sort via a product code, unfortunately in one instance that I have found is that the sorting process has put the product code 'ACC-140' in front of 'ACC-81'. It seems that after some further investigation only one other product is seemingly out of sequence. Should I be looking somewhere else to make sure all products are sorted into the right sequence within there apropriate category Any help will be appreciated Best Regards, Peterp
  6. Yesterday
  7. varesin73@aim.com

    copy of foundation skin fails

    Thank you, here is the link : https://drive.google.com/file/d/1c7Hcp3UPKOeQaFqWtZ1DqK7r7xQ2occM/view?usp=sharing Regards,
  8. Matthew66

    Average turn around time on paid support?

    Thanks so much Al...I was sweating it!! Lol Rockin' Job! Thanks. Matthew
  9. Dirty Butter

    Need Help with Sort on Custom Quantity Discount Column

    Well, it's the two images that would need to be sorted I guess. So maybe it is from the same discussion. The sort code " appears" to be there - and it did work at some point in the past - v5?. I kept putting off asking about it while dealing with more pressing code problems.
  10. havenswift-hosting

    Average turn around time on paid support?

    Well ahead of your SLA ! Morning Al !
  11. Al Brookbanks

    Average turn around time on paid support?

    I have fixed your store for you now.
  12. Al Brookbanks

    Average turn around time on paid support?

    We will take a look first thing on Monday. I have responded to your ticket with instructions. I'm afraid we can't upgrade your store for you on the basic support plan that you signed up to. We have a back log of upgrades for Monday but we do prioritise any stores that are down.
  13. I found my notes on doing something like this for if an item has an image, and the additional code needed to sort on whether this one or not. But I have not found my notes on doing the same for whether or not the item has a Quantity Discount schedule.
  14. Sorry, but I tried unsuccessfully to find the original forum thread. From my notes I'm assuming that Bsmither helped me add this code: products.index.php <td align="center">{$product.stock_level}</td> <!-- BSMITHER DISCOUNT IMAGE rest of code in products.index.inc.php --> <td align="center"><img src="{$STORE_URL}/{$SKIN_VARS.admin_folder}/skins/default/images/{if $product.discount}1{else}0{/if}.png" class="toggle" /></td> <td> <!-- END BSMITHER DISCOUNT IMAGE --> {if $product.updated == '0000-00-00 00:00:00'} {$LANG.common.unknown} {else} {formatTime(strtotime($product.updated))} {/if} </td> And in products.index.inc.php $thead_sort = array ( 'status' => $GLOBALS['db']->column_sort('status', $lang['common']['status'], 'sort', $current_page, $_GET['sort']), 'digital' => $GLOBALS['db']->column_sort('digital', $lang['common']['type'], 'sort', $current_page, $_GET['sort']), 'image' => $lang['catalogue']['title_image'], 'name' => $GLOBALS['db']->column_sort('name', $lang['catalogue']['product_name'], 'sort', $current_page, $_GET['sort']), 'product_code' => $GLOBALS['db']->column_sort('product_code', $lang['catalogue']['product_code'], 'sort', $current_page, $_GET['sort']), 'price' => $GLOBALS['db']->column_sort('price', $lang['common']['price'], 'sort', $current_page, $_GET['sort']), // BSMITHER EXTRA TABS 'stock_level' => $lang['catalogue']['title_stock'], 'sale_price' => $GLOBALS['db']->column_sort('sale_price',$lang['common']['price_sale'],'sort',$current_page,$_GET['sort']), 'stock_level' => $GLOBALS['db']->column_sort('stock_level',$lang['catalogue']['title_stock'],'sort',$current_page,$_GET['sort']), 'discount' => $GLOBALS['db']->column_sort('discount',$lang['catalogue']['title_discount_quantity'],'sort',$current_page,$_GET['sort']), // BSMITHER END EXTRA TABS 'updated' => $GLOBALS['db']->column_sort('updated', $lang['catalogue']['title_last_updated'], 'sort', $current_page, $_GET['sort']), 'translations' => $lang['translate']['title_translations'] ); also in products.index.inc.php $updated_time = $result['updated']; $result['updated'] = $updated_time ? $updated_time : $lang['common']['unknown']; /* BSMITHER CHECK FOR QUANTITY DISCOUNTS rest of code is in products.index.php */ $quanDiscount = $GLOBALS['db']->count('CubeCart_pricing_quantity', 'product_id', array('product_id' => $result['product_id'])); $result['discount'] = ($quanDiscount) ? true : false; /* BSMITHER END CHECK FOR QUANTITY DISCOUNTS */ $smarty_data['products'][] = $result; } This code DOES create a column in the Product Summary listings for the Discount Code. It DOES create an empty box if there is no discount code and a checked box if there is a quantity discount. But it's of no real use in 6.2+ as is, because the column will not sort. Is this fixable? I know there is a GitHub entry having something to do with a sort of some column that's not working.
  15. bsmither

    Product Info Tab

    I am going to argue this is intentional. Although, why the reason doesn't apply to "modules" is sketchy. It was discovered that at some version of CubeCart, if Save was clicked on a group listing of phrases, the entire group of phrase expressions was databased and not just the ones that got changed. The problem created here is that databased expressions overrule whatever may be in language files - including the master 'definitions.xml' file. So, if an expression gets changed (a spelling error) in a later version, the databased expression (still misspelled) continues to be what gets shown. There is code in /admin/sources/settings.language.inc.php that discriminates between language Definitions (language pack "groups") and module strings. Definition expressions get a 'disabled' flag if the expression from the database matches the language pack expression. This test does not exist for the "group" associated with a module's language file - even if it got databased. I do not know if not making this test for module language groups was an oversight. The end result is the entire module's language file gets databased if Save is clicked, even if nothing got changed. The "disabled' flag is used to make the text entry field 'disabled'. This solved the problem of databasing whole groups of phrases because disabled form elements do not get POSTed. You cannot click into disabled form elements. But you can click the "label" portion of the form element (the <label> tag holds the phrase key). Modern browsers consider the entire label and element input as one thing, provided the for attribute is used. That is, the HTML has the <label> stretching from the phrase key all the way to the left edge of the text entry box (or radio button, checkbox, drop-down selector, etc), then the actual text entry field form input element. All of that can be clicked on, but not the element part if the element is disabled.
  16. Last week
  17. Dirty Butter

    Product Info Tab

    I've seen this behavior when I need to edit a stock CC phrase in v6.2+. BUT on the same version FireFox handles edits of a plugin language phrase within the box, just as one would expect. Doesn't that mean this is a bug in CC somehow, not an issue with FireFox?
  18. Dirty Butter

    New fields in product specification

    I kind of get the gist of what you've asked in the GitHub post, but trust you. I don't think I'm up to understanding it further. I'll certainly take a look at what you've done, @Claudia M , but I am hoping to use the stock dimensions tables. I'm already having to work way too hard to make CC upgrades work with all my current customized code.
  19. Claudia M

    New fields in product specification

    I moved my specification tab out of the product description and added some fields to my database. One of the fields was "item size" and now I can use for example 4L x 3W x 8H all on one line and I have the freedom to word it anyway I want. I don't use the product dimensions or manufacturers that come with CubeCart. Only fields that are populated in the admin/ products are shown so it can be difference for each product. You can see an example here: https://www.claudiasbargains.com/butterflies-electric-candle-tart-potpourri-warmer.html
  20. bsmither

    New fields in product specification

    I just posted an issue in the Github. See: https://github.com/cubecart/v6/issues/2107 Clarification provided upon request.
  21. Dirty Butter

    Product Dimensions

    I commented out the weight line, as I needed an easy way to require Priority Mail for all toys that make sounds. Too many are damaged in shipment via First Class. So all those have a weight of 1lb regardless of actual weight. Also, I plan to use the dimensions for packaged size - not item size. We bubble wrap any toy with hard eyes, etc, or rattles - anything that could break in shipment. So if the time ever comes that USPS requires the dimensions - all my new listings or updated listings will already have that ready to use. I'm adding as I edit/list - but have it all hidden in storefront for now.
  22. Dirty Butter

    New fields in product specification

    So could you give me an idea of the steps to do it in 6.2? I'd like to figure it out for myself if possible.
  23. bsmither

    New fields in product specification

    The solution discussed in this conversation is meant for CubeCart 5 and the skins shipped with it.
  24. bsmither

    Product Dimensions

    For CC621, I will say that each dimension will be on a separate row as per the stock Foundation code for that version. Compared to earlier versions, I am also no longer seeing the code that says if any one dimension is missing, then none get displayed.
  25. Dirty Butter

    Product Dimensions

    I rearranged my length, width, depth as well. We do get some international orders, so I left the Language entries for other languages as is. Somewhere along the way I got the idea that these dimensions were going to show on the storefront like 10"x6"x3", but I'm seeing a separate row for each dimension. Is the separate row the stock way in 6.2.1+?
  26. Dirty Butter

    New fields in product specification

    Sorry for pulling up such an old post, but this is exactly what I would like to do with the new Dimensions information in 6.2+. I'd like to make a separate tab for Package Dimensions.
  27. Matthew66

    Average turn around time on paid support?

    Lol...so true!! Thanks, Matthew
  28. havenswift-hosting

    admin page not found

    Never seen that on any of the many hundred sites we host / manage and can only think that it is a hosting / permissions problem but impossible to tell from the information that was provided - cache now works extremely well in 6.2.X
  1. Load more activity


  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
×