Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Limitlimited order methods only for certain product or sub-categories

    Hi,
    Can please some help, how to solve this problem?
    Some products can not be ordered together but separately.

    I have use onlu Money Order Module for completion of orders. And some product can't ordes together

    I have thread
    limitlimited shipped methods only with one categories
    http://www.zen-cart.com/showthread.p...tegories/page3

    but that is for shipped methods, I don't use shipped methods only Money Order Module.


    Thanks

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

    Default Re: Limitlimited order methods only for certain product or sub-categories

    What is it that you really want to do on the situation?

    Example: something like this code:
    Code:
        // do not show if products from master_categories_id 3 and 39 are in the cart together
        global $cart;
        if (!IS_ADMIN_FLAG && ($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
          $this->enabled = false;
        }

    can be used to stop a payment or shipping module to prevent an order that contains Products from both categories_id 3 and 39 when the Products use the master_categories_id 3 and 39 ...

    But, this allows the customer to enter the checkout ...

    Are you really wanting to prevent that as well as post a message on the shopping_cart as to why the checkout is unavailable until the Products causing the issue are changed?

    Are you really running an out dated Zen Cart for this shop? Or are you in the process of upgrading it?
    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
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: Limitlimited order methods only for certain product or sub-categories

    Hi Ajeh, thanks on reply

    I have product in master_categories and sub_categories that can not be ordered together in one order.

    1. Code that stop a payment module (Money Order Module) to prevent an order that contains Products from both categories_id 3 and 39
    Yes, that it would be a great situation to prevent that as well as post a message on the shopping_cart as to why the checkout is unavailable until the Products causing the issue are changed

    2. Yes, I run out dated Zen Cart for my shop 1.3.8.a.
    Becouse I have 15 plug in end if I update ZC I will run over the code and made a mess in the shop.


    Thanks

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

    Default Re: Limitlimited order methods only for certain product or sub-categories

    First ... think out what happens on a checkout ...

    1 Things added to cart

    2 4 pages to test for this as a security
    a. shopping cart
    b. checkout_shipping
    c. checkout payment
    d. checkout_confirmation

    Goal: Alert customer that checkout is not possible if true

    If on shopping_cart, you want a message triggered ...

    If on the checkout_ pages, you want to return to shopping cart and the message triggered ...

    So there needs to be a shopping_cart content test that triggers on the 4 pages with 3 of the pages returning to the shopping_cart to display the message ...

    For the 3 checkout pages, you can add to the header_php.php files the code in RED:

    Code:
    // bof: invalid products together
      if (($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
        $messageStack->add_session('header', 'Invalid Products together', 'error');
        zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      }
    // eof: invalid products together
    
    // Stock Check
    The shopping_cart header_php.php code is slightly different:
    Code:
    if (!$_SESSION['valid_to_checkout']) {
      $messageStack->add('shopping_cart', ERROR_CART_UPDATE . $_SESSION['cart_errors'] , 'caution');
    }
    
    // bof: invalid products together
      if (($_SESSION['cart']->in_cart_check('master_categories_id','3') > 0 && $_SESSION['cart']->in_cart_check('master_categories_id','39') > 0)) {
        $messageStack->add('shopping_cart', 'Invalid Products together', 'error');
      }
    // eof: invalid products together
    
    Now, how you want to explain this is up to you on the messageStack ...

    You may even want to customize it further to mark the conflicting products similar to the out of stock flag, but you will need to do additional coding for the shopping_cart header_php.php and possibly the template to do so ...
    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!

  5. #5
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: Limitlimited order methods only for certain product or sub-categories

    Hi,
    In shopping_cart, to a message triggered if put product that can not be ordered together in one order.
    And that he could not continue to checkout_ pages


    What code to put
    header_php or shopping_cart ?


    Explain this with messageStack. I think that's enough on the page shopping_cart to show message that products in the basket (shopping_cart) can not be ordered together but separately.


    Thanks

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

    Default Re: Limitlimited order methods only for certain product or sub-categories

    If you look at the code that I posted, the first code goes in the 3 files:
    /includes/modules/pages/checkout_shipping/header_php.php
    /includes/modules/pages/checkout_payment/header_php.php
    /includes/modules/pages/checkout_confirmation/header_php.php

    above the line:
    Code:
    // Stock Check
    For the file:
    /includes/modules/pages/shopping_cart/header_php.php

    the second code in RED goes below the code:
    Code:
    if (!$_SESSION['valid_to_checkout']) {
      $messageStack->add('shopping_cart', ERROR_CART_UPDATE . $_SESSION['cart_errors'] , 'caution');
    }
    The massageStack will display the message to the customer when they either add a Product that makes to the cart where there are Products from both categories_id 3 and 39 where the master_categories_id on the Products are using 3 and 39 and will display a message and return to the shopping_cart if they try to checkout ...
    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!

  7. #7
    Join Date
    Mar 2009
    Location
    Serbia
    Posts
    349
    Plugin Contributions
    0

    Default Re: Limitlimited order methods only for certain product or sub-categories

    Works like a dream. Thanks Ajeh, you are awesome.

    I wish you a happy new year and good health.


    Kobra

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

    Default Re: Limitlimited order methods only for certain product or sub-categories

    You are most welcome ... thanks for the update that this was able to work for you ...

    Have a great holiday!
    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!

 

 

Similar Threads

  1. Replies: 6
    Last Post: 16 Jul 2015, 04:29 AM
  2. Restricting payment methods to only certain categories
    By delia in forum General Questions
    Replies: 6
    Last Post: 30 Dec 2014, 06:53 PM
  3. v151 Only allow certain shipping methods for some countries?
    By doooomed in forum Built-in Shipping and Payment Modules
    Replies: 8
    Last Post: 1 Oct 2013, 12:30 AM
  4. Use product listing row layout for certain sub categories only
    By Danielle in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 12 Jun 2010, 11:55 PM
  5. limitlimited shipped methods only with one categories
    By kobra8 in forum Managing Customers and Orders
    Replies: 29
    Last Post: 17 Oct 2009, 01:19 AM

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