Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,877
    Plugin Contributions
    96

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by get2go View Post
    Thank you for your suggestions.
    Qty1 and Qty2 are in DB and IMS update data in these fields from each location. That's done.

    GPSF will take data from these DB columns for qty1 and qty 2 for each location. That's done.

    I have qty1 and qty 2 fields on edit product page and it's inserting/updating values fine. That's done.

    What I am trying to achieve now is :

    When customer complete checkout it should substract from qty1 field by default unless it is 0 than from qty 2 but for available stock check it should take qty1 + qty 2 = total quantity instead of just qty1 field. I am thinking to mark zc default qty as qty1 to simplify as zc by default subtract from it. So just need to add/update code to include qty from qty2 field and apply check to subtract qty from qty 2 when qty1 is <1.

    So I think somewhere on front end where Available quantity check is that's what need to be customized to achieve. Site is using One page checkout. Any idea which files/code need to be customize in there.
    One-Page Checkout has no bearing in the creation/recording of the order; that's all performed in the checkout_process page.

  2. #12
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,740
    Plugin Contributions
    22

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by get2go View Post
    When customer complete checkout it should substract from qty1 field by default unless it is 0 than from qty 2 but for available stock check it should take qty1 + qty 2 = total quantity instead of just qty1 field. I am thinking to mark zc default qty as qty1 to simplify as zc by default subtract from it. So just need to add/update code to include qty from qty2 field and apply check to subtract qty from qty 2 when qty1 is <1.

    So I think somewhere on front end where Available quantity check is that's what need to be customized to achieve. Site is using One page checkout. Any idea which files/code need to be customize in there.
    Yes, and this is exactly the interesting part where you get some fun.
    As lat9 mentioned, it has nothing to do with OPC. Qty check and subtraction happens during checkout_process (includes/modules/checkout_process.php), or includes/classes/order.php to be exact. I'd use the notifier mentioned earlier, but you might prefer the ones found in create_add_products() function. Or just modify that function if you're happy with modifying core file, although the observer approach helps during upgrades and maintenance.
    Your observer (or hack) could then update qty1 and qt2 based on your custom logic (you'll need to come up with that, sorry), and Zen Cart will process the main quantity anyway. If you're not updating qty1 and qty2 from anywhere else, products_quantity will always match qty1+qty2.

  3. #13
    Join Date
    Jul 2021
    Posts
    12
    Plugin Contributions
    0

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by balihr View Post
    Yes, and this is exactly the interesting part where you get some fun.
    As lat9 mentioned, it has nothing to do with OPC. Qty check and subtraction happens during checkout_process (includes/modules/checkout_process.php), or includes/classes/order.php to be exact. I'd use the notifier mentioned earlier, but you might prefer the ones found in create_add_products() function. Or just modify that function if you're happy with modifying core file, although the observer approach helps during upgrades and maintenance.
    Your observer (or hack) could then update qty1 and qt2 based on your custom logic (you'll need to come up with that, sorry), and Zen Cart will process the main quantity anyway. If you're not updating qty1 and qty2 from anywhere else, products_quantity will always match qty1+qty2.
    Balihr,
    Thank you for detailed directions.
    I came up with another approach and I think it will work better instead of customizing core files. I am going to give it a try in next few days and will post update.
    I am thinking to use SBA and customize it as it will allow manage qty for both locations and it is also part of GPSF so data will be included in it auto.

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Shipping Based on Warehouse Location
    By Cmartin571 in forum Addon Shipping Modules
    Replies: 3
    Last Post: 25 May 2015, 04:29 PM
  2. v151 Adding + and - quantity buttons to product quantity fields
    By izzysoup in forum General Questions
    Replies: 5
    Last Post: 28 Aug 2014, 09:11 AM
  3. quantity discount for checked attributes NOT product quantity
    By adod in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 6 Mar 2009, 06:39 PM

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