Welcome to our Support Portal › Forums › WooCommerce Personalized Product Options Manager (PPOM) › Move PPOM Fields Form
- This topic has 6 replies, 2 voices, and was last updated 2 years, 10 months ago by
nmedia.
-
AuthorPosts
-
January 31, 2021 at 10:48 pm #22118
Sheridan
ParticipantI have another form with input fields that display above the Booking Activities Plugin calendar on the woocommerce single product page. When I changed the priority in the file editor to be lower it caused a website error.
Here’s the code which can found: wp-content/plugins/booking-activities/controller/controller-woocommerce-frontend.php
add_action( 'woocommerce_before_add_to_cart_button', 'bookacti_add_booking_system_in_single_product_page', 20, 0 );
I tried changing it to this below in the file editor but gave me website error.
add_action( 'woocommerce_before_add_to_cart_button', 'bookacti_add_booking_system_in_single_product_page', 5, 0 );
Here is the PPOM code:
// Rendering fields on product page add_action ( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_show_fields', 15); // if( apply_filters('ppom_remove_duplicate_fields', true) ) { // add_action ( 'woocommerce_single_variation', 'ppom_woocommerce_show_fields', 15); // } // Validating before add to cart add_filter ( 'woocommerce_add_to_cart_validation', 'ppom_woocommerce_validate_product', 10, 3 );
When I tried to change the priority of the action from 15 to 30 I got an error message too.
Can you please help me to change the priority of the action so it appears 1st before any add forms on the single product summary? Also Does PPOM Pro offer an y shortcodes?
here is a screenshot of how it appears on the single product page: http://prnt.sc/xxsw1h
February 1, 2021 at 1:20 pm #22123nmedia
KeymasterHi,
When lower the priority it should display the at bottom of the booking plugin. And I don’t think it should throw any error by changing the priority numbers.
February 1, 2021 at 3:42 pm #22126Sheridan
ParticipantHello thanks for your response. Please see the screenshot the form is not displaying at the bottom of the form with current set priority of 15 and the other plugin form set at 20. It’s appearing at the top of the form.
February 1, 2021 at 3:43 pm #22127Sheridan
ParticipantAlso does ppom offer any shortcodes?
February 3, 2021 at 2:09 pm #22152nmedia
KeymasterUmm, no shortcode so far.
February 5, 2021 at 4:23 am #22207Sheridan
ParticipantWell I had figured it out the other day. I had to change the priority to a higher number so that it was last before the add to cart button:
/* * following functions below are to change the position/priority of the input products fields by PPOM for Woocommerce by N-MEDIA plugin and the booking calendar form by Booking Activities plugin on Woocommerce single product page */ remove_action( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_show_fields', 15); add_action( 'woocommerce_before_add_to_cart_button', 'ppom_woocommerce_show_fields', 20); remove_action( 'woocommerce_before_add_to_cart_button', 'bookacti_add_booking_system_in_single_product_page', 20, 0 ); add_action( 'woocommerce_before_add_to_cart_button', 'bookacti_add_booking_system_in_single_product_page', 10, 0 );
Well can you please tell me how to hook/display only the input fields somewhere else like Elementor or Gutenburg?
Is there a way to dynamically link the field through the meta key? if so how?
Are there any sample CSS documentation for the customizing the rendering of the fields?
-
This reply was modified 2 years, 10 months ago by
Sheridan.
February 8, 2021 at 1:38 pm #22269nmedia
KeymasterHi,
Good to know that you figure it out, unfortunately I cannot provide help in this regard to dynamically link PPOM fields with meta key. And all PPOM fields are being controlled/rendered with
inc/nmInput.class.php
file. -
This reply was modified 2 years, 10 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.