Square API paymentform not populating input fields on Wordpress - php

I am integrating squareup api in my wordpress woocommerce site I set SqPaymentForm in my plugin
But it only shows form labels not input fields. something like this:
I set it in my custom template it works fine but not in my plugin.

The issue is that your javascript is being fired before your plugin has rendered on the page. You can try loading your script in the footer with wp_enqueue_script('squareup-paymentform', 'https://js.squareup.com/v2/paymentform', array(), false, true) or call paymentform.build() after your page has loaded. Take a look here for more information: https://docs.connect.squareup.com/articles/adding-payment-form/#generatingpaymentform

Related

How to change content of elementor widget by code without UI

I am developing WordPress plugin that can be generated pages with elementor template. After generating pages, I want to change the content of page from plugin without accessing elementor UI.
Pages generating part has been completed.
Now my problem is changing elementor widget content according to plugin settings when submitting plugin settings.
I have gone through the elementor developer documentation and still couldn't find a solution.
Elementor save entire page content in one database row of WordPress database.
IT would be really appreciated if anyone has a solution with this from elementor side or database side.

Why isn't my Contact Form 7 form rendering on the website?

I used the shortcode as prescribed by the plug-in, which is [contact-form-7 id=”601″ title=”Contact form 1″].
Instead of rendering the form, I only see the shortcode in Production. Seems like it should be simple but I can't get the form to render on the site.
Meanwhile, another plug-in, WP Forms, works.
I would like to use Contact Form 7 because it integrates with the WP theme (Folie) I installed.
the most likely issue is that you are inserting your shortcode using a page builder/bock editor and not using a shortcode widget to do so. Hence your page editor is re-formatting the shortcode and rendering it null.
Either insert your shortcode using the HTML editor or contact the help for your page builder/editor on how to insert shortcodes properly.

Add PHP Pages to wordpress

I have a HTML form that user can interact with and insert the data to a database.
( One HTML form and about 3 pages .php )
I need to implement this form to a word press page.
I created a page in wordpress and it gives me a blank area to write my content but i don't know where i put my files.
so appreciate your support to help me , thanks .
Where you place your files depends greatly on the structure of your wordpress template. If you want to make a page that can be accessed via a url like "www.yourdomain.com/form", then you can make a "Page" in Wordpress (via the "Page" panel via the dashboard), and name it "Form" and then, in your form's HTML (or PHP) file, set your HTML up as a template using this syntax:
Put this at the very top of your PHP page that contains your form's HTML/PHP:
<?php
/*
Template Name: My Form Page
*/
The code comment above is something wordpress will look for exclusively, and tells the wordpress engine that this page (your form HTML) is now a template named 'My Form Page'. So now, in the Wordpress Page editor for your "Form" page, you can attach your new template to your newly-created "Form" page by selecting "My Form Page" from the Template Dropdown in the Page editor.
Here is a screenshot of what the "Template Dropdown" looks like (per the Wordpress documentation):
After you follow these steps, navigating to this page will reveal your form's HTML, instead of a blank page.
You should refer to the Wordpress documentation on Page Templates for more information:
Hope this helps!
There are a few ways to add custom behaviour to a WordPress installation. Either per Addon/Plugin or Template Logic or custom modifications. I would recommend that you read through the wordpress developer guidelines and write your php files as plugin.
After that hook your plugin to your desired destinations and do your whished actions.
See this link for writing your plugin: wordpress codex

Displaying Gravity Forms Forms Outside of WordPress

My client wants to use Gravity Forms to create forms - he is giving department managers access to the WordPress dashboard, then each manager will go in and create forms. No problem there.
But, the client has a special interface for end-users (members) that is OUTSIDE of WordPress. He would like to have the forms created using Gravity Forms to be displayed in this interface. I can create shortcode or use the function 'gravity_form()' to call the forms, but then they are always displayed with the WordPress headers/layout/etc.
Is there a way I can access and display JUST the form? (I've tried doing something similar to how the preview is displayed when you click the 'preview' option while creating the form. But, I get the 'this is a preview' message).
You might try the following add-on which generates an iframe you can use to display the form on pages outside WordPress:
Gravity Forms Iframe Add-on
The typical process to embed a Gravity Form on a site where the plugin isn't installed requires:
Developing a custom page template with necessary code to output form scripts and styles.
Creating a new page in WordPress.
Inserting the form shortcode in the new page.
Manually writing an iframe tag with the page permalink and giving it a static height.
With the Gravity Forms Iframe add-on, just enable a setting to allow the form to be embedded and copy the code snippet. That's it. As a bonus, the iframe automatically resizes whenever the form height changes -- for instance, when fields are shown or hidden due to conditional logic.

How to update my Wordpress 3.0 widget admin page using the update function or equivalent?

I originally wrote my Wordpress 3.0 widget http://codex.wordpress.org/Widgets_API for editing on the widget page after it has been placed in a sidebar, which handles the updating automatically using the update() function in widget. It has grown and needs a widget admin page now so outside my widget class I added another action I found http://codex.wordpress.org/Adding_Administration_Menus to add a admin_menu, so far so good (hopefully I did it using a current API method but there didn't seem to another method in the widget.php file of WP). I created the form but I don't know how to update the widget now. I've looked through the code for widgets and I'm not sure how the update function actually works. I read that you can have options and add them to the database but if they already exist I don't want to abandon that data if there's a way to keep using it. The widget will keep two fields on the widget page and the rest will be handled on the admin page.
How do I update my widget from the admin page and have it be retrieved by the widget and can that be done in such a way that it is stored in the same place as my existing widget data using WP3.0 current widget API? If not how would I go about doing it?
The answer can be found in the "Plugin Options Starter Kit" plugin http://wordpress.org/extend/plugins/plugin-options-starter-kit/ that contains all you need to figure out how to use the settings API, adding admin menu pages and more. Can't wait to see the next update of this plugin.

Categories