Add Chargebee to Divi Pricing Table

Sample jQuery attr() method to add plan ID to pricing table buttons:

jQuery(document).ready(function() {
  // Add Chargebee checkout data type and create undefined button URL on all Divi pricing table buttons
  jQuery(".et_pb_pricing_table_button").attr({
    "data-cb-type": "checkout",
    href: "javascript:void(0)"
  });

  // Add Chargebee plan ID to first pricing table button
  jQuery(".et_pb_pricing_table_0 .et_pb_pricing_table_button").attr(
    "data-cb-plan-id",
    "my-chargebee-plan-id---1"
  );

  // Add Chargebee plan ID to second pricing table button
  jQuery(".et_pb_pricing_table_1 .et_pb_pricing_table_button").attr(
    "data-cb-plan-id",
    "my-chargebee-plan-id---2"
  );
});

More info

Add Chargebee portal link as a WordPress menu item

.attr() | jQuery API Documentation

Need Divi Help?
Get in touch…
I work on all kinds of Divi sites, improve Divi loading speeds & build custom Divi modules. If you need to hire Divi help then get in touch!

1 Comment

  1. Florian Leodop

    Hi Alex,

    I just came here from your awesome tutorial for the portal link.
    However with this one, I am not sure where I can paste the code above in my Divi in order for the Chargebee Check-in to pop up. Could you kindly advise?

    Thank you so much.

    Reply

Submit a Comment

Your email address will not be published.