• Resolved imborx

    (@imborx)


    Hi, I love this plugin but there’s a really important feature that I’m not findid. Is to also show the One click button in the product list. Actually it’s showing “See more” and I need to click in the individual product to then see the “One click” button. How can I show directly in the products list that button?

    Also, there’s a direct link url like the default on in wooocommerce to buy that product? Like this: https://yourdomain.com/checkout/?add-to-cart=25

    Thanks a lot!

    • This topic was modified 5 years, 1 month ago by imborx.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Artem Abramovich

    (@artabr)

    Hello!

    By default, the plugin does not display buttons on the product catalog page. But if required, this can be done with a short snippet.

    After the Add to Cart button

    add_filter ('woocommerce_after_shop_loop_item', 'awooc_html_custom_add_to_cart', 15);

    Before the Add to Cart button

    add_filter ('woocommerce_after_shop_loop_item', 'awooc_html_custom_add_to_cart', 5);

    But this will not work correctly with variable products, since there is no choice of variation on the product card. With simple products should work without problems

    Thread Starter imborx

    (@imborx)

    Hi @artabr,

    It worked! But that button it’s also display in the products where I selected “Disable order click” (screenshot: https://i.gyazo.com/edd73e16a9ae4b605a07ecce216129a4.png). Is there any way adding a filter to just show that button in products where that checkbox it’s not selected? As it should work.

    Other thing that I check it, the conditional fields in contact form 7: https://es.www.ads-software.com/plugins/cf7-conditional-fields/ aren’t working in the popup window when you click in the “One click” button. Can you make it compatible? Would be a perfect plugin.

    Thanks a lot for your work!

    Plugin Author Artem Abramovich

    (@artabr)

    To take into account the value of the field, then we must do so

    Before the Add to Cart button

    add_filter(
    	'woocommerce_after_shop_loop_item',
    	function () {
    
    		$product = wc_get_product();
    		if ( 'no' === $product->get_meta( '_awooc_button', true ) ) {
    			awooc_html_custom_add_to_cart();
    		}
    	},
    	5
    );

    After the Add to Cart button

    add_filter(
    	'woocommerce_after_shop_loop_item',
    	function () {
    
    		$product = wc_get_product();
    		if ( 'no' === $product->get_meta( '_awooc_button', true ) ) {
    			awooc_html_custom_add_to_cart();
    		}
    	},
    	15
    );

    I did not check the operation of conditional fields, I will try to check and fix it in the next release.

    Thread Starter imborx

    (@imborx)

    Awesome @artabr, the code works fantastic!!

    And about conditional fields, I really appreciate it. That would make the plugin perfect. I’ll wait for that fix ??

    • This reply was modified 5 years, 1 month ago by imborx.
    Plugin Author Artem Abramovich

    (@artabr)

    Excellent! Glad everything worked out.

    Thread Starter imborx

    (@imborx)

    Oh and I just realized, that for my website I needed different form for different product. Would be posible to select a form in each product? I make it a quick photoshop montage to show what I mean: https://i.gyazo.com/a1d2ba3e12955bbbeecff8e182428e94.png

    Because in my case, some products has different options than others and the form need different fields.

    Thanks!

    Plugin Author Artem Abramovich

    (@artabr)

    An interesting solution. I understood the idea, I’ll do it in the next release.

    Thread Starter imborx

    (@imborx)

    I really appreciate it @artabr

    I never see a dev who answers that fast and try to implement new request in next release. Congrats for your work and for hearing the community!

    Cheers

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘One click button in product list’ is closed to new replies.