Results 1 to 10 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2021
    Posts
    12
    Plugin Contributions
    0

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by mc12345678 View Post
    Do you mind explaining why this process is needed for the business? It may help determine a way forward.

    I've seen a plug-in that helped with drop shipping, but required a little bit of human intervention to balance things out. It seemed to work on a similar concept of offering a method and later a way to adhere the request to something in reality.
    Have multiple locations for physical stores and would like to share quantity from each store with site so qty field get total qty available to ship.

    qty1 and qty2 are being used to show availability of actual qty on each store, plus using these fields to send data to Google for local pick up/physical stores.

    In future plan on using qty 1 and qty 2 fields to show delivery date per customer location to offer faster delivery options.

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

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by get2go View Post
    Have multiple locations for physical stores and would like to share quantity from each store with site so qty field get total qty available to ship.

    qty1 and qty2 are being used to show availability of actual qty on each store, plus using these fields to send data to Google for local pick up/physical stores.

    In future plan on using qty 1 and qty 2 fields to show delivery date per customer location to offer faster delivery options.
    IMO, you'll need to get your hands dirty and get the coding done. A simple approach would be to add 2 more fields (let's say qty1 and qty2) in the database and add logic to update products_quantity based on the values in those fields. Javascript can do it in admin product page.
    As for frontend, you'd need a new function that would be called during checkout_process - you could for example use NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL notifier to get this part done. This would be a bit more fun because you need to run through all products and be careful not to go into negative values (for example, qty1 is 2, qty2 is 5, ordered 4).
    Using these fields for Google will require your GPSF module to be modified, just like you'll need custom code for delivery dates per location.

    Don't forget to handle cases in admin when order is cancelled or deleted and you need to restock.

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

    Default Re: Product Quantity by Location/Warehouse

    Quote Originally Posted by balihr View Post
    IMO, you'll need to get your hands dirty and get the coding done. A simple approach would be to add 2 more fields (let's say qty1 and qty2) in the database and add logic to update products_quantity based on the values in those fields. Javascript can do it in admin product page.
    As for frontend, you'd need a new function that would be called during checkout_process - you could for example use NOTIFY_CHECKOUT_PROCESS_AFTER_SEND_ORDER_EMAIL notifier to get this part done. This would be a bit more fun because you need to run through all products and be careful not to go into negative values (for example, qty1 is 2, qty2 is 5, ordered 4).
    Using these fields for Google will require your GPSF module to be modified, just like you'll need custom code for delivery dates per location.

    Don't forget to handle cases in admin when order is cancelled or deleted and you need to restock.
    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.

  4. #4
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,973
    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.

  5. #5
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,751
    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.

  6. #6
    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.

 

 

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