Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bonester1981

Pioneers
  • Posts

    13
  • Joined

  • Last visited

Posts posted by bonester1981

  1. In version QPBPP_v1_3_5 you can only add net prices. I was looking for a way to put gross prices in and that is the way you do it:

     

    admin/categories.php

     

    After: (in the javascript section of categories.php)

    function updateNet() {
     var taxRate = getTaxRate();
     var netValue = document.forms["new_product"].products_price_gross.value;
    
     if (taxRate > 0) {
       netValue = netValue / ((taxRate / 100) + 1);
     }
    
     document.forms["new_product"].products_price.value = doRound(netValue, 4);
    }

    insert:

    <?php 
     for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
    ?>
    function updateGross<?php echo $count; ?>() {
     var taxRate = getTaxRate();
     var grossValue = document.forms["new_product"].products_price<?php echo $count; ?>.value;
    
     if (taxRate > 0) {
       grossValue = grossValue * ((taxRate / 100) + 1);
     }
    
     document.forms["new_product"].products_price_gross<?php echo $count; ?>.value = doRound(grossValue, 4);
    }
    
    function updateNet<?php echo $count; ?>() {
     var taxRate = getTaxRate();
     var netValue = document.forms["new_product"].products_price_gross<?php echo $count; ?>.value;
    
     if (taxRate > 0) {
       netValue = netValue / ((taxRate / 100) + 1);
     }
    
     document.forms["new_product"].products_price<?php echo $count; ?>.value = doRound(netValue, 4);
    }
    <?php } ?>
    

     

    Replace:

                   if(is_array($price_breaks_array) && array_key_exists($count, $price_breaks_array)) {
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'size="10"');
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, $price_breaks_array[$count]['products_qty'], 'size="10"');
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete' . $count, 'y', false) . TEXT_PRODUCTS_DELETE;
                   } else {
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, '', 'size="10"');
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
                     echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, '', 'size="10"');
                   }
    

     

    With:

                   if(is_array($price_breaks_array) && array_key_exists($count, $price_breaks_array)) {
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_PRICE_NET . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'onKeyUp="updateGross'.$count.'()"');
                     echo '<br>' . tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_PRICE_GROSS . tep_draw_input_field('products_price_gross' . $count, $price_breaks_array[$count]['products_price'], 'onKeyUp="updateNet'.$count.'()"');
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_QTY;
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . tep_draw_input_field('products_qty' . $count, $price_breaks_array[$count]['products_qty'], 'size="10"');
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . tep_draw_checkbox_field('products_delete' . $count, 'y', false) . TEXT_PRODUCTS_DELETE;
                   } else {
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_PRICE_NET . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'onKeyUp="updateGross'.$count.'()"');
                     echo '<br>' . tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_PRICE_GROSS . tep_draw_input_field('products_price_gross' . $count, $price_breaks_array[$count]['products_price'], 'onKeyUp="updateNet'.$count.'()"');
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . TEXT_PRODUCTS_QTY;
                     echo tep_draw_separator('pixel_trans.gif', '3', '15') . tep_draw_input_field('products_qty' . $count, '', 'size="10"');
                   }
    

     

    Directly below after:

     

                   ?>
                 </td>
               </tr>
               <?php
               }
               ?>
    

     

    Insert:

    <script language="javascript"><!--
    <?php 
     for ($count = 0; $count <= (PRICE_BREAK_NOF_LEVELS - 1); $count++) {
    ?>
    updateGross<?php echo $count; ?>();
    <?php
    }
    ?>
    //--></script>
    

     

    Now you can enter the price as net or gross. :)

  2. Hello,

    I Installed MVS and everything works fine. When I go to checkout_shipping.php and turn on Kiss Error & Debugging, following errors occur:

     

    Error: Undefined variable: order_id
    File: includes/classes/order.php
    Line: 288
    Error: Undefined index: 1
    File: includes/classes/shopping_cart.php
    Line: 369
    Error: Undefined index: weight
    File: includes/classes/shopping_cart.php
    Line: 369
    Error: Undefined index: cost
    File: includes/classes/shopping_cart.php
    Line: 370
    Error: Undefined index: qty
    File: includes/classes/shopping_cart.php
    Line: 371
    Error: Undefined index: ship_cost
    File: includes/classes/shopping_cart.php
    Line: 373
    Error: Undefined variable: shipping_tax
    File: includes/modules/vendor_shipping.php
    Line: 44
    

     

    Is someone able to fix that?

     

    Kind regards

  3. Hi,

    I am using the newest version of sitemonitor and when hitting "Manually Execute Sitemonitor" following error appears:

     

    Found a new file named newsletters.php

    Found a new file named popup_image.php

    etc.

    Size differences not checked due to deleted file(s)

    Time differences not checked due to deleted file(s)

    Permissions not checked due to deleted file(s)

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Sitemonitor ran on July 28, 2010, 4:09 am

    Total mismatches found were 425

    Total files being monitored is 1

    Email sent to shop owner.

     

    Warning: fopen(sitemonitor_log.txt) [function.fopen]: failed to open stream: Permission denied in /www/htdocs/*****/*****/admin/includes/functions/sitemonitor_functions.php on line 571

     

    Warning: unlink(sitemonitor_reference.php) [function.unlink]: Permission denied in /www/htdocs/*****/*****/admin/sitemonitor.php on line 28

    Found a new file named newsletters.php

    Found a new file named popup_image.php

    Found a new file named cache.php

    Found a new file named define_language.php

    Found a new file named modules.php

    etc

    Found a deleted file named

    Size differences not checked due to deleted file(s)

    Time differences not checked due to deleted file(s)

    Permissions not checked due to deleted file(s)

     

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Sitemonitor ran on July 28, 2010, 4:09 am

    Total mismatches found were 425

    Total files being monitored is 1

    Email sent to shop owner.

     

    Warning: fopen(sitemonitor_log.txt) [function.fopen]: failed to open stream: Permission denied in /www/htdocs/*****/*****/admin/includes/functions/sitemonitor_functions.php on line 571

     

    There are also two emails send.

    When coming back to sitemonitor admin the following error occurs:

     

    Warning: fopen(sitemonitor_log.txt) [function.fopen]: failed to open stream: Permission denied in /www/htdocs/*****/*****/admin/includes/functions/sitemonitor_functions.php on line 571

     

    Warning: unlink(sitemonitor_reference.php) [function.unlink]: Permission denied in /www/htdocs/*****/*****/admin/sitemonitor_admin.php on line 78

     

    Warning: fopen(sitemonitor_log.txt) [function.fopen]: failed to open stream: Permission denied in /www/htdocs/*****/*****/admin/includes/functions/sitemonitor_functions.php on line 571

  4. Hi,

    first of all: thanks FWR for your work!

     

    Installing was easy and I tested it. When I tested the functionality a little error occured:

    When a customer will log in and has forgotten his password and tries a few passwords he will sooner or later get a new one. When pressing the password forgotten link, the customer will be redirected to password_forgotten.php and the email address will be prompted in the email address field, but while using Security Pro, the @ sign will be removed and [email protected] will become userexample.com . This is very uncomfortable for the customer so I wanted to change this:

    The core Security Pro files check if page is declared and will break down the whole security for that page, but this isn´t either what I wanted so I worked around that allowing special chars for user defined pages:

     

    includes\functions\security.php

    Find:

    // Changelog - removed %(percent) added urldecode

    function tep_clean_get__recursive($get_var)

    {

    if (!is_array($get_var))

    return preg_replace("/[^ {}a-zA-Z0-9_.-]/i", "", urldecode($get_var));

     

    // Add the preg_replace to every element.

    return array_map('tep_clean_get__recursive', $get_var);

    }

    Replace with:

    function tep_get_char_exclusions(){

    $fwr_security_excludes = array();

    $fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS);

    //to fill in the array is a bit tricky:

    //At first you have to make a list of safe files to exclude from cleansing

    //in the FWR Security Pro admin.

    //you have to put a number 0-99 before your chars you want

    //to be allowed and put the declared catalog filename(s) to the right

    //See lines below for an example

    $extra_chars = array( '1@' => FILENAME_PASSWORD_FORGOTTEN);

    //'2@' => FILENAME_LOGIN,

    //'3+/+#' => FILENAME_INDEX,

    while ($page_name = current($extra_chars)) {

    if ($page_name == basename($_SERVER['PHP_SELF'])) {

    $allowed = substr(key($extra_chars), 0, 2);

    if(!is_numeric($allowed)){

    $allowed = substr(key($extra_chars), 1);

    }else{

    $allowed = substr(key($extra_chars), 2);

    }

    $replace = "/[^ {}a-zA-Z0-9_.-";

    $replace .= $allowed;

    $replace .= "]/i";

    }

    next($extra_chars);

    }

    if(!isset($replace)){

    $replace = "/[^ {}a-zA-Z0-9_.-]/i";

    }

    return $replace;

    }

    //only for testing if function tep_get_char_exclusions(); works properly

    //echo tep_get_char_exclusions();

     

     

    // Changelog - removed %(percent) added urldecode

    function tep_clean_get__recursive($get_var)

    {

    if (!is_array($get_var))

     

    return preg_replace(tep_get_char_exclusions(), "", urldecode($get_var));

     

    // Add the preg_replace to every element.

    return array_map('tep_clean_get__recursive', $get_var);

    }

    While experimenting I found out, that you can´t use something like this:

    $extra_chars = array( '@' => FILENAME_PASSWORD_FORGOTTEN,

    '@' => FILENAME_LOGIN);

    When I used the $extra_chars on other functions it came like this:

    $extra_chars = array( '@' => FILENAME_LOGIN);

    When someone has another way, please tell me!

     

    Another step has to be taken:

    application_top.php

    Replace:

    // FWR Media Security Pro

    if ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) {

    $fwr_security_excludes = array();

    if ( defined('FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON') && FWR_SECURITY_PRO_FILE_EXCLUSIONS_ON === 'true' )

    $fwr_security_excludes = explode(',', FWR_SECURITY_PRO_FILE_EXCLUSIONS);

    if ( !in_array(basename($_SERVER['PHP_SELF']), $fwr_security_excludes) )

    include('includes/functions/security.php');

    }

    if ( function_exists('tep_clean_get__recursive') ) {

    // Recursively clean $HTTP_GET_VARS and $_GET

    // There is no legitimate reason for these to contain anything but ..

    // A-Z a-z 0-9 -(hyphen).(dot)_(underscore) {} space

    $HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS);

    $_GET = tep_clean_get__recursive($_GET);

    $_REQUEST = $_GET + $_POST; // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed.

    fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value

    }

    // END - FWR Media Security Pro

    with

    // FWR Media Security Pro

    if ( defined('FWR_SECURITY_PRO_ON') && FWR_SECURITY_PRO_ON === 'true' ) {

    require_once('includes/functions/security.php');

    $HTTP_GET_VARS = tep_clean_get__recursive($HTTP_GET_VARS);

    $_GET = tep_clean_get__recursive($_GET);

    //$_REQUEST = $_GET + $_POST; // $_REQUEST now holds the cleaned $_GET and std $_POST. $_COOKIE has been removed.

    fwr_clean_global($_GET); // Change the $GLOBALS value to the cleaned value

    }

    // END - FWR Media Security Pro

    Then go to your admin area ->FWR Security Pro->File Exclusions and set password_forgotten.php

     

    If you want another page allow extra chars, do following:

    For index.php

    1. Go to your admin area ->FWR Security Pro->File Exclusions and set password_forgotten.php,index.php

    2.

    Go to includes\functions\security.php and change in tep_get_char_exclusions() :

     

    $extra_chars = array( '1@' => FILENAME_PASSWORD_FORGOTTEN);

    //'2@' => FILENAME_LOGIN,

    to

    $extra_chars = array( '1@' => FILENAME_PASSWORD_FORGOTTEN),

    '2@#([' => FILENAME_LOGIN);

    For every filename you declare in this part of this code, you to put a number before your allowed chars. the next where '3*' => FILENAME_LOGIN

    and so on...

     

    Comments are appreciated!

  5. Hi,

    some time ago I posted these errors using FWR´s Error Handling:

    E_NOTICE Error Count: 2

    Error: Undefined property: sts_default::$enabled

    File: includes/classes/sts.php

    Line: 94

    Error: Undefined property: sts::$display_debug_output

    File: includes/modules/sts_inc/sts_display_output.php

    Line: 33

     

    Used contrib:

    STSv4.5.8 Dated Jan 23, 2008

     

    I found a way to fix it:

    Error: Undefined property: sts_default::$enabled

    File: includes/classes/sts.php

    Line: 94

    if ($this->script->enabled==false) {

    Change to:

    if (isset($this->script->enabled) && $this->script->enabled==false) {

     

    Error: Undefined property: sts::$display_debug_output

    File: includes/modules/sts_inc/sts_display_output.php

    Line: 33

    if ($sts->display_debug_output) {

    Change to:

    if (isset($sts->display_debug_output)) {

     

    I hope this will help! :)

  6. Hi,

    here is another list:

    http://solariz.de/download-7

    Perhaps you can implement it as a second stopword list, because it is much bigger than the first one so german users can decide which one they will use.

     

    Your Error Handler works well: :)

     

    E_STRICT Error Count: 1

    Error: Non-static method KissMT_Modules::stripStopWords() cannot be called statically, assuming $this from compatible context KissMT_Module

    File: includes/modules/kiss_meta_tags/abstracts/kiss_modules.php

    Line: 134

     

    This error occurs when I visit index.php

  7. Hi,

    I added FWR Media´s KissER Error Handling and the output was:

     

    E_NOTICE Error Count: 2

    Error: Undefined property: sts_default::$enabled

    File: includes/classes/sts.php

    Line: 94

    Error: Undefined property: sts::$display_debug_output

    File: includes/modules/sts_inc/sts_display_output.php

    Line: 33

     

    I tried to fix it, but the page got broken...

     

    Can someone fix it?

     

    Used contrib:

    STSv4.5.8 Dated Jan 23, 2008

  8. Hi,

    I am testing this contribution and find it very useful. I like your contribs, thanks for that! :)

     

    Everything works fine, except this:

     

    Error: Undefined index: break

    File: includes/kiss_error_handler.php

    Line: 316

    E_WARNING Error Count: 1

    Error: Invalid argument supplied for foreach()

    File: includes/kiss_error_handler.php

    Line: 316

     

    My configuration:

    PHP Version 5.2.12

    Linux

     

    Kind regards

×
×
  • Create New...