• hello,

    My website about buy a membership VIP,SLIVER and GOLD

    click here

    I want to put condition to choose one of the 3 type membership
    how and where I put ?

    plz reply

Viewing 4 replies - 1 through 4 (of 4 total)
  • You already seem to have a pricing table and you can add them to the cart. Is your question related to preventing folks from adding all products to the cart, (i.e. only one product can exist)?

    Thread Starter Budoor

    (@budoor)

    yes that what I want

    Hi, I see that you are using the Divi theme and woocommerce to add to cart. I do not have access to the Divi code to tell you exactly what you need to fix, but I think you will have to do something like this:

    (1) Check if any item exists in the cart (I think woocommerce will be able to tell you that)
    (2) If number of items in cart is greater than zero, then disable the buttons on the pricing table.

    If you want to go in greater detail, you could probably find out which item was in the cart and change the button text to “Already in Cart”.

    I hope I was able to give you an idea.

    Okay, I did some research and I found that the variable $woocommerce->cart->cart_contents_count should contain the current cart contents (detailed answer from stackoverflow)

    I think you will need to look at the code for Divi’s page builder. If I am not mistaken, the pricing table would be a shortcode. Search for the shortcode in the theme directory and customize the button.

    Again, I understand that this is very generic and broad, sorry. Without the actual code, it would be impossible to be spot on with an answer.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘help me plzzz with function’ is closed to new replies.