Forums / Basic Configuration / Sidebox to show for particular pricing group

Sidebox to show for particular pricing group

Locked

Started by touranman on 5 Aug 2009, 10:35 PM · Views: 947

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
5 Aug 2009, 10:35 PM
#1
touranman avatar

touranman

New Zenner

Join Date:
Dec 2006
Posts:
48
Plugin Contributions:
0

Sidebox to show for particular pricing group

I've searched all over and cannot find a solution to this so I'm posting in th hope someone can help me!

I've added an extra sidebox using the 'Blank Sidebox' download but I want that to show only to a certain pricing group.

The code for the box is:

if ($show_blank_sidebox == true) {
      require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
      $title =  BOX_HEADING_BLANK_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }
```so I altered the first line like:

```php
if ($show_blank_sidebox == true) and ($customers_group = '1') {
```I know it's probably not correct as it's not working but hopefully you can see what I am trying to achieve!  Just a simple check to see if the logged in person is a member of a particular pricing group and if it is then display the sidebox.

Any help would be appreciated!

:wink:
6 Aug 2009, 9:32 AM
#2
touranman avatar

touranman

New Zenner

Join Date:
Dec 2006
Posts:
48
Plugin Contributions:
0

Re: Sidebox to show for particular pricing group

OK, managed to figure this one out!

I added a new query to check if the currently logged in customer belongs to a particular pricing group and if so, only displays the sidebox to that pricing group:

$show_blank_sidebox = true;
  $group_query = $db->Execute("select customers_group_pricing from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$_SESSION['customer_id'] . "'");

  if (($show_blank_sidebox == true) && ($group_query->fields['customers_group_pricing'] == '1')) {
      require($template->get_template_dir('tpl_blank_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_blank_sidebox.php');
      $title =  BOX_HEADING_BLANK_SIDEBOX;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
 }