bsmither

Member
  • Content count

    11,814
  • Joined

  • Last visited

  • Days Won

    369

bsmither last won the day on November 16

bsmither had the most liked content!

Community Reputation

1,228 Excellent

Profile Information

  • Gender
    Male
  • Location
    Pacific Coast

Recent Profile Visitors

81,723 profile views
  1. Orders to Show Customer Group

    Create this snippet: Enabled: checked Unique ID: ordersumcustgroups@cubecart600+ Execution Order: 99 Description: Adds Customer Group Name(s) to Admin Order Summary Trigger: admin.order.index.display Version: 1.0 Author: forums.cubecart.com/topic/53037-orders-to-show-customer-group/ PHP Code: <?php $snippet_ordersumcustgroups = $GLOBALS['db']->misc('SELECT `group_name` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_customer_membership` AS M INNER JOIN `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_customer_group` AS G WHERE G.`group_id` = M.`group_id` AND M.`customer_id` = '.$summary[0]['customer_id'].';'); if (is_array($snippet_ordersumcustgroups)) { foreach ($snippet_ordersumcustgroups as $membership) {$member_groups[] = $membership['group_name'];} } $snippet_ordersumcustgroups_order['cust_groups'] = isset($member_groups) ? implode(',', $member_groups) : ''; unset($member_groups); $GLOBALS['smarty']->assign('CUST_GROUPS', $snippet_ordersumcustgroups_order['cust_groups']); Make this edit in the admin skin template: orders.index.php, near line 197, find: <div><label>{$LANG.common.email}</label><span><a href="mailto:{$OVERVIEW_SUMMARY.email}">{$OVERVIEW_SUMMARY.email}</a></span></div> On a new blank line after that, add: <div><label>{$LANG.customer.title_groups_membership}</label><span>{if $CUST_GROUPS}{$CUST_GROUPS}{else}{$LANG.common.unknown}{/if}</span></div>
  2. Orders to Show Customer Group

    We would have to find a different hook to write a snippet against.
  3. Hooks

    There are a few approaches to getting debug/diagnostic data: 1. Add the following statement whenever you need to see the value of a passable-by-reference variable: $GLOBALS['debug']->debugTail($variable_to_examine, 'key'); where the key could be something like: 'orders.index.inc.php_510' This will show as a heading in CubeCart's debug section of the page. 2. Add the following statement whenever you need a phrase to be seen: $GLOBALS['debug']->debugMessage("Just entered the hook: " . $hook); In the debug section of the page, there will be Messages listed near the bottom. 3. I have developed my own diagnostics module. It allows for program code tracing.
  4. Orders to Show Customer Group

    Forgot to discuss the edit to the admin skin template: In orders.index.php, find: Near line 41: {if $order.customer_id} <a href="{$order.link_customer}" title="{$order.name}">{$order.name}</a> {else} {$order.name} {/if} On a new blank line after that, add: {if $order.cust_groups}({$order.cust_groups}){/if}
  5. Hooks

    Is the error_log being created? Who are 'we'? Any further assistance may require direct access to the code.
  6. Orders to Show Customer Group

    I guess it will be a snippet. Enabled: checked Unique ID: orderlistcustgroups@cubecart600+ Execution Order: 99 Description: Adds Customer Group Name(s) to Admin Orders List Trigger: admin.order.index.list Version: 1.0 Author: forums.cubecart.com/topic/53037-orders-to-show-customer-group/ PHP Code: <?php if($smarty_data['list_orders']){ foreach($smarty_data['list_orders'] as &$snippet_orderlistcustgroups_order) { $group_membership = $GLOBALS['db']->misc('SELECT `group_name` FROM `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_customer_membership` AS M INNER JOIN `'.$GLOBALS['config']->get('config', 'dbprefix').'CubeCart_customer_group` AS G WHERE G.`group_id` = M.`group_id` AND M.`customer_id` = '.$snippet_orderlistcustgroups_order['customer_id'].';'); if (is_array($group_membership)) { foreach ($group_membership as $membership) {$member_groups[] = $membership['group_name'];} } $snippet_orderlistcustgroups_order['cust_groups'] = isset($member_groups) ? implode(',', $member_groups) : ''; unset($member_groups); } $GLOBALS['smarty']->assign('ORDER_LIST', $smarty_data['list_orders']); } Warning: This snippet reassigns modified source list data to the template variable. If another hook/snippet with an earlier execution order value retrieves and modifies the actual ORDER_LIST template assignment, that modification to the assignment will be lost. Just FYI.
  7. Orders to Show Customer Group

    In admin, the Edit Order code directly queries the CubeCart_order_summary and CubeCart_order_inventory tables, and constructs its own array of data to populate the admin Edit Order template. This process could, if it wanted to, use Order::getOrderDetails(). I have no idea why it doesn't. I'll be back shortly with suggestions on where to add code (won't be a snippet) to show the customer group in the list of orders.
  8. Orders to Show Customer Group

    Several points: The list of Macros shown is static informational text - the list is not dynamically derived from any sort of on-demand determination or query. Thus, any new template variables made available by plugin, code snippet, or hard coded will have no effect on the list of macros shown. The template line of code shows that it starts with an {if}, and the new variable is inside this block that only gets included if there is a Company Name. Only if there is a Company Name, then the Company Name and then the Groups will be shown. I have not verified where the admin Order Summary gets its info from. If the admin code uses the Order::getOrderDetails() function, then the customer groups will be available. One would need to edit an admin skin template to show it. I will check on that.
  9. I am seeing this with Firefox Quantum as well. Researching. May have something to do with FF misapplying CSS rules to @media print.
  10. Extension Installation

    If I recall correctly, there was an issue with CubeCart several versions past that had this problem. Maybe. Please remind us what version you are running. While it is certainly convenient to copy/paste the token, unbeknownst to you, you may have also included a leading tab, a trailing space, or some other invisible character that has not been trimmed away. If this is the case, try entering the token by hand. Finally, you can also simply download the module, unzip it locally, then FTP the contents to the appropriate folder on your site.
  11. Orders to Show Customer Group

    Please create this Code Snippet (admin, Manage Hooks, Code Snippets tab, Add Snippet link: Enabled: checked Unique ID: addcustgrps@cubecart600+ Execution Order: 99 Description: Adds Customer Membership Group Name(s) to Order Details Trigger: class.order.get_order_details Version: 1.0 Author: forums.cubecart.com/topic/53037-orders-to-show-customer-group/ PHP Code: <?php $snippet_addcustgrps_group_id_resultset = $GLOBALS['db']->select('CubeCart_customer_membership', false, array('customer_id' => $order_summary['customer_id'])); $snippet_addcustgrps_group_ids = []; foreach ($snippet_addcustgrps_group_id_resultset as $snippet_addcustgrps_group_id_record) { $snippet_addcustgrps_group_ids[] = $snippet_addcustgrps_group_id_record['group_id']; } $snippet_addcustgrps_group_name_resultset = $GLOBALS['db']->select('CubeCart_customer_group', 'group_name', array('group_id' => $snippet_addcustgrps_group_ids)); foreach ($snippet_addcustgrps_group_name_resultset as $snippet_addcustgrps_group_name_record) { $snippet_addcustgrps_group_names[] = $snippet_addcustgrps_group_name_record['group_name']; } $values['billing']['cust_groups'] = implode(', ',$snippet_addcustgrps_group_names); Assuming whatever is sending order summaries by email will be using Order::getOrderDetails(), which everything should, there will be this new data. The email templates use a $BILLING array. So, edit any and all templates (HTML and Plain Text) to include the string: {$BILLING.cust_groups} The result in the email could look something like: Spouse, Mistresses, Fav Escorts (depending on which group(s) this customer is assigned to).
  12. German Language

    In the Marketplace, you can download language packs. They get unzipped into CubeCart's /language/ folder.
  13. changing displayed shipping order

    You may need to start with an empty cart. Did you make the edit during an existing shopping basket? If so, then CubeCart is remembering the previous shipping cheapest selection.
  14. You say there is a log entry for Order Confirmation #2017-(whatever) sent to the customer's email address. But the customer has not received it. Any chance this email is in the customer's spam folder? In your hosting account's control panel (Cpanel?), do you have the tool (Track Delivery) that will allow you to test sending an email to the customer's address?
  15. In admin, Email Log, please determine if there are log entries for any email sent to the customer's email address.