WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] redirect after adding to cart (3 posts)

  1. logovaz
    Member
    Posted 1 year 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.

    http://wordpress.org/extend/plugins/woocommerce/

  2. logovaz
    Member
    Posted 1 year 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('') );
    exit;
    }
    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);
    exit;
    }
    Add an additional field url
    add to cart and redirects where necessary

  3. tremblayly
    Member
    Posted 1 year ago #

    Hi,

    I will try this. Thanks

    Lyse

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.