Instant Buy / Cart - Learndash & FluentCart
I have set up LearnDash and FluentCart, and everything works well. The setup was easy.
However, when someone wants to purchase my course and goes to the course page, they click "Buy Now," which links to the FluentCart product page. They then buy or add to cart.
Question: Would a shortcode for "Buy Now" or "Add to Cart" be possible for each product? Or a URL that adds the course directly to the cart when clicking the Learndash course button? This would remove one extra step.
I have faced the issue while testing the flow with learndash and fluentcart . Learndash have own payment wso they go with that. Here yu have to tweak the button with code . If you are using page builder yhan can use fluentcart add to cart widget or you can use the code in theme function
add_filter( 'learndash_get_course_price', function( $pricing ) {
if ( ! is_singular( 'sfwd-courses' ) ) {
return $pricing; // don't touch course grid, only the details page
}
$course_id = get_the_ID();
// pull from your existing two-tier mapping table/meta
$product_id = your_get_mapped_fluentcart_product_id( $course_id );
if ( $product_id && ! sfwd_lms_has_access( $course_id, get_current_user_id() ) ) {
$pricing['price'] = do_shortcode(
'[fluent_cart_add_to_cart_button id="' . intval( $product_id ) . '"]'
);
}
return $pricing;
}, 20 );
Which one is convenient for you?