WordPress.org

Forums

Olevmedia Shortcodes
Add products from pricing table to the shopping cart (2 posts)

  1. extremecars.co
    Member
    Posted 1 year ago #

    Hi there,

    I installed your "Olevmedia Shortcodes" on a couple of my sites and LOVE it. The only problem is that when I edit the pricing table function, how can I link "add to cart" button to the shopping cart? As for now, I use Woocommerce, so, when users click on "add to cart" (at pricing grid), it links to the single product page --> the user has to add it to the shopping cart again.

    I'm using your pricing table for virtual products, which I prefer users can;
    1. See details and prices at your pricing table
    2. Click "add to cart" that adds items to the shopping cart
    3. Then go to "Shopping cart" to pay "ALL" items purchased at one time.

    http://wordpress.org/plugins/olevmedia-shortcodes/

  2. Postelnicuo
    Member
    Posted 1 year ago #

    ok... now i had the same problem and after 5 h loking for a solution i finaly got it and is the most simple one.
    1. Go to Add product in woocommerce and add a product with the title and price just like in your pricing table (ex: Title: Business pack, Price: 200Euro) and save it as a product with password.

    2. Go to wp-content/plugins/woocommerce/includes/wc-cart-functions.php
    and search for "function wc_protected_product_add_to_cart". Replace:
    if ( post_password_required( $product_id ) ) {
    $passed = false;
    with
    if ( post_password_required( $product_id ) ) {
    $passed = true;
    comment out the eror "wc_add_notice( __( 'This product is protected and cannot be purchased.', 'woocommerce' ), 'error' );"

    3. Now go as admin to that product and right click on the "add to cart" button and copy the url. Must be something like this : http://example.com/shop/?add-to-cart=1677 (1677 is the product ID)
    and paste it to the pricing table button in link=''.

    Now logout and go to that pricing table and press the button. :D

    This works for me :D The product with the same title as the pricing table is hidden from product page but can be added to cart and payed for :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Olevmedia Shortcodes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic