Jump to content

Ternet

Members
  • Content count

    7
  • Joined

  • Last visited

1 Follower

Profile Information

  1. Just in case anyother have same promlem than me with this contrib and PHP 5 I got error messages: FIX IT LIKE THIS: Open installed_contributions.php Go to line 308 and find: REPLACE IT: There, now it works!!!
  2. so that you could remove the button for pwa customers. From what I understand, the customer information is deleted once checkout_process.php loads so I'm not sure what other ways there are to allow a PWA customer to print an invoice since their information no longer exists and of course we can't create a table to store just their information since that defeats the whole purpose of PWA. I don't think its a good idea to give access to the orders table as was mentioned in the post you quoted. I think the best option is to not show the print invoice button to pwa customers. Just a thought to PrintOrder contrib with PWA problem would it be secure enough if we examine in the checkout_success.php page if the customer is PWA, if s/he is then crypt the order_id (with the key admin defines) and add for instance 'pwa' to it. order_id=<pwa><crypted oID => order_id=pwa984747 Pass the crypted oID to printorder. Printorder could then examine if Order_id contains 'pwa'. If it contains, it de-crypts the real order_id and shows the printable order to the PWA customer. To add security (so that there is no way to bookmark the page) this is possible to do - lets say - only 20 minutes after the purchace. I know it is not the most secure solution, but would it be secure enough??
  3. This suggestion isn't useful because the file that's missing isn't in the contribution! It should come with oscommerce, not with the contribution. Maybe you deleted it accidentally?
  4. My main page looks different than categories, but unfortunately STS1.8 does not (yet?) support template for a category. So I made something myself. I'm not a php guru, so use this at your own risk. This works for me, but it may not work for you... This implementation has that each category has a own template or all categories uses a common template. A) Open sts_display_output.php B) Find a line: $scriptname = getenv('SCRIPT_NAME'); Add below: //Category template: Read query $isacategory = getenv('QUERY_STRING'); //Use common template for a category 1=yes, 0=no $commoncat_template=0; //Category template end NOTE! Set $commoncat_template=1 if you want to use common category template, otherwise leave it 0. C) Find a line $sts_template_file = STS_TEMPLATE_DIR . $scriptbasename . ".html"; Replace it with //Category template: use different template if cPath is found if (strpos($isacategory, "cPath") !== false) { if ($commoncat_template =='1') { //use common category $sts_template_file = STS_TEMPLATE_DIR . "cPath.php.html"; } else //use different templates { //remove 'cPath=' $splitcpath = substr($isacategory, strrpos($isacategory, 'cPath=')+6); //find if query string contains more if (strpos($splitcpath, '&') !== false) { //find how many char needs to be removed from query string $tmp_len=strlen($splitcpath)-strlen(substr($splitcpath, strpos($splitcpath, '&'))); //remove all but catID $isacatID='cPath' . substr($splitcpath, 0, $tmp_len); } else //query string contains only cPath=catID, then catID=$splitcpath { $isacatID='cPath' . $splitcpath; } $sts_template_file = STS_TEMPLATE_DIR . $isacatID . ".php.html"; } } else { $sts_template_file = STS_TEMPLATE_DIR . $scriptbasename . ".html"; }//Category template end D) Then make templates If you want to use common template, create only one template and name it cPath.php.html. All categories and sub-categories uses this template. If you want to use own template for each category, name them to cPath<catID>.php.html, replace <catID> according your category ID i.e. if category ID is 17, template name is cPath17.php.html and for category ID 18 cPath18.php.html and so on... For sub-categories: if a category 17 has a sub-category 20, template should be named cPath17_20.php.html, and so on. (I haven't tested sub-categories very thoroughly, but it should be ok) If you do not create a template for a category, it uses the default template. E) Put template(s) in your custom template directory (ie. .../includes/sts_templates/) And that's all and now it should work... :D -Terhi
×