Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

jorgeo

Pioneers
  • Posts

    35
  • Joined

  • Last visited

Posts posted by jorgeo

  1. This is the main support thread for the add-on "phpBB3 / osCommerce Bridge"

     

    This mod acts as a bridge between phpBB3 (notice this is version 3 of phpBB, not 2) and osCommerce. Alllows for a common login to both systems using email/password combination. It synchronizes user account changes (email, password) from both user and admin perspective. Main signup is through store, and users are allowed to pick a username for the phpBB forums after account creation.

     

    Update Log:

     

    v1.0 - Initial release (2013/05/20)

  2. For those of you getting

    Credit card error: The first four digits of the number entered are <br>If that number is correct, we do not accept that type of credit card.<br>If it is wrong, please try again

    after trying to submit your your credit card in the checkout_shipping.php page (either by using the credit card module, authorize.net or authorize.net AIM), I believe the "error" (I'm not sure if it is one) is found in checkout_shipping.php at around line 124:

     

    while (list($key, $value) = each($_POST))
    {
    tep_session_register($key);
    }

     

    Some people mentioned to use $HTTP_POST_VARS instead of $_POST. I found out there was no difference (in my version of php), but I changed that anyway. I changed the code to:

     

    while (list($key, $value) = each($HTTP_POST_VARS))
    {
    tep_session_register($key);
    $_SESSION[$key] = $HTTP_POST_VARS[$key];
    }

     

    So now, after assigning the name of the POST variables (key) into the SESSION, we are also forcing the value of such key to be updated in the SESSION. I would assume tep_session_register() would do that, but it seems it doesn't.

     

    The rationale:

     

    I'm unsure if this fix is comprehensive, so I'm posting no fix patch on the contribution page. For those of you interested on why this happens, this is my take:

    1. checkout_shipping.php submits the credit card information to itself through POST
    2. If shipping info is ok, we will reload this page into checkout_confirmation.php?paynow= , so we need to store POST variables into SESSION ones to preserve them
    3. The fix above makes sure the variables are not only defined in the SESSION, but their values too
    4. Now we are in checkout_confirmation.php. We were supposed to get here by submitting a form, so we take the SESSION variables and put them back into POST variables (around line 18)
    5. Next thing is to delete the session variables that contain sensitive data, like "authorizenet_cc_number"
    6. So by now, everything should work fine. The submitted credit card data was swapped in and out of session variables, and the payment modules should work.

    I think that did it for me (I was messing with code for many many hours), and now I can use the authorize.net (not AIM) module with no problem. If it works for you, let others know.

     

    ~Jorge

  3. Make sure you've declared TABLE_FAVORIS, TABLE_FAVORIS_ATTRIBUTES and TABLE_WISHLIST, TABLE_WISHLIST_ATTRIBUTES to be two different tables (in includes/database_tables.php). Example:

     

    // Wishlist

    define('TABLE_WISHLIST', 'customers_wishlist');

    // Wish List w/Attributes

    define('TABLE_WISHLIST_ATTRIBUTES', 'customers_wishlist_attributes');

    // Favorites

    define('TABLE_FAVORIS', 'customers_favorite');

    // Favorites w/Attributes

    define('TABLE_FAVORIS_ATTRIBUTES', 'customers_favorite_attributes');

     

    To actually create the tables in OsCommerce, modify the sql file replacing the names of the database table to customers_favorite and customers_favorite_attributes. Good luck!

     

    ~Jorge

     

    Hi everybody!

     

    Need some help with this contribution! I have installed it twice as I use it as a wishlist and as a favourite list.

     

    The problem is that when I put an item to my wishlist  it is registered to the the wishlist AND to the favourite list! :'(

     

    It works the same way when I add a product to my favourite list it is registered both to the favourite list & the wishlist.

     

    Here's the piece of code from my application top.

    ... and also the piece of code I use in my product_info, hope someone would be able to bring me some help. Thanks in advance :

     

    product info

    I really don't find out what's wrong ! :blink:

  4. Instead of replacing the code you mentioned above could I replace this bit alone and get the same result?

     

     

    Nope. Instead, you want to delete this line:

     

    tep_db_query("delete from " . TABLE_WISHLIST . " where customers_id= '" . $customer_id . "' and products_quantity = '999'");

     

    about 7 lines after the "case 'wishlist_add_cart'" line.

     

    ~Jorge

  5. jorgeo thx for that, I understand this, but what I need is to allow checkout, but still keep the wishlist active for next visit like a repeat order solution, any thoughts, thx in advance. :thumbsup:

     

    in /catalog/includes/application_top.php:

    find:

          case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                                     if ($HTTP_POST_VARS['products_id']) {
                                     if ($customer_id > 0) {
                                       tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                                       tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                                       // Read array of options and values for attributes in id[]

     

    Replace with

     

          case 'wishlist_add_cart' :if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                                     if ($HTTP_POST_VARS['products_id']) {
                                     if ($customer_id > 0) {
                                       // Read array of options and values for attributes in id[]

     

    That will keep the items in your wishlist even if they move them to the shopping cart

  6. Hi everyone, first post in here been using the l8test wishlist gret contrib, great work thx, but one little question could I have the wishlist available even after checkout, ie not reset itself

    Hi j0ker,

     

    The wishlist currently does that. It will remain available until the items are specifically removed from the wishlist (or moved to the shopping cart)

    ~Jorge

  7. Can anyone tell me which of the wish list contributions i need to download and install to get them the app to work?  seems lots are updates, but trying to figure out where to start and what to skip is a real pita . . .

     

    Hi Mibble,

     

    I would install the "4 May 2004 - Wishlist including checkbox's" wishlist contribution. in the Wishlist Contribution page After that, you can add the updates as you see fit.

  8. The error I'm receiving is when I use the Buy Now button on the products list page. Anyone have any ideas where to look. I can not find any files related to the contribution that go anywhere near a line 1064.

     

    There error is refering to the entry in application_top.php

                                      tep_db_query("delete from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id AND products_id=$products_id");

     

    HELP? please.

     

     

    Yeah, I missed that, sorry. Change your catalog/includes/application_top.php:

     

    FROM:

          case 'cust_order' :     if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
                                   // begin mod for Wishlist v2.2
                                   tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
                                   // Begin Wish List Code w/Attributes
                                   tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id=$products_id");
                                   // End Wish List Code w/Attributes
                                   // end mod for Wishlist 2.2

     

    TO:

          case 'cust_order' :     if (tep_session_is_registered('customer_id') && isset($HTTP_GET_VARS['pid'])) {
                                   // begin mod for Wishlist v2.2
                                   tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_GET_VARS['pid'] . "' and customers_id = '" . $customer_id . "'");
                                   // Begin Wish List Code w/Attributes
                                   tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " WHERE customers_id=$customer_id AND products_id='" . $HTTP_GET_VARS['pid']."'");
                                   // End Wish List Code w/Attributes
                                   // end mod for Wishlist 2.2

  9. Ok, I found out that my previous post was very vague and hence why people might be having trouble. What I really meant was:

     

    Turn this:

    // Now we have an array of options and values for attributes in id[]
    foreach($id as $att_option=>$att_value) {
     // Add to customers_wishlist_attributes table
     tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )");
    }

     

    into this:

     

    // Now we have an array of options and values for attributes in id[]
    if (isset ($id)) {
     foreach($id as $att_option=>$att_value) {
       // Add to customers_wishlist_attributes table
       tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )");
     }
    }

  10. The files you sent over were just the ticket, there were just a couple of very small differences between what I had, and what you had. Once I did the comparisons and changes, and uploaded everything started working!

     

    Hi Doug,

    I'm wondering if you could post the differences you found in the forum. Hopefully someone else can benefit from them! :thumbsup:

  11. Hmmm.... I don't find a way to attach files to a message, or else I would send my current versions of the files I changed for you guys to look at (I can't figure out what went wrong with your installations, I guess something minor.... and really annnoying! :P )

     

    I'd post them on the contribution page, but my files have some extra modifications that I don't have time for removing.

     

    Ravenwulf, BearHappy: If you want a copy, send me a PM through the board with your email addy, and I'll send them to you. Then you can contrast and compare for possible errors.

  12. Just in case:

    This is how the relevant part of my application_top looks like for the corrections on the

    Warning: Invalid argument supplied for foreach() in /home/audiocav/public_html/store/includes/application_top.php on line 550

    issue:

     

          case 'add_wishlist' :  if (ereg('^[0-9]+$', $HTTP_POST_VARS['products_id'])) {
                                   if ($HTTP_POST_VARS['products_id']) {
                                     if ($customer_id > 0) {
                                       tep_db_query("delete from " . TABLE_WISHLIST . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                                       tep_db_query("insert into " . TABLE_WISHLIST . " (customers_id, products_id, products_model, products_name, products_price) values ('" . $customer_id . "', '" . $products_id . "', '" . $products_model . "', '" . $products_name . "', '" . $products_price . "' )");
                                       tep_db_query("delete from " . TABLE_WISHLIST_ATTRIBUTES . " where products_id = '" . $HTTP_POST_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
                                       // Now we have an array of options and values for attributes in id[]
                                       if (isset ($id)) {
                                         foreach($id as $att_option=>$att_value) {
                                           // Add to customers_wishlist_attributes table
                                           tep_db_query("insert into " . TABLE_WISHLIST_ATTRIBUTES . " (customers_id, products_id, products_options_id , products_options_value_id) values ('" . $customer_id . "', '" . $products_id . "', '" . $att_option . "', '" . $att_value . "' )");
                                         }
                                       }
                                     }
                                   }
                                 }
                                 break;
  13. Ok very strange now,

     

    I just noticed that on the web store, the option is not going over to the wishlist.  I see the product picture, and price (not adjusted with option).

     

    any ideas?

     

    Try the following:

     

    On includes/application.top, add immediately after the first line so that it looks like code below:

    <?php
    // Used to look for form or url variable information
    echo '<pre>
    HTTP_POST_VARS';
    print_r ($HTTP_POST_VARS);
    echo '</pre><pre>
    HTTP_GET_VARS';
    print_r ($HTTP_GET_VARS);
    echo '</pre>';
    // Delete after testing

     

    And then try to press the "Add to wishlist" button in any product_info.php page. If everything went well, you should see something like this on the top of the page (you might get warnings or errors after this, but you should still be able to see it):

     

    HTTP_POST_VARSArray
    (
       [id] => Array
           (
               [3] => 6
               [5] => 13
           )
    
       [wishlist_action] => add_wishlist
       [x] => 47
       [y] => 3
       [products_id] => 31
    )
    
    HTTP_GET_VARSArray
    (
    )

     

    Notice that 'id' is an array with the following attribute option values. I use these as an example:

    [Option 3: Model] => [Value 6: Premium]

    [Option 5: Version] => [Value 13: Box: Windows - English]

     

    To recognize what the numbers mean to your product, go to the Admin panel>Catalog>Product Attributes. They are listed there next to the number.

     

    The 'wishlist_action' variable is the one that gets passed with the form after clicking on the button and should be add_wishlist if the button in product_info was hit.

     

    Products_id is pretty obvious.

     

    If you don't get these, your button is not submitting the form. The button is either:

     

    1- Not a submit button (noticed that I changed it from a link into a submit button in the product_info.php pages) You probably get 'action' => add_wishlist in the HTTP_GET_VARS Array if this is the case

    2- Not inside the form, (and hence the values for $id[] are not passed). Note: for products without attributes, there shouldn't be an [id] variable

     

    Let me know how this goes and I'll try to answer. Don't forget to erase those lines after you're done.

  14. Jorge,

     

      Here's something I've found, you can't add two products that are the same but with different attributes. Such as, one candle with a strawberry scent and another with a cinnamon scent. The latter overrides the first in the wishlist, even though they are two seperate products. Any ideas?

     

    Yeah, I was aware of that. Supporting this feature might be pretty difficult, hopefully someone else will be able to help to the contribution by fixing this

  15. Hmmm, I'm not sure what the issue with the login is. My guesses:

     

    1- The wishlist button is not located inside the product form: With the previous version, you could put the button anywhere. With this version, is has to be located inside the form

     

    2- It might be that your sessions are being stored in cookies, I use a database to store them. This option is located in catalog/includes.configure.php:

      define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'

    osCommerce should still be able to handle them transparently, but maybe not

     

    3- Also, I'm using the secure autologin contribution:

    http://www.oscommerce.com/community/contributions,2087

    This might be another issue.

  16. Hi, great contrib, but with the last addon I've 1 problem, if I try to add the product to the wishlist with this code in product info

     

    I've an error on the document.cart_quantity

     

    Tnx, jo.

     

    The document.cart_quantity line is a javascript trick to make *one* form submit to either one of *two* different pages (one sends info to the shopping cart, the other one sends info to the wish list)., according to the submit button pressed.

     

    By default, the name of the form with all the product info is "cart_quantity". change document.cart_quantity to document.[your_form_name_here]. I believe this might be "buy_now_"

     

    Note to developers:

    It'll probably be better to have a whole different form for the 'Add to Wishlist button'. I used the already existing form and added a button that redirected to FILENAME_WISHLIST

  17. Lines 449-450 in application_top.php are:

     // Now we have an array of options and values for attributes in id[]
                                       foreach($id as $att_option=>$att_value) {

     

    Ah, I must have overlooked that case in which the product has no attributes. I have warnings turned off through STS, so no wonder I missed it. My gut feeling tells me that you should put an if statement around it like this

     // Now we have an array of options and values for attributes in id[]
                                      if (isset ($id)) {
                                        foreach($id as $att_option=>$att_value) {
                                             // stuff here
                                        } 
                                      }

     

    Also, I'll leave the wishlist email unmodified for now. If someone would like to print what the product attributes where in the email, it'll probably look really similar to the code found in catalog/wishlist.php

  18. ERROR MESSAGE:

    Parse error: parse error, unexpected T_STRING in /home/username/public_html/store/includes/boxes/wishlist.php on line 46

    // Begin Wish List Code w/Attributes
    '<tr><td>'
    tep_draw_form('product_' . $products['products_id'], tep_href_link(FILENAME_WISHLIST)) . tep_draw_hidden_field('products_id', $products['products_id']) . tep_draw_hidden_field('wishlist_action', 'wishlist_add_cart');

     

    My guess is that you forgot the add '.' to concatenate the string after '<tr><td>', so change the above code to:

     

    // Begin Wish List Code w/Attributes
    '<tr><td>'.
    tep_draw_form('product_' . $products['products_id'], tep_href_link(FILENAME_WISHLIST)) . tep_draw_hidden_field('products_id', $products['products_id']) . tep_draw_hidden_field('wishlist_action', 'wishlist_add_cart');

  19. Anyone  :(

     

    In catalog/product_info.php

     

    Change:

                    <!-- begin mod for Wishlist v2.2 -->
                   <td align="left" class="main"><?php if (tep_session_is_registered('customer_id')) echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; ?></td>
                   <!-- end mod for Wishlist v2.2 -->

     

    to:

     

                    <!-- begin mod for Wishlist v2.2 -->
                   <td align="left" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_WISHLIST, tep_get_all_get_params(array('action')) . 'action=add_wishlist') . '">' . tep_image_button('button_wishlist.gif', IMAGE_BUTTON_ADD_WISHLIST) . '</a>'; ?></td>
                   <!-- end mod for Wishlist v2.2 -->

  20. Ok guys, I have the first alpha version of Wish List with Attributes running.

     

    Done so far:

    - Move product with attributes to wish list from the products page

    - Move product with attributes from wish list infobox to Shopping Cart

     

    Still to do:

    - List product attributes in My Wish List page

    - Move multiple products from My Wish List page into cart

    - Delete multiple products from My Wish List page

    - Document all changes in a human-readable way (as opposed to scribbles in a stained piece of paper)

    - Step by step instructions on adding changes AND/OR

    - Step by step instructions to install from scratch

     

    Might not do:

    - Support multiple instantiations of same product with different attributes inside wish list (currently only 1 product type, overrides previous attributes)

    - Include attributes in email (I'm not using the "make your friend's wishlist your own wishlist" for the store I'm working on though)

     

     

    Some oddities:

    -"Buy now" and "Order History - In cart" buttons for products with attributes still takes you to the product page for you to select them.

     

     

    Oh, and I did pretty well on my exam :thumbsup: Thanks for the support.

×
×
  • Create New...