Thread: Quick Order

Page 1 of 6 123 ... LastLast
Results 1 to 10 of 54
  1. #1
    Join Date
    Jan 2005
    Posts
    1,649
    Plugin Contributions
    2

    Default Quick Order

    This module will let your customers add multiple products to cart at once by inserting the products' model numbers and quantities for the order into a simple form.
    You will also be able to add any amount of products to cart by entering an URL, see readme for more details.

    This mod assumes that product models are unique.
    The mod does not work with attributes since products with attributes do not currently have a unique ID for each attribute variation in Zen-Cart.

    Get the latest version from the Zen-Cart downloads area

  2. #2
    Join Date
    Jan 2005
    Posts
    1,649
    Plugin Contributions
    2

    Default New release of Quick Order

    Version 1.2.3 is now available for download.
    Get the latest version of Quick Order.

    Changelog:
    1.2.3 (2007.04.16) - Modified by Eivind E. Valderhaug

    - Properly display path in breadcrumbs (Home :: Order Online).

    - Set optional limit and order-by clause in config file (qo_settings.php) for similar matches results when product models are not found.
    Previously if a product model was not found, all products that had similar product models would be displayed.
    This can now (easily from the config file) be limited to a number and the result can be ordered by one or more columns in the products or products_description tables.
    - Use common html header instead of custom header.
    The downside is that the custom css file won't get included unless it's copied to the current template css directory.

  3. #3
    Join Date
    Jan 2005
    Posts
    1,649
    Plugin Contributions
    2

    Default Re: Quick Order

    Just a notice for those also using the SEFU mod by Tim Kroeger: See this post for how to get these 2 mods to work together properly.
    I haven't verified this because I don't use the SEFU mod.

  4. #4
    Join Date
    Jan 2007
    Posts
    35
    Plugin Contributions
    0

    Idea or Suggestion Re: Quick Order

    Quote Originally Posted by dwno View Post
    The mod does not work with attributes since products with attributes do not currently have a unique ID for each attribute variation in Zen-Cart.

    :
    Guess what, I am trying to solve this problem and in the process have discovered something in functions_general.php:

    function zen_get_uprid($prid, $params) creates that unique "productid & attribute mix identifier" that is inserted into the cart.

    function zen_get_prid($uprid) is used to extract the product ID from this identifier, but can be adapted to take it apart if necessary.

    This could be a perfect way to define a unique product/attribute mix to be put into cart with the "single click URL" feature of Quick Order.

    You can see the actual use in actionAddProduct in includes/classes/shopping_cart.php

    I know, I know, you are thinking "if you are such a smartass to have done all this research, why don't you make it happen?"

    Well, because I have never written more than 6 lines of PHP code, and this one would effectively require one to create an admin version of the cart - with the "product+attribute mix ID" field...
    I just hope someone ;-) will find this useful and just GOES FOR IT


  5. #5
    Join Date
    Jan 2005
    Posts
    1,649
    Plugin Contributions
    2

    Default Re: Quick Order

    I'm afraid it's not that easy. Besides, even if it was you'd have to enter things like "59:3b270c58dc0fb4406c0036abeb0b41d4" into the input fields to specify the product "model" for a given attribute variation, and I don't think most customers would be comfortable with that. ;)

    Why it's not so easy? Because the function you mention uses md5 encryption (can't be decrypted) on the attribute data to make it unique and so you would need a md5-hash-to-attribute-variation mapping that maps all possible attribute variations to their respective md5 hashes. That's a bad idea though for several obvious reasons. There are better ways of doing it, but it involves too much work for me to do for free anyway and I have no idea how much time it would take. I guess SKU-support would deal with this issue.

    Btw, the only thing zen_get_prid() is removing the attribute md5 hash to return the product ID of the base product (without attributes).

  6. #6
    Join Date
    Jan 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: Quick Order

    Quote Originally Posted by dwno View Post
    I'm afraid it's not that easy. Besides, even if it was you'd have to enter things like "59:3b270c58dc0fb4406c0036abeb0b41d4" into the input fields to specify the product "model" for a given attribute variation, and I don't think most customers would be comfortable with that. ;)

    Why it's not so easy? Because the function you mention uses md5 encryption (can't be decrypted) on the attribute data to make it unique and so you would need a md5-hash-to-attribute-variation mapping that maps all possible attribute variations to their respective md5 hashes. That's a bad idea though for several obvious reasons. There are better ways of doing it, but it involves too much work for me to do for free anyway and I have no idea how much time it would take. I guess SKU-support would deal with this issue.

    Btw, the only thing zen_get_prid() is removing the attribute md5 hash to return the product ID of the base product (without attributes).
    Got it. I missed the MD5 angle. Damn! - it was such a beautiful dream...

    Granted, I use Quick Order not in the way you intended - I never display the form, just generate the URLs that are later embedded into my Wordpress pages, sort of "1-click Add-to-Cart".

    Oh well, some day, when I am better at PHP...

    BTW, you still get my eternal gratitude for Quick Order as it is

  7. #7
    Join Date
    Mar 2006
    Location
    Melbourne, Australia
    Posts
    377
    Plugin Contributions
    0

    Default integrate into product/order page

    Is there some way that the quick order function can be built in to a product page, or into the product order process? Rather than go down the track of setting up attributes - which would get far too messy given the options I have, I would like to have the option to select other products (accessories). If I could get the quick_order thing to function as an adjunct to a product order, that would do it for me.

  8. #8
    Join Date
    Jan 2007
    Posts
    35
    Plugin Contributions
    0

    Idea or Suggestion Re: Quick Order

    DWNO,

    here is a small improvement (or so I hope) - please review and incorporate into your code (or kill it if it is horribly wrong).

    The following code extends Quick Order to handle ONE (1) REQUIRED attribute.

    So, if you are adding a product via Quick Order and it has REQUIRED attributes, the product will be added into the cart together with one of them (first in the database). Optional attributes are ignored.

    Why only one? - I actually do not know. The SQL query should return all of the required attributes, but it does not. I have run the query in phpMyAdmin, and it works just fine. So, after two hours of banging my head against the wall, I am posting my code here in hope that someone way more qualified takes it and makes it work for multiple required attributes.

    So, the only changes are in the includes/modules/pages/quick_order/header_php.php file around line 185 or so. I am posting a bit of code around mine as well, so that you can see where it belongs. All my comments and variables have "aa" prefix.

    PHP Code:
                            //only add if does not exceed maximum
                            
    if (($add_max == and $cart_qty == 1)) {
                                
    // do not add
                            
    } else {

    // AA get product attributes
          
    $aa_attributes_db $db->Execute("select options_id, options_values_id from " TABLE_PRODUCTS_ATTRIBUTES "
                                 where  products_id = '" 
    $qo_item_info['pid'][$i] . "' and attributes_default='1'");

          
    $aa_attributes = array($aa_attributes_db->fields["options_id"] => $aa_attributes_db->fields["options_values_id"]);

                                
    // check for min/max and add that value or 1

    // AA: Original code was:     $_SESSION['cart']->add_cart($qo_item_info['pid'][$i], $cart_qty+$new_qty);
                                
    $_SESSION['cart']->add_cart($qo_item_info['pid'][$i], $cart_qty+$new_qty$aa_attributes);  // <-AA put new total of the product into cart by ID
                            
    }


                        }
    //end if (isset...
                    
    //end for $i < $total_models

                    
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CARTzen_get_all_get_params($parameters)));

                } 
    //end if $error === false 
    As you can see, it's just three extra lines. I am also attaching the full modified file.

    What do you think?
    Attached Files Attached Files

  9. #9
    Join Date
    Jan 2007
    Posts
    35
    Plugin Contributions
    0

    Default Re: Quick Order

    Oh, and if anyone wonders why even a single required attribute is important... imagine that the product is a downloadable document! (that's why I needed it)

    A>

  10. #10
    Join Date
    May 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: Quick Order

    Thank you for this wonderful mod. This is virtually what I was looking to do.

    Question: I would like for customers to be able to type in either model numbers OR product names in the input fields. In this particular case, all model numbers and product names will be unique. I've tried modifying the header_php.php file at line 123 without success as I have limited php/sql experience. Could someone possibly offer some suggestions in achieving this?

    Here is line 123 of header_php.php:
    PHP Code:
    $next_product_id mysql_query(sprintf('select p.products_id, p.products_model from %s AS p where (p.products_model = \'' implode("' OR p.products_model = '"$qo_item_info['model']) . "')"$db->prepare_input(TABLE_PRODUCTS)), $db->link); 

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. v154 Quick Order - How to change sort order?
    By anduril3019 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Jun 2015, 09:09 PM
  2. v138a Quick Re-order aka order_history.php history beyond last order
    By beyerg in forum Customization from the Admin
    Replies: 1
    Last Post: 24 Jan 2012, 11:14 PM
  3. Quick Order
    By medgollc in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 27 Dec 2010, 06:20 PM
  4. Quick Re-order
    By LoriW. in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 30 Sep 2007, 07:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR