Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: New to Zen, need some Session var anc cart product direction

    http://www.zen-cart.com/forum/showpo...44&postcount=5
    http://www.zen-cart.com/forum/showpo...97&postcount=9
    These 2 posts discuss something akin to the following code, which is inserted into the constructor method of each of the shipping modules you want restrictions to occur in.
    Basically this example looks up the "products_model" field from the data in the products in the cart, to check for certain match combinations, and enables the module if those are found.
    You could do similarly using something like the products_id field and disabling the module instead (with false instead of true):
    Code:
    	  if (IS_ADMIN_FLAG == false) {
               if ($_SESSION['cart']->in_cart_check('products_model','NAV') > 4) && $_SESSION['cart']->in_cart_check('products_model','MP') > 0) ) {
    	    $this->enabled = true;
    	  }
    Other semi-related discussions:
    http://www.zen-cart.com/forum/showth...104#post781104
    http://www.zen-cart.com/forum/showthread.php?t=133190
    http://www.zen-cart.com/forum/showthread.php?t=126162

    (Or you could use the get_products() or get_product_id_list() methods and do your own looping instead.)
    .

    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.

  2. #2
    Join Date
    Sep 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: How can I restrict shipping choices based on kinds of products in the cart?

    Thanks DrByte, definitely that helps me!

 

 

Similar Threads

  1. v139h Restrict Products in Cart Based on Other Products in Cart
    By lindasdd in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 2 Nov 2013, 03:26 PM
  2. Replies: 0
    Last Post: 17 Sep 2012, 09:33 PM
  3. Restrict Products based on Country
    By ultra_mao in forum Setting Up Categories, Products, Attributes
    Replies: 14
    Last Post: 19 Jun 2010, 11:01 PM
  4. HOW CAN I AUTO-SELECT SINGLE-ATTRIBUTE CHOICES DURING ADD-TO-CART process?
    By wweyland in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 1 Dec 2009, 02:06 AM
  5. Payment Choices based on Shipping
    By Bootyrat in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 30 Aug 2006, 02:32 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