Woocommerce PHP Custom Script - Add Subscription Product to Any Product on Checkout

Currently we are forcing Subscription but it seems very complicated so I want to make a change -

I want to make very EASY for customer -


Customer clicks buy now

Shopping cart add product + subscription product

------------------- I Found this Code that you may find helpful ------------------------------------

PHP Snippet: Add “Product Gift” to Cart if SKU is Added to WooCommerce Cart


* @snippet Buy 1, Get Free Product as a Gift - WooCommerce

* @how-to Watch tutorial @ [login to view URL]

* @sourcecode [login to view URL]

* @author Rodolfo Melogli

* @compatible Woo 3.5.3

* @donate $9 [login to view URL]


add_filter( 'woocommerce_add_to_cart_validation', 'bbloomer_add_gift_if_sku_added_cart', 10, 3 );

function bbloomer_add_gift_if_sku_added_cart( $passed, $product_id, $quantity ) {

global $woocommerce;

/* enter array of SKUs that give gift */

$skuswithgift = array('armpar','armsup');

/* enter SKU of product gift */

$giftsku = 'starter';

/* enter name of coupon that gives 100% discount for specific product gift */

$coupon_code = 'xxxyyyzzz';

$product = wc_get_product( $product_id );

if ( $product->get_sku() && in_array( $product->get_sku(), $skuswithgift ) ) {

WC()->cart->add_to_cart( wc_get_product_id_by_sku($giftsku) );

wc_add_notice( __( 'Hey, Supporter! As promised, I added #CustomizeWoo Video Lessons for Free - you will be able to access them in a single place (~ My Courses ~) and get premium support.', 'woocommerce' ), 'success' );

$woocommerce->cart->add_discount( $coupon_code );


return $passed;


Taidot: Javascript, PHP, tietojärjestelmäarkkitehtuuri, WooCommerce, WordPress

Näytä lisää: php script add host header iis, php script add lines based count, php custom decal script, php template script simple custom, complete ready add php login script, php script add social bookmarks, add divx movies php movies script, php script add friends profile, php script add modify form, virtuemart php custom checkout module page, paypal php mysql script subscription, php route planner script add, php script add profile image, custom php imap script, custom script php, custom script add cart volusion, php mysql script newsletter subscription system, woocommerce button add cart php custom page

Tietoa työnantajasta:
( 89 arvostelua ) Houston, United States

Projektin tunnus: #20010221

Myönnetty käyttäjälle:


Hello, I read your requirements and understand very-well and ready to start work from now. Thank you

$150 USD 2 päivässä
(107 Arvostelua)

16 freelanceria on tarjonnut keskimäärin %project_bid_stats_avg_sub_26% %project_currencyDetails_sign_sub_27% tähän työhön


//** EXPERT IN WORDPRESS WOOCOMMERCE CUSTOM WORK **// More then 7+ years of experience in Development . Also kindly check our profile we have done over 350 project here on freelancer so very much reliable & fit for Lisää

$250 USD 2 päivässä
(380 arvostelua)

Hi, I'm a Web Designer/Developer from the India. My name is Suraj. Your project description sounds interesting to me and I do have skills & experience that are required to complete this project. Relevant Skills and Lisää

$155 USD 7 päivässä
(167 arvostelua)

Hello Sir, Hope all is well and thanks for reviewing our bid. We would be very interested in working on your project. We will design the web pages with modern, elegant look and feel, may be parallax scrolling as it Lisää

$250 USD 7 päivässä
(34 arvostelua)

Nice to meet you. I've read the task description and can develop definitely. I'll provide you with the highly skill to complete this task in time. I'll also do my best for you. Please contact with me. Thank you ve Lisää

$100 USD 3 päivässä
(92 arvostelua)

Hi, Recently, we completed a project for the client, which is completed in the WordPress. In this field, I am 5 years experienced in PHP, CakePHP, Wordpress, Wordpress Theme Integration, Woocommerce/E-commerce, Resp Lisää

$50 USD 5 päivässä
(57 arvostelua)

Hello! I am a web developer.(WORDPRESS expert) I have checked your project description. I can help you with customizing woocommerce I guarantee the good result. I will wait for your reply. Thank you.

$155 USD 3 päivässä
(20 arvostelua)

Hello, I am expert web developer and I can help you right now with the subscription function on your Woocommerce website. Let's discuss more. Thank you

$100 USD 1 päivässä
(21 arvostelua)

Hello My name's Hongri, Certificated Woocomemrce Developer with 7 years of experience. After reading your description carefully, I have convinced that this project will be completed in time perfectly as you want. Once Lisää

$140 USD 2 päivässä
(31 arvostelua)

Hello! We are a Russian-Canadian web development company with 10+ years experience and professional developers. We have vast experience working with PHP & PHP frameworks, WordPress & Woocommerce, Opencart, Magento, AP Lisää

$350 USD 3 päivässä
(23 arvostelua)

hello sir , i have ready this kind of project i can show you demo also i can do this work please inbox me i have 10 years experience in software and web development in c# mvc technology , i can do your Lisää

$277 USD 3 päivässä
(16 arvostelua)

Hey There, Post working with various clients, I have good experience with website and WordPress development and have developed multiple platforms. I will customize the entire pages and get it approved before proc Lisää

$250 USD 3 päivässä
(7 arvostelua)

I can complete your task in 2 days. Hi, Nice to meet you. I am a talented, rich experienced web/software developer. I have read your task description carefully and understood clearly. Scraping is my specialty. I a Lisää

$100 USD 3 päivässä
(4 arvostelua)

I read job description and I can do your project.I can even work on urgent basis and complete your project me for more information

$166 USD 5 päivässä
(3 arvostelua)

Hi there fanny100, We’re experts developers, having 10+ years experience developed 100+ websites/systems. Not only that, we’re also UI designers (FULL STACK). Look here like you: ******************** https://roomstyl Lisää

$140 USD 2 päivässä
(0 arvostelua)

Hello Sir, This is Sougata from Kolkata. I've completely understand your desire towards this project. So i can assure you the quality. I'll provide you #admin panel ( user-friendly) #business email ID so you can con Lisää

$200 USD 7 päivässä
(0 arvostelua)