The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] redirect after adding to cart (3 posts)

  1. logovaz
    Posted 3 years ago #

    Sorry to ask the same question a second time.
    I could not organize independently redirect after adding product to cart could only function in the file to change the basket to replace the simple link. if it is possible to provide more clarifications on the advice of
    " Yes anything is possible however this is quite custom to your application. I would suggest you add some kind of custom meta information to your product to state if this product should redirect or not. Then in your product template do a condition check for this meta and perhaps put a hidden value in an input tag. Then hunt for a callback within the add to cart.js and bind a function to that callback to look for the input hidden field's value and perform your re-direct from there. "
    Sorry for my English. I use a translator.


  2. logovaz
    Posted 3 years ago #

    Decided without the aid of a support
    who are interested
    file woocommerce-funtstions.php

    elseif (get_option('woocommerce_cart_redirect_after_add')=='yes' && $woocommerce->error_count() == 0) {
    wp_safe_redirect( $woocommerce->cart->get_cart_url('') );
    replace with
    elseif (get_option('woocommerce_cart_redirect_after_add')=='yes' && $woocommerce->error_count() == 0)
    $url = get_post_meta($product_id, 'url', $single = true);
    {wp_redirect( $url);
    Add an additional field url
    add to cart and redirects where necessary

  3. tremblayly
    Posted 3 years ago #


    I will try this. Thanks


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.