Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Use a div element as a second WooCommerce add to cart button

I'm building a WooCommerce webshop with Oxygen builder. Now I've got my product pages and all set up and functional, but I'd like to have a second element (a DIV with the fa-cart-plus icon in it) as an additional "Add to cart" button.

Now I've found the following:

global $woocommerce;
$woocommerce->cart->add_to_cart( $product_id, 1 );

but I have no idea how to call this from an onclick event. It feels a bit like having all the ingredients but not knowing how to turn them into a cake. Is there anyone here who can help?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!