• Resolved rasoul158

    (@rasoul158)


    Hi
    thanks for this useful plugin.
    When I add some options to a product the “add to card” button link changes to product page. I need the “add to card” button to keep its default link (https://yourdomain.com/?add-to-cart=25), and adds the product to card with default options I have set in the plugin.
    How can I do this?
    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Wombat Plugins

    (@maartenbelmans)

    Hi there,

    Our plugin assumes that you need to select some options before adding the product to cart. That’s why we go to the product page per default. Otherwise, what’s the point of having options on your product :).

    If you want to overwrite that, it can be done by code. More specifically, tying into the appropriate WooCommerce filters.

    Thread Starter rasoul158

    (@rasoul158)

    Actually I only have one true/false option for all products and it’s true by default. User is instructed to go to the product page in case he wanted to change that option.
    About coding, could you please explain more? or refer me to the part of plugin code in which the code over-rights original link?

    Plugin Author Wombat Plugins

    (@maartenbelmans)

    I’m sorry but we can’t help with custom coding for the free version of the plugin. Free support is only for bugfixes or

    questions about the plugin. Thanks for understanding!

    Thread Starter rasoul158

    (@rasoul158)

    I figured that out. If anyone has this problem open the following file:
    /includes/controllers/class-product-controller.php
    Line 36: add_filter(‘woocommerce_product_add_to_cart_url’, array($this, ‘set_add_to_cart_url’), 10, 2);
    delete this line or make it a comment.

    Plugin Author Wombat Plugins

    (@maartenbelmans)

    Changing plugin code directly is not recommended as it will be overwritten back to its original state when you update the plugin.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘keep “add to card” button’ is closed to new replies.