InventiveWebDesign
Forum Replies Created
-
Forum: Plugins
In reply to: [Secure Custom Fields] One SCF field causing random pages to breakThank you, it looks like I am already doing this but it may have gotten me closer. I have a few functions in there that are used to create shortcodes so I can list the field data with their links in the correct place on the product page.
The code for [acf_accessories] (which doesn’t always work) looks like this:
function acf_accessory() { //if ( is_product() ) { //global $post; $prod_accessories = get_field('accessories' ); if ( ! empty( $prod_accessories ) && ! is_wp_error( $prod_accessories ) ) { $accessory_links = array(); foreach ( (array) $prod_accessories as $prod_accessory ) { // LINE 158 $accessory_links[] = '<a href="' . esc_url(get_term_link( $prod_accessory )) . // LINE 159 '">' . esc_html( $prod_accessory->name ) . '</a>'; } return implode( ', ', $accessory_links ); } //} return ''; } add_shortcode( 'acf_accessories', 'acf_accessory' );
The code for [acf_prod_mod_nums] (which works) looks like this:
function acf_prod_mod_num() { //if ( is_product() ) { //global $post; $prod_mod_nums = get_field('model_numbers' ); if ( ! empty( $prod_mod_nums ) && ! is_wp_error( $prod_mod_nums ) ) { $mod_num_links = array(); foreach ( $prod_mod_nums as $prod_mod_num ) { // LINE 205 $mod_num_links[] = '<a href="' . esc_url(get_term_link( $prod_mod_num )) . // LINE 206 '">' . esc_html( $prod_mod_num->name ) . '</a>'; } return implode( ', ', $mod_num_links ); } //} return ''; } add_shortcode( 'acf_prod_mod_nums', 'acf_prod_mod_num' );
I have commented inline where the line numbers in question are in my code. You can see the only difference (other than variables) for each code is that in Line 158 in the Accessories code it has
(array)
after theforeach (
. I thought, if these functions are essentially doing the same thing shouldn’t removing (array) work? Well a lot of the errors disappeared but now the Accessory doesn’t show and I get this error:“Warning: foreach() argument must be of type array|object, string given in?/home/customer/www/staging2.mcdanielmetals.com/public_html/wp-content/themes/astra-child/functions.php?on line?158“
I am unsure how this code is working and why one needs to be different than the other but maybe someone who know SCF (acf) better could help me out?
Forum: Plugins
In reply to: [Seamless Donations is Sunset] Stop a recurring donationBump? Any ideas? Help?
Nevermind, I updated the forminator plugin and it appeared. Thank you!
I don’t have that option. The number-1 field is the question “How many students are you registering?”. When I go to the calculations tab I only have Enable/Disable.
This sounds like it should work but you said “If you change the “number-1” calculations option to “Null (zero)” instead, then the “Student’s cost” calculation with number-1 field hidden will become “0 * 20” and that equals 0 and not 20; “extra 20” would be gone.”
Where or how do I set this? If I look at the “number-1” field which is the “How many students are you registering?” field there is only the ability to enable or disable Calculations in the Calculations tab. I have the default value set to 0. Do I have to change that default value to “Null”?
If I look into the Student’s Cost Calculation field I don’t see any options to to set it to Null. I also don’t see anything in either field to Ignore this field when hidden.
I just have the free version of Forminator. Is this a setting that we would need to pro version for?
Thanks for the quick response. Here you go!
great! Do you have a function that can do that?
Great thanks for those resources. Now, how can I get the SKU to show up in my theme? Is there a function that you have that creates a shortcode for that?
Sent, thank you!
it’s just a short code on the page. I inherited the site from another developer. Could you be more specific which template file? What about the names on the buttons that just say Download?
We use Elementor to build most of the pages on our site. In this case it is an elementor page that is pretty much empty except this shortcode: [edd_receipt]
What code do we use to display the SKU? Will it be searchable?
Thanks I submitted a request for assistance from your support team on your site.
As I said before, I inherited this site with the plugin and don’t have access to the pro area because the previous developer bought the license and hasn’t given us access. I disabled the pro plugin and it still doesn’t work.
Can you still help?