stoicassistant
Forum Replies Created
-
Very insightful, thank you.
Thank you for your response. I’m confused about variation ids in the shortcode. If I have 20 products and 40 variations, would I have to list all 40 variation IDs in the shortcode?
Forum: Themes and Templates
In reply to: [OceanWP] PDF Embedder not working on quick-view-content.phpYesterday I was able to display PDF embed on Archive page, but now I am unable to replicate this and only plaintext is displayed.
Last time, using Snippets plugin, I added the following code:
add_action('ocean_after_archive_product_title', 'product_datasheet_embed_display_below_title', 5); function product_datasheet_embed_display_below_title() { if( get_field ('datasheetquickview')): ?> <?php echo do_shortcode('[pdf-embedder url="'.get_field('datasheetquickview').'"]'); ?> <?php endif;}
With Quick View turned off, Archive page successfully displayed embed for each product.
When I turned Quick View on, embeds were broken and only plaintext was displayed.
When I turned Quick View off again, embed is still broken and only plaintext is displayed.
So I have been unable to replicate the embed on Archive page.
Forum: Themes and Templates
In reply to: [OceanWP] PDF Embedder not working on quick-view-content.phpYes, there is a conflict with Quick View, because that Embed only displays properly when Quick View is turned off. When Quick View is turned on in Appearance>Customize, it displays as a plain link.
Forum: Themes and Templates
In reply to: [OceanWP] PDF Embedder not working on quick-view-content.phpI updated the page, see here. Using the following code I have embedded product PDF on archive page.
<?php add_action('ocean_after_archive_product_title', 'product_datasheet_embed_display_below_title', 5); function product_datasheet_embed_display_below_title() { if( get_field ('datasheetquickview')): ?> <?php echo do_shortcode('[pdf-embedder url="'.get_field('datasheetquickview').'"]'); ?> <?php endif;}
Is it possible to display this in Quick View?
Forum: Themes and Templates
In reply to: [OceanWP] PDF Embedder not working on quick-view-content.phpI contacted them, no response yet. Shortcode works on regular pages, however perhaps it conflicts with Quick View settings.
Forum: Plugins
In reply to: [Enable Media Replace] Link Update doesn’t work with Advanced Custom FieldsI set this post to ‘resolved’ because I was not using the latest updated plugin. Updating the plugin fixed the problem for me.
Thank you! On Tablepress, I unchecked “Use the following features of the DataTables JavaScript library with this table:” and it works now.
Strangely enough, Related Products Quick View does not work on products in one category, but it does work on products in another category. It works, for example, on this product in another category
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Plugin can’t activate because of fatal errorAlso this:
Fatal error: require(): Failed opening required ‘/home/content/p3pnexwpnas10_data01/75/42146275/html/wp-content/plugins/woocommerce/includes/wc-attribute-functions.php’ (include_path=’.:/opt/remi/php72/root/usr/share/pear:/opt/remi/php72/root/usr/share/php:/usr/share/pear:/usr/share/php’) in /home/content/p3pnexwpnas10_data01/75/42146275/html/wp-content/plugins/woocommerce/includes/wc-core-functions.php on line 28
Forum: Themes and Templates
In reply to: [OceanWP] Add labels to archive page grid/list view buttonsYou are so helpful, thank you for all your work.
Forum: Themes and Templates
In reply to: [OceanWP] Add labels to archive page grid/list view buttonsI don’t want to remove icon, I’d like both icon and label. If possible I would like the words above or beneath the icon. How can I do this? Thank you very much for your help.
- This reply was modified 5 years, 11 months ago by stoicassistant.
- This reply was modified 5 years, 11 months ago by stoicassistant.
I found the solution, I combined your suggestion with someone else’s help in my post on Stackoverflow. Thank you very much for your help. Here is the full code snippet:
//Register the product custom field add_action( 'woocommerce_product_options_general_product_data', 'my_woocommerce_product_subheading' ); function my_woocommerce_product_subheading() { $args = array( 'label' => 'Subheading', // Text in Label 'placeholder' => 'My Subheading', 'id' => 'product_subheading', // required 'name' => 'product_subheading', 'desc_tip' => 'The product subheading', ); woocommerce_wp_text_input( $args ); } //Save the custom field as product custom post meta add_action( 'woocommerce_process_product_meta', 'my_woocommerce_save_product_subheading' ); function my_woocommerce_save_product_subheading( $post_id ) { $product = wc_get_product( $post_id ); $title = isset( $_POST['product_subheading'] ) ? $_POST['product_subheading'] : ''; $product->update_meta_data( 'product_subheading', sanitize_text_field( $title ) ); $product->save(); } //Display the custom field on product page loop below the title add_action( 'ocean_after_archive_product_title', 'subheading_display_below_title', 2 ); function subheading_display_below_title(){ global $product; // Get the custom field value $subheading = get_post_meta( $product->get_id(), 'product_subheading', true ); // Display if( ! empty($subheading) ){ echo '<p class="subheading">'.$subheading.'</p>'; } }
- This reply was modified 5 years, 11 months ago by stoicassistant.
I changed
woocommerce_after_shop_loop_item_title
toocean_after_archive_product_title
but it didn’t work. Any idea how I can fix this?add_action( 'ocean_after_archive_product_title', 'subheading_display_below_title', 2 ); function subheading_display_below_title(){ global $product; // Get the custom field value $subheading = get_post_meta( $product->get_id(), 'subheading', true ); // Display if( ! empty($subheading) ){ echo '<p class="subheading">'.$subheading.'</p>'; } }
Thank you.