Empty product brick

Discussion in 'Troubleshooting' started by raph, Feb 25, 2014.

  1. raph

    raph New Member

    Joined:
    Feb 17, 2014
    Messages:
    10
    Hello,

    I have a problem with the form editor : I have designed a signup form that I like, containing several product bricks, for the different categories of products that we offer (products, services, etc). The trouble is that if any of these are empty, the form doesn't display at all : instead, I get an error saying that there are no products to purchase at the moment. Is there any way I can get it to just hide empty product bricks instead ?

    Thanks in advance,
    Jonathan
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You can change require behaviour for these bricks to 'Never' (configuration setting of brick) then it will be just removed from form if there is not suitable products to display in brick.
  3. raph

    raph New Member

    Joined:
    Feb 17, 2014
    Messages:
    10
    Hmm, but I don't want the users to be able to place an empty order, with neither products nor services. Is there a way to validate that? Even by hand in the PHP would be ok, but which file should I change?
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
  5. raph

    raph New Member

    Joined:
    Feb 17, 2014
    Messages:
    10
    Wow, thanks a lot, I hadn't seen that! Where can I find the list of existing variables that I can retrieve from the $vars array?
  6. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You can add the following code print_rre($vars) and try to submit form. You will see dump of this array.
  7. raph

    raph New Member

    Joined:
    Feb 17, 2014
    Messages:
    10
    Ok, thanks for the information, I'll check that out.

    However, I just tried your suggestion, and my form still doesn't work : if I purchase all the products of one category (thus making one of my product bricks empty, but not the others), my form says there are no products to buy and won't let me order anything.

    I set all four of the product bricks to "never required", but it makes no difference. What am I doing wrong?
  8. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295

Share This Page