Display element based on 'post'

Support General Display element based on 'post'

Viewing 13 posts - 31 through 43 (of 43 total)
  • Author
    Posts
  • #1361
    carassiuscarassius
    Participant

    Thanks again for your help!

    #1362
    Tan NguyenTan Nguyen
    Participant

    Hi Jon, it's really weird if it return empty value even though customer phone has set. Can you please give me credentials to your website to check? Include FTP and WP-Admin? Can you send me via my email to check it faster? My email is: [email protected]

    #1363
    carassiuscarassius
    Participant

    It is on a local host at the moment, but can try and get a live site working

    #1364
    Tan NguyenTan Nguyen
    Participant

    Yeah, glad to meet you, an Australian who like Breaking Bad show like me 🙂

    #1365
    carassiuscarassius
    Participant

    Who doesnt like breaking bad! Are you Aussie? That would explain the Perth Boat House 😛

    #1366
    carassiuscarassius
    Participant

    Ok, created a live site at jonmather.info and sent you admin access.

    I created two contacts and a test quote

    #1370
    carassiuscarassius
    Participant

    Did you get a chance to login and have a look to see what was going on Tan?

    #1371
    carassiuscarassius
    Participant

    got it! I am a dumb arse, its in the 'std' calling the wrong meta!

    #1372
    carassiuscarassius
    Participant

    So now the issue is that it has completely broken the layout?

    #1373
    carassiuscarassius
    Participant

    Now that I have the customer conditional working, I am trying to configure the products which are a cloneable group

    My code is looking like this, can you have a look and see what is going wrong for me?

    • The first thing, content is not populating but the correct product ID gets assigned
    • The inputs only appear once, and do not clone at all

    https://pastebin.com/D9W7sauW

    #1375
    Tan NguyenTan Nguyen
    Participant

    Hi Jon,

    Sorry for late reply, I just back again and wonder to see that you can fix your code easily, brilliant.

    I can see you set 'column' => 4 for some 'hidden' fields, it's not necessary as these fields are hidden and some repeated code can be rewrite to cleaner 😉

    All foreach like so:

    
    ...
    foreach ( $_POST as $key => $value )
    {
    	if ( strpos( $key, 'p52_quote_phone_' ) )
    		unset( $_POST[$key] );
    }
    ...
    

    Can be combine and rewrite to 1 foreach like so:

    
    foreach ( $_POST as $key => $value )
    {
    	if ( strpos( $key, 'p52_quote_phone_' ) || strpos( $key, 'p52_quote_company_' ) || strpos( $key, 'p52_quote_delivery_address' ) ... ) // Replace ... with all fake fields you've set
    	unset( $_POST[$key] );
    }
    

    For cloned group, I firstly designed for 1 product only and if we switch to cloned groups, it's time consuming because it's related to populate custom data and out of our scope, we're sorry about that.

    Best Regards

    Tan

    #1376
    carassiuscarassius
    Participant

    Thanks Tan, any plan on the horizon for cloned group support then with conditional logic? Or is just to hard that it is never going to happen?

    #1377
    carassiuscarassius
    Participant

    One last question then if you could endulge me, how about working within tabs?

    I have another CPT that is pulling the same contact info, but is displaying it in tabs, the issue is that the visible boxes are appearing in all tabs, not just the contact one?

    https://pastebin.com/eXqMXdCD

Viewing 13 posts - 31 through 43 (of 43 total)
  • The topic ‘Display element based on 'post'’ is closed to new replies.