horlaitan15
Forum Replies Created
-
Ok thanks
Forum: Plugins
In reply to: [WooCommerce] Multiple orders in woocommerce version 4.4.1Solved and thanks
I had to install some plugins o use to clear cacheForum: Plugins
In reply to: [WooCommerce] Multiple orders in woocommerce version 4.4.1I will try that and reply you ASAP
Forum: Plugins
In reply to: [Job Postings] Purchase WidgetI think it’s in the wrong plugin support. Thanks for the observation.
Forum: Plugins
In reply to: [Job Postings] Purchase WidgetThis is the code I use to add to cart
add_action( 'template_redirect', 'woo_ariyoconcept_widget' );
function woo_ariyoconcept_widget() {
if (isset($_POST['buy']) && isset($_POST['product_buy'])){
if ( ! is_admin() ) {
$product_id = $_POST['product_buy'];
$found = false; //check if product already in cart
if ( sizeof( WC()->cart->get_cart() ) > 0 ) { foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) { $_product = $values['data'];
if ( $_product->get_id() == $product_id ) $found = true; } // if product not found, add it
if ( ! $found ) WC()->cart->add_to_cart( $product_id ); } else { // if no products in cart, add it WC()->cart->add_to_cart( $product_id ); } }}}Forum: Plugins
In reply to: [Job Postings] Purchase WidgetThis is the link to the shortcode
https://pastebin.com/1Su7zP5V