Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2012
    Posts
    42
    Plugin Contributions
    0

    Default Adding a Quotation Option

    Hi Everyone

    I have been running my shop (experilab.co.za) successfully on 1.3.9 for many years now. I am in the process of upgrading to 1.5.5.

    A huge need for me (and for some others it seems, if you read the forums) is to allow customers to obtain a (printable)quotation from the online shop. Up to now I have directed customers to add an order with the comments "Quotation Only' so that we know it is not an order. The problem is that the stock gets subtracted and is then unavailable for other customers. Sometimes the 'Quotation' does not result in an order, which means that the items are only restocked upon deletion.

    My current idea around this problem is to add a new payment method called 'Quotation'. (I should be OK to do this maybe using the cod option). Then, upon checkout confirmation 'subtract stock = true' should be set temporarily to false only when the Quotation payment method was selected.

    My problem is that I cannot find the code where this would supposedly happen. Can anyone help?

    Also, any comments from Zen-gurus about the viability of the idea would be much appreciated!

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Adding a Quotation Option

    On Zen Cart 1.5.5e, that will be pretty easy and you'll be able to use a built-in Zen Cart notifier to keep your changes separate.

    Look in that version's /includes/classes/order.php's create_add_products function. In there, towards the top, you'll see the line
    Code:
          $this->notify('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_INIT', array('i'=>$i), $this->products[$i], $i);
    You can create an observer-class script that watches for that notification and, if the current method is the "quotation", sets the associated class' doStockDecrement variable to false (causing the stock decrementation to be bypassed).

  3. #3
    Join Date
    Sep 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding a Quotation Option

    *Gulp* Ok, what you say seems to be a mouthful, especially to an amateur like me. But I will get some assistance from someone in the family with php knowledge and we should be able to work something out.

    I will post here again if the solution works, should anyone else be interested...

    Thanks for the help!

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: Adding a Quotation Option

    Here's something to work with. This will not work on your 1.3.9 shop, but will on your 1.5.5 upgrade.

    Create a file in your store's /includes/classes/observers directory named auto.quotation.php, containing:
    Code:
    <?php
    class zcObserverQuotation extends base 
    {
        public function __construct() 
        {
            $this->attach($this, array('NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_INIT'));
        }
    
        public function update(&$class, $eventID) 
        {
            switch ($eventID) {
                case 'NOTIFY_ORDER_PROCESSING_STOCK_DECREMENT_INIT':
                    $order = $class;
                    if ($order->info['payment_module_code'] == 'quotation') {
                        $order->doStockDecrement = false;
                    }
                    break;
    
                default:
                    break;
            }
        }
    }
    That code "attaches" to the notification that the order is preparing to perform the stock-related decrement. When that notification is "raised", the update function receives control and checks the current order (based on the $class input) to see if the currently-selected payment-method is quotation and, if so, sets the order-class variable to indicate that stock-decrementation should not be performed.

    Please note that the code assumes that you've named your payment method quotation for its processing! If you use a different name/payment-module-code, then you'll need to change the highlighted compare string.

  5. #5
    Join Date
    Sep 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding a Quotation Option

    Thanks a million lat9! Your code works 100%! We are now changing a few instances where the wording 'Invoice' appears to rather show 'Quotation' (i.e. when payment method is 'quotation') and some other small tweaks. I cannot wait to go live with this.

    Much appreciated!

  6. #6
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Adding a Quotation Option

    Another option that have seen implemented is to have a request a quote button on the product page that uses a modified version of the plugin ask a question.

    The modifications primarily being the wording, though morecan bedone tomake the uri more "symbolic".

    A difference between the two is that ask a question doesn't generate (nor require) an account to be created or to go through the "checkout" process. For some a plus, for others not.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #7
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,107
    Plugin Contributions
    11

    Default Re: Adding a Quotation Option

    I remember the Viet Nam days and the "What the Captain said, was..." situations.

    What MC#s is saying is that there is a mod that might work. Both the mod and lat9's suggestion will need tweaking. lat9's works primarily if the customer is logged in while the mod does not care.

    You get to make the decision but, it appears to only be who you want it to apply to -- logged in or everyone regardless of logged-in status.

    Personally, I would want the customer to be logged in so that I would possess better contact information.

  8. #8
    Join Date
    Sep 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: Adding a Quotation Option

    Thanks for the suggestions, guys! In my case we have many customers who are representing schools or government companies. They usually need to obtain 3 written quotations before ordering. (Information such as VAT nos, company names etc are required). The only option would then be for the customer to be logged in. We will then also receive a copy of the quotation for our records.

    We have completed lat9's suggestions and are busy with some rigorous testing. It seems to be working really good! In future I will look into a method to convert the Quotation into an order should the customer wish to do so (basically by checking stock and subtracting it and changing the wording back to 'Invoice'), but for now this mod will really makes things a lot easier for us!

 

 

Similar Threads

  1. Adding a newly created Option Name/Value to every option menu
    By tcarden in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 31 Jan 2014, 05:55 AM
  2. Adding all Option Values within an Option to a product
    By ktomas in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 6 Jul 2009, 03:30 AM
  3. Adding copied option names and option valuesto product pricing
    By Derek Bryant in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 29 Apr 2009, 06:31 PM
  4. Option values error when using quotation marks
    By sparklefish in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 5 Mar 2007, 04:00 PM
  5. Replies: 1
    Last Post: 18 Feb 2007, 02:30 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