Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Dynamically testing products in a cart for it's delivery type.

    Does anyone know if there is a way to dynamically test each item in a shopping cart to see if it's a virtual item or not?

    I'm currently using the cart's -> delivery_type method but the only problem I have with this is that when I test to see if a cart's contents is virtual or mixed, it works. But if I delete the item that is causing it register as virtual/mixed, the variable still returns that it's a mixed delivery type which is not the case.

    Can anyone help?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Dynamically testing products in a cart for it's delivery type.

    If it's reporting that it's mixed when you think they're really virtual, then that suggests that you've got your products configured incorrectly.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: Dynamically testing products in a cart for it's delivery type.

    Quote Originally Posted by DrByte View Post
    If it's reporting that it's mixed when you think they're really virtual, then that suggests that you've got your products configured incorrectly.
    That's what I originally thought but I checked and they're properly setup. I'll give an example:

    A cart contains two items:

    - One Virtual Delivery Item
    - One Non-Virtual Delivery Item

    Clearly this is a mixed cart. But if on the shopping cart page I delete either one, say I deleted the virtual delivery item:

    - One Non-Virtual Delivery Item

    The cart will still return that it's mixed delivery that is until I refresh the shopping cart page and then it updates to non-virtual.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Dynamically testing products in a cart for it's delivery type.

    What do you mean by "refresh the shopping cart page"?
    Deleting an item from the cart *does* cause a refresh of the page.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: Dynamically testing products in a cart for it's delivery type.

    It doesn't for me.

    I would update the cart using the delete button for the item. The page would reload, then I would still see that the cart contents are mixed and not physical like it should.

    I test it by looking at the $_SESSION['cart']->content_type variable. What I was asking for is there another way to test instead of testing this?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Dynamically testing products in a cart for it's delivery type.

    What addons do you have installed?
    What kinds of customizations have you made to the site?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: Dynamically testing products in a cart for it's delivery type.

    Quote Originally Posted by DrByte View Post
    What addons do you have installed?
    What kinds of customizations have you made to the site?
    None that would directly interfere with the shopping cart itself. Every mod I made was to the admin but none to the way cookies are handled.

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Dynamically testing products in a cart for it's delivery type.

    cookies?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  9. #9
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    934
    Plugin Contributions
    9

    Default Re: Dynamically testing products in a cart for it's delivery type.

    Quote Originally Posted by DrByte View Post
    cookies?
    I thought that the $_SESSION['cart'] was stored in a session cookie?

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Dynamically testing products in a cart for it's delivery type.

    No. $_SESSION['cart'] is a session variable, stored in the session.

    The only use of cookies in (uncustomized) Zen Cart is to store the session identifier so your browser can tell the server which session you're using.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Sample Products for Testing?
    By pamela631 in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 29 May 2013, 08:45 PM
  2. v150 Testing Product Book Type
    By charmedbytina2 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 16 May 2012, 05:53 AM
  3. Replies: 2
    Last Post: 13 Jan 2011, 08:36 PM
  4. Replies: 3
    Last Post: 15 Jun 2010, 01:30 AM
  5. Can I list UPS as the shipper but choose flat rates for each type of delivery method?
    By Doodlebuckets in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 25 Aug 2009, 05:48 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