Jump to content

cottonmiller

Members
  • Content count

    16
  • Joined

  • Last visited

  1. <?php /* $Id: ul_categories.php,v 1.00 2006/04/30 01:13:58 nate_02631 Exp $ Outputs the store category list as a proper unordered list, opening up possibilities to use CSS to style as drop-down/flyout, collapsable or other menu types. osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright © 2006 Nate Welch [url="http://www.natewelch.com"]http://www.natewelch.com[/url] Released under the GNU General Public License */ // BEGIN Configuration options // Set to false to display the unordered list only. Set to true to display in // a regular box. The former is useful for better integrating the menu with your layout. $show_ulcats_as_box = false; // Indicates whether or not to render your entire category list or just the root categories // and the currently selected submenu tree. Rendering the full list is useful for dynamic menu // generation where you want the user to have instant access to all categories. The other option // is the default oSC behaviour, when the subcats aren't available until the parent is clicked. $show_full_tree = false; // This is the CSS *ID* you want to assign to the UL (unordered list) containing // your category menu. Used in conjuction with the CSS list you create for the menu. // This value cannot be blank. $idname_for_menu = 'categories'; // This is the *CLASSNAME* you want to tag a LI to indicate the selected category. // The currently selected category (and its parents, if any) will be tagged with // this class. Modify your stylesheet as appropriate. Leave blank or set to false to not assign a class. $classname_for_selected = 'selected'; // This is the *CLASSNAME* you want to tag a LI to indicate a category has subcategores. // Modify your stylesheet to draw an indicator to show the users that subcategories are // available. Leave blank or set to false to not assign a class. $classname_for_parent = 'parent'; // This is the HTML that you would like to appear before your categories menu if *not* // displaying in a standard "box". This is useful for reconciling tables or clearing // floats, depending on your layout needs. $before_nobox_html = '<div id="category_depts">'; // This is the HTML that you would like to appear after your categories menu if *not* // displaying in a standard "box". This is useful for reconciling tables or clearing // floats, depending on your layout needs. $after_nobox_html = '</div>'; // END Configuration options // Global Variables $GLOBALS['this_level'] = 0; // Initialize HTML and info_box class if displaying inside a box if ($show_ulcats_as_box) { echo '<tr><td>'; $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES); new infoBoxHeading($info_box_contents, true, false); } // Generate a bulleted list (uses configuration options above) $categories_string = tep_make_cat_ullist(); // Output list inside a box if specified, otherwise just output unordered list if ($show_ulcats_as_box) { $info_box_contents = array(); $info_box_contents[] = array('text' => $categories_string); new infoBox($info_box_contents); echo '</td></tr>'; } else { echo $before_nobox_html; echo $categories_string; echo $after_nobox_html; } // Create the root unordered list function tep_make_cat_ullist($rootcatid = 0, $maxlevel = 0){ global $idname_for_menu, $cPath_array, $show_full_tree, $languages_id; // Modify category query if not fetching all categories (limit to root cats and selected subcat tree) if (!$show_full_tree) { $parent_query = 'AND (c.parent_id = "0"'; if (isset($cPath_array)) { $cPath_array_temp = $cPath_array; foreach($cPath_array_temp AS $key => $value) { $parent_query .= ' OR c.parent_id = "'.$value.'"'; } unset($cPath_array_temp); } $parent_query .= ')'; } else { $parent_query = ''; } $result = tep_db_query('select c.categories_id, cd.categories_name, c.parent_id from ' . TABLE_CATEGORIES . ' c, ' . TABLE_CATEGORIES_DESCRIPTION . ' cd where c.categories_id = cd.categories_id and cd.language_id="' . (int)$languages_id .'" '.$parent_query.' order by sort_order, cd.categories_name'); while ($row = tep_db_fetch_array($result)) { $table[$row['parent_id']][$row['categories_id']] = $row['categories_name']; } $output .= '<ul id="'.$idname_for_menu.'">'; $output .= tep_make_cat_ulbranch($rootcatid, $table, 0, $maxlevel); // Close off nested lists for ($nest = 0; $nest <= $GLOBALS['this_level']; $nest++) { $output .= '</ul>'; } return $output; } // Create the branches of the unordered list function tep_make_cat_ulbranch($parcat, $table, $level, $maxlevel) { global $cPath_array, $classname_for_selected, $classname_for_parent; $list = $table[$parcat]; while(list($key,$val) = each($list)){ if ($GLOBALS['this_level'] != $level) { if ($GLOBALS['this_level'] < $level) { $output .= "\n".'<ul>'; } else { for ($nest = 1; $nest <= ($GLOBALS['this_level'] - $level); $nest++) { $output .= '</ul></li>'."\n"; } /* if ($GLOBALS['this_level'] -1 == $level) $output .= '</ul></li>'."\n"; elseif ($GLOBALS['this_level'] -2 == $level) $output .= '</ul></li></ul></li>'."\n"; elseif ($GLOBALS['this_level'] -3 == $level) $output .= '</ul></li></ul></li></ul></li>'."\n"; elseif ($GLOBALS['this_level'] -4 == $level) $output .= '</ul></li></ul></li></ul></li></ul></li>'."\n"; */ } $GLOBALS['this_level'] = $level; } if (isset($cPath_array) && in_array($key, $cPath_array) && $classname_for_selected) { $this_cat_class = $classname_for_selected . ' '; $list_item_end = ''; } else { $this_cat_class = ''; $list_item_end = '</li>'; } if ($level == 2) { $prefix = '» '; } else { $prefix = ''; } $output .= '<li class="'.$this_cat_class.'cat_lev_'.$level.'"><a class="catlink lev_' .$level.''; if (tep_has_category_subcategories($key) && $classname_for_parent) { $this_parent_class = ' ' . $classname_for_parent; } else { $this_parent_class = ''; } $output .= $this_parent_class; $output .= '" href="'; if (!$level) { unset($GLOBALS['cPath_set']); $GLOBALS['cPath_set'][0] = $key; $cPath_new = 'cPath=' . $key; } else { $GLOBALS['cPath_set'][$level] = $key; $cPath_new = 'cPath=' . implode("_", array_slice($GLOBALS['cPath_set'], 0, ($level+1))); } $output .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$prefix.$val.'</a>'.$list_item_end."\n"; /*if (!tep_has_category_subcategories($key)) { $output .= '</li>'."\n"; }*/ if ((isset($table[$key])) AND (($maxlevel > $level + 1) OR ($maxlevel == '0'))) { $output .= tep_make_cat_ulbranch($key,$table,$level + 1,$maxlevel); } } // End while loop return $output; } ?> The change above is clean xhtml with correctly nested classes - hop eit helps someone... I also added this CSS to show only categories belonging to the parent you are in - you'll need to change the font-colours to your own though ... :) #categories { } #categories ul li { border-bottom:1px solid #ececec; } #categories a { display:block; width:170px; font-size:1.1em; } #categories a:hover { background-color:#ebe2eb; } #categories .catlink { padding:6px 0px; } #categories ul .selected .lev_1 { font-weight:bold; color:#671664; background-color:#f7f3f7; } /* hide all other parent cats */ #categories .cat_lev_0 { display:none; } /* heading for the cat we are in */ #categories .selected .lev_0 { width:160px; padding:5px 2px 5px 8px; font-size:1.5em; font-weight:normal !important; color:#fff !important; background:#671664 url("../../images/assets/purpleBG.gif") repeat-x top; } #categories .selected .lev_0:hover { color:#fff !important; } /* display the subcats */ #categories .selected { display:list-item; } #categories .selected .cat_lev_1 { border-bottom:1px solid #ececec; } /* heading for the second level cat we are in */ #categories .selected .parent { /*font-weight:bold; color:#671664;*/ } /* display the subcats */ #categories .selected .cat_lev_1 ul { border-top:1px solid #ccbacb; border-bottom:1px solid #ccbacb; background-color:#f7f3f7; } #categories .selected .cat_lev_1 ul .cat_lev_2 { border-bottom:none; } #categories .selected .cat_lev_1 ul .lev_2 { padding:3px 0px; padding-left:5px; width:165px; font-size:1em; background-color:#f7f3f7; } #categories .selected .cat_lev_1 ul .lev_2:hover { background-color:#ebe2eb; } /* third level cat we are in */ #categories .selected .selected .selected .lev_2 { font-weight:bold; color:#671664 !important; background-color:#ebe2eb !important; }
  2. cottonmiller

    Protx Direct v2.22

    Hi Tom, @mfos Just thought I'd add a little info on the scrollbars issue, IE & Firefox (the two main browsers) render them differently. As long as you specify a little extra height to allow for the 3D Secure info you can cater for both scenarios gracefully by ensuring you have both the attributes below set ... frameborder="0" scrolling="no" catalog/process.php - line 442 change <iframe src="<?php echo tep_href_link('protx_process.php' ,'action=iframe&termurl='.urlencode(tep_href_link('protx_process.php','action=3Dreturn&iframe=Y&ProtxID='.$protx_id, 'SSL', 'true')), 'SSL', 'true'); ?>" width="400px" height="400px" frameborder=1 scrolling="auto"></iframe> to <iframe src="<?php echo tep_href_link('protx_process.php' ,'action=iframe&termurl='.urlencode(tep_href_link('protx_process.php','action=3Dreturn&iframe=Y&ProtxID='.$protx_id, 'SSL', 'true')), 'SSL', 'true'); ?>" [color="#FF0000"]width="500px" height="450px" frameborder="0" scrolling="no"[/color]></iframe> Hope this helps James
  3. cottonmiller

    Protx Direct v2.22

    Many customers have been complaining today about time-outs using various card types; using the support here (thanks to the usual suspects) and from Protx has kept sales alive to a degree today although phone sales have been up - there's a shock! Just for everyone's info Tesco reported card processing erros for 3 hours this morning and there were one or two issue with the Clear Commerce Engine (Barclays, HSBC etc) so it seems that customers may have encountered online transactional problems with the big boys too ... helps keep things positive ;) James
  4. cottonmiller

    Protx Direct v2.22

    Thanks for the tip, like the use of case test ... I've been tied up with other issues since and will apply the new updates later, thanks for your support again James
  5. cottonmiller

    Protx Direct v2.22

    Hi Tom My coding skills are good, my spelling is a jooke :'( Thanks again James
  6. cottonmiller

    Protx Direct v2.22

    @Babygurgles And its a yes from me as they say :thumbsup: @perfectpassion @Vger Hi Guys On the code changing front, I've made changes to admin/orders_protx.php as per the new url docs from protx but they fail (just trying to add my bit really). I've commented them out below as the old ones still work ... It's not another typo from me is it ??? :blush: Line 35 ish switch ($_GET['process']) { case 'release': $data = 'VPSProtocol=2.22' . '&TxType=RELEASE' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $transaction['vendortxcode'] . '&VPSTxID=' . $transaction['vpstxid'] . '&SecurityKey=' . $transaction['securitykey'] . '&TxAuthNo=' . $transaction['txauthno']; $service = 'VendorReleaseTX'; //$service = 'release.vsp'; new path ending as per protx break; case 'refund': require_once(DIR_WS_CLASSES . 'order.php'); $order = new Order($oID); $uid = tep_create_random_value(32, 'digits'); $VendorTxCode = $oID . '-'. $uid; $data = 'VPSProtocol=2.22' . '&TxType=REFUND' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $VendorTxCode . '&Amount=' . $_GET['value'] . '&Currency=' . $order->info['currency'] . '&Description=' . urlencode('Refund via osC Admin Area') . '&RelatedVPSTxId=' . $transaction['vpstxid'] . '&RelatedVendorTxCode=' . $transaction['vendortxcode'] . '&RelatedSecurityKey=' . $transaction['securitykey'] . '&RelatedTxAuthNo=' . $transaction['txauthno']; $service = 'VendorRefundTX'; / /$service = 'refund.vsp'; new path ending as per protx break; case 'authorise': $uid = tep_create_random_value(32, 'digits'); $VendorTxCode = $oID . '-'. $uid; $data = 'VPSProtocol=2.22' . '&TxType=AUTHORISE' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $VendorTxCode . '&Amount=' . $_GET['value'] . '&Description=' . urlencode('Authorise via osC admin area') . '&RelatedVPSTxId=' . $transaction['vpstxid'] . '&RelatedVendorTxCode=' . $transaction['vendortxcode'] . '&RelatedSecurityKey='. $transaction['securitykey']; $service = 'VendorAuthoriseTX'; //$service = 'authorise.vsp'; new path ending as per protx break; case 'cancel': $data = 'VPSProtocol=2.22' . '&TxType=CANCEL' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $transaction['vendortxcode'] . '&VPSTxId=' . $transaction['vpstxid'] . '&SecurityKey=' . $transaction['securitykey']; $service='VendorCancelTX'; //$service='cancel.vsp'; new path ending as per protx break; case 'abort': $data = 'VPSProtocol=2.22' . '&TxType=ABORT' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $transaction['vendortxcode'] . '&VPSTxId=' . $transaction['vpstxid'] . '&SecurityKey=' . $transaction['securitykey'] . '&TxAuthNo=' . $transaction['txauthno']; $service='VendorAbortTX'; //$service='abort.vsp'; new path ending as per protx break; case 'void': $data = 'VPSProtocol=2.22' . '&TxType=VOID' . '&Vendor=' . MODULE_PAYMENT_PROTX_DIRECT_VENDOR_NAME . '&VendorTxCode=' . $transaction['vendortxcode'] . '&VPSTxId=' . $transaction['vpstxid'] . '&SecurityKey=' . $transaction['securitykey'] . '&TxAuthNo=' . $transaction['txauthno']; $service='VendorVoidTX'; //$service='void.vsp'; new path ending as per protx break; } unset($response); if (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Test') { $url = 'https://ukvpstest.protx.com/vps200/dotransaction.dll?Service='.$service; } elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Server IP Test') { $url = 'https://ukvpstest.protx.com/showpost/showpost.asp'; } elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Simulator') { $url = 'https://ukvpstest.protx.com/VSPSimulator/VSPServerGateway.asp?Service='.$service; } else { $url = 'https://ukvps.protx.com/vps200/dotransaction.dll?Service='.$service; } // THIS SET FAILS WITH THE NEW PATHS UNCOMMENTED ABOVE // if (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Test') { // $url = 'https://ukvpstest.protx.com/vpsgateway/service/'.$service; // } elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Server IP Test') { // $url = 'https://ukvpstest.protx.com/showpost/showpost.asp'; // } elseif (MODULE_PAYMENT_PROTX_DIRECT_TRANSACTION_MODE == 'Simulator') { // $url = 'https://ukvpstest.protx.com/VSPSimulator/VSPServerGateway.asp?Service='.$service; --- this needs changing too // } else { // $url = 'https://ukvps.protx.com/vpsgateway/service/'.$service; // } James
  7. cottonmiller

    Protx Direct v2.22

    Very nice scheme ... are you TerraNetwork then ? James
  8. cottonmiller

    Protx Direct v2.22

    Thank you, I also design for many Os users since putting mine live so third party comments are always appreciated :blush: One in progress www.kover-it.co.uk (new oscommerce version in develeopment @ www.allweathercovers.co.uk - should be live in around 4 weeks)
  9. cottonmiller

    Protx Direct v2.22

    I re wrote the whole package in <div> and css and the iframe layout is not fitting correctly; not an issue I'll sort that today now that functionality is restored. Thanks again - I take your point about Switch :-"
  10. cottonmiller

    Protx Direct v2.22

    @Babygurgles - you are correct but I am not .. Tom Many thanks, replacing the code (with correct bloody spellings) has made me fully functional (although very unsightly to the user at the mo) once more!!! Hooray ... Seriuosly, if you need any linen, mail me what you like on the site and I'll look after you in a trade kinda way :rolleyes: James http://www.linenslimited.co.uk - Bedding, Linen & Towels One thing though .... the module still refers to Switch - that's not allowed is it ???
  11. cottonmiller

    Protx Direct v2.22

    Tom Thanks for the reply, I had already tried this and it is currently set to true - I'm getting this error either way ... (test data here of course) Request URL=https://ukvps.protx.com/vpsgateway/service/vspdirect-register.vsp Data string sent=VPSProtocol=2.22&TxType=PAYMENT&Vendor=Linens&VendorTxCode=4666-37859562676181278916619132408689&Amount=13.89&Currency=GBP&Description=Order+Number%3A+4666&CardHolder=James+Wilkinson&CardNumber=4929000000006&StartDate=0103&ExpiryDate=0509&IssueNumber=&CV2=123&CardType=VISA&BillingAddress=55+the+street%2C%0D%0A%2C%0D%0Aslough%2C%0D%0Aberks%2C%0D%0AUnited+Kingdom&BillingPostCode=sl1+1al&DeliveryAddress=55+the+street%2C%0D%0A%2C%0D%0Aslough%2C%0D%0Aberks%2C%0D%0AUnited+Kingdom&DeliveryPostCode=sl1+1al&CustomerName=James+Wilkinson&ContactNumber=12345&CustomerEMail=admin%40linenslimited.co.uk&ClientIPAddress=82.69.52.149&Basket=2%3AFaux+Suede+Swirl+Cushion+Cover+%28Chocolate%29%2C+18%22+x+18%22%3A1%3A5.91%3A1.03%3A6.94%3A6.94%3AShipping%3A1%3A6.95%3A----%3A6.95%3A6.95&AccountType=E&Apply3DSecure=0 Protx response= The page cannot be foundThe page you are looking for might have been removed, had its name changed, or is temporarily unavailable. --------------------------------------------------------------------------------Please try the following:Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted. Click the Back button to try another link. HTTP Error 404 - File or directory not found.Internet Information Services (IIS)--------------------------------------------------------------------------------Technical Information (for support personnel)Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404. Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages. Response array=Array ( [] => [ "Content-Type" Content=text/html; charset=Windows-1252"> [ Is this a firewall issue do you think? Why the 404 response??? James (if you need any linen let me know) http://www.linenslimited.co.uk
  12. cottonmiller

    Protx Direct v2.22

    Hi, hope you can help ??? Following the changes yesterday I upgraded to v4.3 and enabled 3d secure in VSP Admin. Since then i have had various issues and currently get no responses from protx servers (or so it appears) when I switch to debug mode; I can see that all my values are being correcly sent but the response page below is a 404 - page not found? Is this because I need to tell Protx that I have upgraded and enabled 3d secure? And do they have to register my account before I can make use of 3d? Before getting the 404 page I was seeing the response below but not now - any ideas why? curl_error= SSL certificate problem, verify that the CA cert is OK error:1409086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certifictae verify failed We have currently taken no orders since the Protx upgrade and I am getting no help from Protx at he mo - all lines are jammed. Thanks in advance James http://www.linenslimited.co.uk - Bedding
×