Jump to content


  • Content count

  • Joined

  • Last visited

Posts posted by guigs

  1. Buy now buttons and split page results showing wrong uris


    Two people so far (guigs and a12c4magic) have had issues where incorrect links were produced for buy now buttons and the split page results links.


    This has now been solved thanks to guigs who very generously gave me access to his live shop to find the issue .. thanks guigs.


    So what was it?


    $PHP_SELF ($_SERVER['PHP_SELF']) is used in osCommerce to identify the current page PHP_SELF however should not be used for several reasons the main ones being that it can be spoofed and is unreliable. In this case basename($PHP_SELF) as used in split_page_results.php was not returning the current file but returning part of an seo url like .. my-product-c-32. The correct thing to do is use the reliable $_SERVER['SCRIPT_NAME'] instead.


    What do I do to make it work?




    Find ..


      if (!isset($PHP_SELF)) $PHP_SELF = basename($_SERVER['SCRIPT_NAME']);


    Replace with ..


      if( !isset($PHP_SELF) || (isset($PHP_SELF) && (false === (substr(basename($PHP_SELF), -4, 4) == '.php'))) ){
    $PHP_SELF = basename($_SERVER['SCRIPT_NAME']);


    Thank you very much!


    Here is my contribution for character conversion:



      $char_convert = array(
    'à' => 'a', 'â' => 'a', 'á' => 'a', 'ã' => 'a',
    'ê' => 'e', 'ë' => 'e', 'é' => 'e',
    'ô' => 'o', 'ó' => 'o', 'õ' => 'o', 'ö' => 'o',
    'ú' => 'u', 'ü' => 'u',
    'í' => 'i', 'ç' => 'c', 'ñ' => 'n',
    'À' => 'A', 'Â' => 'A', 'Á' => 'A', 'Ã' => 'A',
    'Ê' => 'E', 'Ë' => 'E', 'É' => 'E',
    'Ô' => 'O', 'Ó' => 'O', 'Õ' => 'O', 'Ö' => 'O',
    'Ú' => 'U', 'Ü' => 'U',
    'Í' => 'I', 'Ç' => 'C', 'Ñ' => 'N',
    'ª' => 'a', 'º' => 'o'

  2. Hi


    There is obviously an issue here if two people have experienced it but I can't replicate the issue locally. I really need to see the site and do some debugging to find where the problem is.


    I just looked at your site but couldn't see the buy now buttons.


    I hide them since they are buggy ;)


    What can I do to help you debbuging this?



  3. Robert,


    First, thank you for this excelent add-on! I really appreciate it.

    I've installed it, and everything is working but the "buy it now" button.


    The URL it gives is: http://www.artedefazerartesanato.com.br/esculturas-c-36?cPath=36&sort=3a&action=buy_now&products_id=137'>http://www.artedefazerartesanato.com.br/esculturas-c-36?cPath=36&sort=3a&action=buy_now&products_id=137

    But it should be: http://www.artedefazerartesanato.com.br/index.php/esculturas-c-36?cPath=36&sort=3a&action=buy_now&products_id=137


    I see in this forum that someone else had this problem too. But I didn't find a solution.


    I'm using standard mode and I have the following in configure.php:


    define('DIR_WS_HTTP_CATALOG', '/');