Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006
    Posts
    23
    Plugin Contributions
    0

    Default class shoppingCart

    The class shoppingCart has an array "contents" in wich all the items of customers cart are stored. Every item has a "products id". The syntax for that is a little bit different than the products_id in TABLE_PRODUCTS since it has a suffix starting with ':' and then a string.
    ex.
    2:ad97c42aaac06e6a58fc9f87f9c37705

    in the function calculate i read

    $product_query = "select products_id, products_price, products_tax_class_id, products_weight,
    products_priced_by_attribute, product_is_always_free_shipping, products_discount_type, products_discount_type_from,
    products_virtual, products_model
    from " . TABLE_PRODUCTS . "
    where products_id = '" . (int)$products_id . "'";

    And (int)$products_id is the weird product id just explained. How can that work?



  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: class shoppingCart

    Some things require a check on the products_id regardless of attribute settings ...

    The (int) cuts off the attributes reference and just gives the products_id number so in this case only the 2 would be used ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Oct 2006
    Posts
    23
    Plugin Contributions
    0

    Default Re: class shoppingCart

    Thanks.
    I didn't know that (int) could do that trick.

 

 

Similar Threads

  1. shoppingCart Prefix
    By Soniccc in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 20 Apr 2011, 11:17 PM
  2. PayPal Push Orders: Object of class shoppingCart could not be converted to string
    By honrheart in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Oct 2009, 03:58 PM
  3. adding to shoppingCart class
    By avibodha in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Feb 2009, 08:15 AM
  4. Shoppingcart layout
    By lexz in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 10 Feb 2007, 04:21 PM
  5. class shoppingCart as inventory
    By David Bo in forum General Questions
    Replies: 0
    Last Post: 6 Feb 2007, 07:14 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