Results 1 to 10 of 447

Hybrid View

  1. #1
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    618
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by lat9 View Post
    That functionality, in more current versions of USPS, is available via a site-specific observer's processing. See https://github.com/lat9/usps/blob/K1..._overrides.php for an example
    Yes, I know that, but I have never been able to make it work. The only way I've been able to manage the appropriate size shipping service for our products is to stay with the existing working code. I just need to know what variable to look at to see what Zencart thinks the product ID is here.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by HeleneWallis View Post
    Yes, I know that, but I have never been able to make it work. The only way I've been able to manage the appropriate size shipping service for our products is to stay with the existing working code. I just need to know what variable to look at to see what Zencart thinks the product ID is here.
    You'd just follow the "pattern" in that extras file, using (most likely)
    Code:
    $_SESSION['cart']->in_cart_check('master_categories_id', {product-id to be checked});

  3. #3
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    618
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by lat9 View Post
    You'd just follow the "pattern" in that extras file, using (most likely)
    Code:
    $_SESSION['cart']->in_cart_check('master_categories_id', {product-id to be checked});
    That just returns a zero, since there is no master category with that number. I don't see how it could work, since I'm not looking at a master category of 171, but a product id of 171.

  4. #4
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by HeleneWallis View Post
    That just returns a zero, since there is no master category with that number. I don't see how it could work, since I'm not looking at a master category of 171, but a product id of 171.
    try:

    PHP Code:
    $_SESSION['cart']->in_cart_check('products_id', {product-id to be checked}); 
    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  5. #5
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    618
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by carlwhat View Post
    try:

    PHP Code:
    $_SESSION['cart']->in_cart_check('products_id', {product-id to be checked}); 
    best.
    That is giving me the quantity of that product number in the cart, which I also needed to know. But not the actual product number itself. But it does confirm that the software is seeing '171' as the product ID, because it returns the correct quantity. So I am still totally stumped as to why this is happening:

    Code:
      echo $_SESSION['cart']->get_quantity('171');  // RETURNS ZERO
      echo $_SESSION['cart']->in_cart_check('products_id', '171');   // RETURNS 1, WHICH IS CORRECT
    The first comparison works for every single other product id in our inventory, but not for the one with an id of 171. That's why I was trying to find out what the code was actually seeing there. The second statement confirms that it is seeing 171. I can use the second comparison as a workaround, but the first one ought to work.

  6. #6
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,915
    Plugin Contributions
    13

    Default Re: USPS Shipping Module [Support Thread]

    looking at the code is always a good idea. in this case, there is useful info in the documentation of the code.

    the following snippet is from:

    includes/classes/shopping_cart.php


    PHP Code:
    /**
         * Get the quantity of an item in the cart
         * NOTE: This accepts attribute hash as $products_id, such as: 12:a35de52391fcb3134
         * ... and treats 12 as unique from 12:a35de52391fcb3134
         * To lookup based only on prid (ie: 12 here) regardless of the attribute hash, use another method: in_cart_product_total_quantity()
         *
         * @param int|string $uprid product ID of item to check
         * @return int|float the quantity of the item
         */
        
    public function get_quantity($uprid
    i would use the method:

    in_cart_product_total_quantity()

    instead of

    get_quantity()

    and see if that provides the desired results.

    best.
    author of square Webpay.
    mxWorks now has Apple Pay and Google Pay. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  7. #7
    Join Date
    Jun 2016
    Location
    Suffolk VA
    Posts
    618
    Plugin Contributions
    0

    Default Re: USPS Shipping Module [Support Thread]

    Quote Originally Posted by carlwhat View Post
    looking at the code is always a good idea. in this case, there is useful info in the documentation of the code.

    the following snippet is from:

    includes/classes/shopping_cart.php


    PHP Code:
    /**
         * Get the quantity of an item in the cart
         * NOTE: This accepts attribute hash as $products_id, such as: 12:a35de52391fcb3134
         * ... and treats 12 as unique from 12:a35de52391fcb3134
         * To lookup based only on prid (ie: 12 here) regardless of the attribute hash, use another method: in_cart_product_total_quantity()
         *
         * @param int|string $uprid product ID of item to check
         * @return int|float the quantity of the item
         */
        
    public function get_quantity($uprid
    i would use the method:

    in_cart_product_total_quantity()

    instead of

    get_quantity()

    and see if that provides the desired results.

    best.
    Thank you, that is working.

    I know I have to get the newer code set up, but I simply do not have time to do it, and as long as this is working for now, it will have to do.

 

 

Similar Threads

  1. Optional Shipping Insurance Module [Support Thread]
    By jettrue in forum Addon Shipping Modules
    Replies: 415
    Last Post: 6 Jul 2026, 02:45 PM
  2. MultiSite Module Support Thread
    By Gerome in forum All Other Contributions/Addons
    Replies: 2246
    Last Post: 29 Dec 2025, 10:13 AM
  3. Replies: 29
    Last Post: 24 Sep 2014, 09:59 PM
  4. Replies: 335
    Last Post: 1 Aug 2013, 08:54 PM
  5. PC Configurator Module [Support Thread]
    By lebrand2006 in forum All Other Contributions/Addons
    Replies: 254
    Last Post: 22 Aug 2012, 03:52 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