Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Rosyweb

Members
  • Posts

    102
  • Joined

  • Last visited

Posts posted by Rosyweb

  1. I've been trying to find an answer to this for some time.  The QTPro add on has a stock table. 

     

    This is in the file modules/qtpro_stock_table.php  

     

    It appears to be ordering it by the table PRODUCTS_STOCK  and the field products_stock_attributes.

     

     

    Adding different Order by to the other queries doesn't seem to change anything.

     

    The problem with the products_stock_attributes field in the table PRODUCTS_STOCK is that it is a varchar field and so sorts lexically. 

     

    So for example I am getting soirting results that show:

    1000

    before

    53

     

    In addition the field has 2 hyphens and a comma.  So I tried on the query a very complicated Order by to first separate the 2 bits of info in the products_stock_attributes field and order them separately (1st in my shop is colour, 2nd is size), then the Cast as Signed integer to order:

     

    // Get the stocklevels
    $products_stock_query=tep_db_query("SELECT products_stock_attributes, products_stock_quantity
                                      FROM " . TABLE_PRODUCTS_STOCK . "
                                      WHERE products_id=" . (int)$HTTP_GET_VARS['products_id'] ."     
                                      ORDER BY SUBSTR(products_stock_attributes,INSTR(products_stock_attributes,'-')+1) ASC, SUBSTR(products_stock_attributes,INSTR(products_stock_attributes,',')+3) ASC,
                                      CAST(products_stock_attributes as SIGNED INTEGER) ASC");

     

     

    It doesn't work.  Cast as signed integer still leaves i.e.

    1000

    before

    200

     

    Any ideas QTPro experts out there?    Has anyone else tried to get the QTPro table sorting correctly?      I have the picklist in the right oder in pad_base. 

     

    many thanks

     

  2. Thanks Burt and Gergely for your help with this

     

    my hosting company have now set the suhosin.get.max_value_length=2048

    (The suhosin.post.max_vars was already set to 2000 and suhosin.post.max_value_length was already set to 1000000. )

     

    So the Sage Pay form 2.0 is now working - yipee!  

     

    I am surprised that I couldn't find anyone else reporting this problem - but now we have the solution, so thats great! 

  3. Hi Gergely

     

    I was on an older site on v. 2.3.1 so that's why Security Checks was not there. 

     

    But have now installed a blank copy of oscommerce with the new sage pay v.2. form already integrated.    Payment form still doesn't work properly on the new installation - takes money, returns an error to customer and does not write the order to the web shop.

     

     

    So now I have re-installed the sage page and suhosin security checks:

    the errors that are appearing are:

     

    suhosin:  Warning: allowed length of POST variable is less then oscommerce configuration table requirements 255 (64).

    sagepay:  Warning: suhosin.get.max_value_length less than 1000 (512).

     

    ok so somewhere a post variable max length is defined that doesn't allow a field length of 255????

     

    So looking at the configuration table through php my admin:

    configuration_title,   configuration_key and  configuration_description are all varchar max length 255 fields.    and this is normal and a new installation. 

     

    But are we barking up the wrong tree.  Surely a blank installation of OSCommerce v.2.3.4 with the new Sage pay form v.2. already integrated into that version should work.  My form module setting are as were suggested with my unique username and password to link to Sage Pay (which works fine on the other form). 

     

    Could it be a server issue??  What do I need to ask my server hosting company? 

     

    many thaks

  4. Hello, I'm trying to upgrade to the latest Sage Pay form v. 2 and although the payment money has been taken successfully through Sage Pay, it then returns the customer to the site with the failure message and no orders are written to the admin side (as it views the payment as a failure).

     

    Anyone else experienced this?  

     

    Any ideas why the form isn't working?  

     

    I haven't modified it at all, it is as the download.  My old sage pay form v. 1.2 worked fine - no problems there and if I swap it back it works fine again. 

     

    I'd be grateful for any help with this ...

     

     

  5. I found the solution and as usual with oscommerce its something really simple. In admin/stock.php

     

    about line 214 just before the closing </form> add <?php echo tep_hide_session_id(); ?>

     

    This will stop the GET method interfering with the session id and requiring a new login.

     

    I think it works fine. See code below:

     

    Original (about line 214)

           
    </table>
           </form></td>
         </tr>
    

     

    Change to:

           
    </table>
           <?php echo tep_hide_session_id(); ?></form></td>
         </tr>
    

  6. So as far as I've got now is finding that the QTPro installation is the only area in admin that uses the Get method and that is what is prompting the re-direct.

     

    I think some other contributions for admin use the GET method. Have found this problem in the forums a few times, but no answers that stop the re-direct on GET method.

     

    Not sure how to get around this - any ideas?

  7. Hi

     

    did you ever resolve this? I'm having the same problem and can't seem to find an answer. Why on using the add button from the stock.php page do I get re-directed to login.php? Why does it not recognise that my login session is current?

     

    To put it another way- what conditions might require this re-login to occur? I'm not sure where to begin looking. Does something in application_top.php or one of the other admin files perform a user validation step that might be failing?

  8. Hi

     

    I have installed QTpro and it is working fine in all respects but this.

     

    In the stock area for any product (page admin/stock.php) when I change the stock quantities and click on the ADD button, before it updates them on the screen I get re-directed to the login.php page each time and have to re-enter my password. So on the Get command for this page it is re-directing me and re-requiring my password.

     

    Obviously this is a nightmare when updating stock quantities to keep having to re-enter the username and password.

     

    I can't find where to stop it doing this. On previous installs of oscommerce with QTpro it didn't do this. Any ideas how and where I can change this?

     

    I've been looking in admin/includes/application_top.php but can't seem to work out where it is redirecting to login.php on this particular command on the stock page. I'm not even sure if I'm looking in the right place.

     

    Any help would be greatly appreciated!

  9. ok I was looking at this the wrong way really. I was getting tied up in the option value setting, rather than the stock quantities it was generating. But the solution, and definitely a hack is very simple. In includes/classes/pad_multiple_dropdowns.php about line 160 it says this

     

              
    
           //initialize out of stock message
           $out.="  stkmsg(document.cart_quantity);\n";
    
    

     

    Just // it out. Basically if you get rid of this line of code it will NOT generate the Out of Stock message when the page is first opened. Which is fine, because at that point both pick list say Please select. The customer still cannot add these to their basket - this doesn't interfere with them being red as 0 quantity and the Out of stock message on 0 quantity will work as soon as they select something from the pick list, because this message is also attached to a onchange event on the pick lists.

     

    Ok if once you have changed the pick lists and then go back to Please select the out of stock message will appear once again, but does it matter!?

  10. Ok, so I managed to do it, but it throws up other problems. Firstly here's how you can add a Please select direct to the multiple dropdowns created by QTpro, amend the coding in this file:

     

    includes/classes/pad_multiple_dropdowns.php about line 92

     

    ORIGINAL: 
    
          $out.='<tr><td align="right" class=main><b>'.$attributes[$o]['oname'].":</b></td><td class=main>".tep_draw_pull_down_menu('id['.$attributes[$o]['oid'].']',array_values($attributes[$o]['ovals']),$attributes[$o]['default'], "onchange=\"stkmsg(this.form);\"")."</td></tr>\n"; 
    
    CHANGE:       
          $out.='<tr><td align="right" class=main><strong>'.$attributes[$o]['oname'].":</strong></td><td class=main>".tep_draw_pull_down_menu('id['.$attributes[$o]['oid'].']',array_merge(array(array('id'=>"", 'text'=>'Please select ')), $attributes[$o]['ovals']),$attributes[$o]['default'], "onchange=\"stkmsg(this.form);\"")."</td></tr>\n";
    

     

    This does what I initially wanted, add a Please select option direct to the multiple dropdown pick lists, without affecting any other pick lists in the site.

     

    However, when the please select option is highlighted, i.e. as soon as they view the product page it is generating the Out of Stock message. The out of stock message is generated whenever the combined option values of the pick lists = 0 or less. I had hoped that by leaving the option value blank " "

    ('id'=>""

    instead of "0" that would do the trick and get rid of the Out of Stock message.

     

    It didn't, so somewhere in the code a blank option value is also triggering the out of stock message. I'm now trying to find a way to make it ignore the blank value (so not bring up the Out of stock message on a blank option value), but without allowing the 'Please select' entry on the pick list to be added to the basket.

     

    I think I need to tweek the code for function _draw_out_of_stock_message_js also in includes/classes/pad_multiple_dropdowns.php

     

    If I manage it, I'll feed back. If anyone manages this, please feed back also, even if its some time later.. I look through old posts for solutions all the time, its invaluable!

  11. Hi all

     

    I've been struggling to find a way to add a "Please select" option to the Multiple Dropdowns that are part of the QTPro contribution. Its set to select the default value for the stock options (products_options_values_id) when the pick list is drawn, so however you order your stock attributes the top item is always selected as the default value for the pick list. Can't seem to find a way to insert an add text option as the default into the coding that is drawing up the pick lists in pad_multiple_dropdowns.php.

     

    Searched the forums and contributions etc, seems like no one has managed this and fed back, lots of people asking how to do this. The best result is a hack at the top level in html_output.php where you add a "please select.." to all pick lists.

     

    just above:

    for ($i=0, $n=sizeof($values); $i<$n; $i++) {

     

    add

    $field .= '<option value="select"';

    $field .= '>Please Select ...</option>';

     

    This is great and thanks for sharing Megan, but this is only part of the way there. This applies "Please select..." to every pick list in the site and the developer has no ability to vary the default for pick lists from Please select. i.e. I like to have United Kingdom at the top of the countries pick list.

     

    So, I'm hoping that someone has managed to do this ...(apply a text default of "please select" or similar) direct to the multiple dropdown pick lists created by the QT Pro contribution

     

    and may be willing to share the code they created to do this? Surely someone has found a way?

  12. Hi all, I'd be really grateful for some help with this.

     

    I've installed QT Pro - imported the scripts using phpmyadmin, then uploaded all the files. Now, when I try to go to the admin area of my web site, I now get the following error messages:

     

    [Warning: main(includes/functions/cache.php): failed to open stream: No such file or directory in /freeola/users/2/8/sr0513182/htdocs/OsCommerce/catalog/admin/includes/application_top.php on line 140

     

    Warning: main(): Failed opening 'includes/functions/cache.php' for inclusion (include_path='.:/usr/local/share/pear') in /freeola/users/2/8/sr0513182/htdocs/OsCommerce/catalog/admin/includes/application_top.php on line 140

     

    Warning: main(includes/classes/navigation_history.php): failed to open stream: No such file or directory in /freeola/users/2/8/sr0513182/htdocs/OsCommerce/catalog/admin/includes/application_top.php on line 146

     

    Fatal error: main(): Failed opening required 'includes/classes/navigation_history.php' (include_path='.:/usr/local/share/pear') in /freeola/users/2/8/sr0513182/htdocs/OsCommerce/catalog/admin/includes/application_top.php on line 146

     

    I'm a bit stuck and don't know what I should change to correct this.

     

    many thanks

×
×
  • Create New...