Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adham

Archived
  • Posts

    21
  • Joined

  • Last visited

Posts posted by Adham

  1. How do I alter the default "Select" value for a slave product from 1 to 0?

     

    What you need do is to open includes/modules/master_listing.php and look for

     

    $lc_text = '<b>Quantity</b><br />' . tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '1', 'size="4"');

     

    and change it to

     

    $lc_text = '<b>Quantity</b><br />' . tep_draw_input_field('Qty_ProdId_' . $listing['products_id'], '0', 'size="4"');

     

    This will be useful if you have more than one slave product and you don't want your customers to add all the slaves when they click the add to cart button . The customer will obviously have to input the quantity required.

     

    Hope that is what you wanted.

     

    Adham

  2. Hi,

     

    I am having a problem with Option Type Feature and getting it to work with Master / Slave Products.

     

    The problem is that Master / Slave products doesn't seem to support text or text areas and will only display a select box with 'TEXT' written in it.

     

    I have attempted to change the code to display an input box instead, which worked to the extent that either no input was passed through to the basket or that the product was not added to the basket.

     

    Has anyone had similar problems and have they got a fix for it?

     

    Many thanks,

     

    Adam Hammerton

  3. I'm having a new problem with this contribution. I have product options for my slave products and it's allowing people to order those options even though there isn't any stock available. How can I modify the files so that if the stock is 0, the option no longer shows?

    This should be a simple matter of setting your stores configuration. In yours store admin section, go to Configuration / Stock and set 'Allow Checkout' to false so at least they can't check out.

     

    Other than that, it should be a matter of changing the $master_sql query in includes/modules/master_products.php and you'll have to change the query to incorporate a check for stock levels.

     

    Look for:

     

    $master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

     

    Change to something like the below (Be warned, I have NOT tested this what so ever, so it will probably fail!)

     

    $master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_quantity != '0' and p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

     

    Hope it helps.

     

    Adam

  4. Finally we have cracked it! Many thanks to Daze here who finally found the problem after I had pulled out all my hair.

     

    If anyone is interested, here is the solution we had to apply:

     

    Code in Application_top.php BEFORE

     

    function update_quantity($products_id, $quantity = '', $attributes = '') {
         global $customer_id;
    
         if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..
    
         $this->contents[$products_id] = array('qty' => $quantity);
    // update database
         if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
    
       }

     

     

    Code in Application_top.php after we were through with it - AFTER

    function update_quantity($products_id, $quantity = '', $attributes = '') {
           global $customer_id;
    
           if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true..
    
           $this->contents[$products_id] = array('qty' => $quantity);
    
           // update database
           if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'");
    
    
           if (is_array($attributes)) {
    
             reset($attributes);
             while (list($option, $value) = each($attributes)) {
                //** $this->contents[$products_id_string]['attributes'][$option] = $value;
               //CLR 020606 check if input was from text box.  If so, store additional attribute information
               //CLR 020708 check if text input is blank, if so do not add to attribute lists
               //CLR 030228 add htmlspecialchars processing.  This handles quotes and other special chars in the user input.
    
    
               $attr_value = NULL;
               $blank_value = FALSE;
               if (strstr($option, TEXT_PREFIX)) {
                 if (trim($value) == NULL)
                 {
                   $blank_value = TRUE;
                 } else {
                   $option = substr($option, strlen(TEXT_PREFIX));
                   $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES);
                   $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID;
    
                   $this->contents[$products_id]['attributes_values'][$option] = $attr_value;
                   //$this->contents[$products_id_string]['attributes_values'][$option] = $attr_value;
                 }
               }
    
               if (!$blank_value) {
    
    
                 $this->contents[$products_id]['attributes'][$option] = $value;
                 //$this->contents[$products_id_string]['attributes'][$option] = $value;
    
               // insert into database
               //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes.
               //CLR 030228 add tep_db_input() processing
                 //** if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
                 //** if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
                 if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')");
    
    
    
               }
             }
           }
       }
    

    There might be a need, if you have a similar problem, to change some of this - just don't ask me what!

  5. I have a pretty major problem with one of our online stores that has just gone live.

     

    The problem is this:

     

    When a customer adds a product with selected attributes to their cart, all is fine and they can do this as many times as they like.

    However, when a customer updates the shopping cart by changing the quantity or removing a product, the attributes options are nol onger displayed, but the attributes are still in the product_id as can been seen in the link back to hte product from the in the cart).

     

    When we check the sessions table, to begin with the products attributes are in there as expected until the cart is updated. So there must be a problem with the re-writting of the update cart function.

     

    I have been trying to narrow it down but cannot see any potential problems in the follow:

     

    function tep_get_uprid($prid, $params) and function tep_get_prid($uprid) in incs/functions/general.php

     

    case 'update_product' in application top

     

    And of course sessions.php in incs/functions/

     

    I any one can offer any advice on what to be looking for, it would be greatly appreciated.

     

    Adam Hammerton

     

     

    Any ideas would be gratefully received...

     

    My thanks in advance.

     

    Adam

  6. if I assign a product whose id is 645 as a master then the product whose id is 45 will also be assigned. If anyone is aware of a fix for this I would most like to hear it. Thank you very much for your time.

     

     

    I have been looking for an answer to the same problem with regards to Master Products and the LIKE statement.

     

    Has any one got an answer to this problem? If so, I would be very grateful if you could help, as I have only yesterday set a new site live and this problem has only come to light now (typically it didn't occur in testing).

     

    On a related matter, have you experienced problems with attributes with mast products. We have them working fine except for when the cart is updated in the shopping cart page. At this point, the attributes are nor longer displayed. They do appear to be kept though on record as they do appear in hte confirm order page...

     

    Looking forward to any help you can provide.

  7. Since the text that was typed in is added as an attribute to the products_id string, for example {text_7}text_that_was_added, different text makes a different product so it shouldn't be a problem.

     

    Many thanks for letting me know, this is driving me insane. Do you happen to know where the installation of this contribution might have gone wrong? The contribution was added to a heavily altered site and re-installing to an older version is not an option at this stage.

  8. I hope that someone can spare me 5 mins to answer a quick question for me regarding this contribution.

     

    We added the Option Type Feature to an online greeting card store so that customers could enter the text that they want to appear on their cards. It all seemed to work fine when we tested it and the site has been live for a while now.

     

    However, what has been noticed is that a customer cannot purchase two versions of the same card and add seperate greetings for each card. The customer can only edit the greeting.

     

    Is this how the contribution is designed to work or have we done something wrong with the installation? If it is the latter, then I have some work to do...

  9. Hi Ken,

    Yes, I'm using protx form, settings as follows:

     

    Enable Protx Form Module = "True"

     

    Transaction Currency = "Default Currency"

     

    Payment Zone = "--none--"

     

    Set Order Status = "default"

     

    Sort order of display = "0"

     

    Test Mode = "false"

     

    Use Pre-Authorisation = "false"

     

    Shopping cart = "true"

     

    This setup seems to work, but I want to use pre-auth preferably. Turning pre-auth on whilst in test mode works though.

  10. Upon testing the GoogleSiteMaps, everything seems to be working fine; the xml pages are all created fine etc.

     

    So, the Cron job was set up and this is what we get:

     

    PHP Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/findwatc/public_html/googlesitemap/index.php on line 46

     

    Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/findwatc/public_html/googlesitemap/index.php on line 46 PHP Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/findwatc/public_html/googlesitemap/index.php on line 46

     

    Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/findwatc/public_html/googlesitemap/index.php on line 46

     

    Obviously the page was found OK and it works fine when we test it, not changes have been made to the code in googlesitemap/index.php.

     

    Can anyone offer any light on this?

×
×
  • Create New...