Display element based on 'post'
- This topic has 42 replies, 3 voices, and was last updated 9 years, 8 months ago by
carassius.
-
AuthorPosts
-
August 31, 2015 at 2:25 PM #1361
carassius
ParticipantThanks again for your help!
August 31, 2015 at 2:31 PM #1362Tan Nguyen
ParticipantHi 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]
August 31, 2015 at 2:31 PM #1363carassius
ParticipantIt is on a local host at the moment, but can try and get a live site working
August 31, 2015 at 2:35 PM #1364Tan Nguyen
ParticipantYeah, glad to meet you, an Australian who like Breaking Bad show like me 🙂
August 31, 2015 at 2:36 PM #1365carassius
ParticipantWho doesnt like breaking bad! Are you Aussie? That would explain the Perth Boat House 😛
August 31, 2015 at 2:40 PM #1366carassius
ParticipantOk, created a live site at jonmather.info and sent you admin access.
I created two contacts and a test quote
August 31, 2015 at 6:59 PM #1370carassius
ParticipantDid you get a chance to login and have a look to see what was going on Tan?
August 31, 2015 at 7:29 PM #1371carassius
Participantgot it! I am a dumb arse, its in the 'std' calling the wrong meta!
August 31, 2015 at 7:44 PM #1372carassius
ParticipantSo now the issue is that it has completely broken the layout?
September 1, 2015 at 9:14 AM #1373carassius
ParticipantNow 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
September 1, 2015 at 11:18 AM #1375Tan Nguyen
ParticipantHi 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
September 1, 2015 at 12:06 PM #1376carassius
ParticipantThanks 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?
September 1, 2015 at 2:54 PM #1377carassius
ParticipantOne 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?
-
AuthorPosts
- The topic ‘Display element based on 'post'’ is closed to new replies.