• Resolved UnoBomber

    (@unobomber)


    Hello from the other side
    I must have called a thousand times.

    .. now im stuck.
    I am building a shop, where some of the products and shipping is handled by Printful API and other products – by me.
    If I put Printful product to cart, Printful api offers and calculates the shipping. But if I have two products of whitch second one is mine, that has custom shipping cost under shipping clases, Printful api stops working and my custom shipping rates takes the lead.
    I was looking for a way to limit cart content by category. To allow customer to have Printful category products in cart only, or only my products, so there would not be mashup between two different shipping systems.

    Ive found this https://aelia.co/2015/12/07/woocommerce-only-allow-specific-product-combinations-in-cart/ Only allow specific product combinations in cart.
    Problem is it is complicated, you have to use this code from inside the php, and product IDs has to be put in by hand via php as well, plus no guaranties it will work in future with WP WC updates.

    Or maybe there’s a way to make shipping calculation different, for each product category in the cart and show total paying sum?…

    So now I am stuck. Nor I can find a plugin nor I can figure out a work around.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    This will require customisation, but it’s possible to split a cart up into 2 packages and limit each to using a certain shipping method.

    https://support.wooforce.com/hc/en-us/articles/205561402-WooCommerce-Split-cart-items-from-the-same-order-and-ship-via-multiple-shipping-methods

    sample from a plugin I built to split special items https://gist.github.com/mikejolley/2886444204563929a0fb

    Thread Starter UnoBomber

    (@unobomber)

    Thank you Mike

    Seeking similar solution to limit based on categories, for purposes of showing and allowing the correct gateway (not shipping options). I bought the Woo Conditional Shipping & Payments extension, but it doesn’t do a good job of restricting gateway (or showing appropriate warning) when user attempts to check out with items from opposing categories.

    My goal: when products from Category A are in cart, show only gateway 1 in checkout. When products from Category B or C are in the cart, show only gateway 2. If products from A are in cart, prevent and show warning message when products from B or C are added. And vice versa. Or I suppose it would also be fine for the preventative action and warning occur when proceeding to checkout, instead of when adding to cart.

    On the Aelia.co post, comments from December 2016 point out a shortcoming the logic of their snippet, that makes it unusable in my use case.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce: limit cart content by same category’ is closed to new replies.