Kline Lozada
Forum Replies Created
-
Forum: Plugins
In reply to: [Ultimate FAQ Accordion Plugin] Other FAQ are only showed when admin loggedGot it! Yes it’s the woocommerce! Will drop a message on the site!
Forum: Plugins
In reply to: [Advanced GeoIP Redirect] Redirect IterationHello Sajjad,
Have already resolved this part.Forum: Plugins
In reply to: [Advanced GeoIP Redirect] Redirect IterationI think there’s a problem on the current plugin, I have manually added the url with no wildcard, but it’s not working. Example if you visit https://domain.com/product/product-1/ it should be redirected to https://domain.com/europe/product/product-1/.
It’s pretty straight forward, but it redirects to https://domain.com/europe/ instead and I don’t understand why!Forum: Plugins
In reply to: [Advanced GeoIP Redirect] Redirect IterationI already tested these regex and it’s working fine. But my issue was actually my site is has a default url: https://domain.com/ which is the “US”. Now if the user is from europe and visits the url https://domain.com/product/product-one then it should be auto redirected to https://domain.com/europe/product/product-one and if it’s in US then it should retain, if the user is from ASIA then it should be https://domain.com/global/product/product-one is this possible?
Forum: Plugins
In reply to: [Advanced GeoIP Redirect] Redirect IterationThat’s great news. However, do you have any answer with my concern?
Thanks
Forum: Plugins
In reply to: [Advanced GeoIP Redirect] Redirect IterationAny updates?
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?Thank you so much for helping out, this is already resolved. The first codebase I shared was actually from a debugging, and I haven’t included all the code on that, just a context on how it should be working.
But managed to make it work from the code you shared. Also yes, it is working perfectly on ajax and code snippet. Thank you
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?Already did, I reviewed the code and all seems to be correct. I transferred the php script on the functions.php and it works perfectly. But I can’t seem to understand why if transferred to a Code Snippet plugin, the code doesn’t seem to work.
Error 400 persistently shows up.
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?Weird. It’s still error 400 on my end. Are you using: Code Snippets plugin for embedding the php script on wp_ajax hook?
The payload is working correctly, but the preview/response returns 0. It seems not getting the value from the my_function().
Forum: Plugins
In reply to: [Code Snippets] Where does the PHP file saved after creating the snippet?Trying to run a script with the ajax script
add_action('wp_ajax_my_ajax_hook', 'my_function'); add_action('wp_ajax_nopriv_my_ajax_hook', 'my_function'); add_action( 'wp_enqueue_scripts', 'my_enqueue' ); function my_enqueue() { $upload_dir = wp_upload_dir(); wp_enqueue_script( 'ajax-script', $upload_dir['baseurl'] . '/custom-css-js/152152.js', array('jquery') ); wp_localize_script( 'ajax-script', 'my_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); } function my_function() { $_degree = $_POST['degreetype']; $_areainterest = $_POST['areainterest']; $_programlocation = $_POST['programlocation']; $_data = json_encode(array("degree" => $_degree, "areainterest" => $_areainterest)); wp_send_json_success( $_data ); exit(); }
I’m also using a plugin called: Simple Custom CSS and JS for the js script
File: /custom-css-js/152152.js
jQuery(document).ready(function($){ $('.filter-option').change(function() { $.ajax({ type: 'POST', dataType: "JSON", url: my_ajax_hook.ajax_url, data: { action: 'my_ajax_hook', degreetype: $('#DegreeType').val(), areainterest: $('#AreaInterest').val(), programlocation: $('#ProgramLocations').val() }, success: function(response) { console.log(response.degree); } }); }); });
The problem is it’s returning error 400, it’s calling the admin-ajax.php but it’s status is 400. So i’m not sure if ajax is allowed to run in this snippet?
Thanks
- This reply was modified 2 years, 11 months ago by Kline Lozada.
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?It’s the same. It still gets error 400, that’s why I’m kind of confused that I have set everything correctly, but the json doesn’t pass on ajax.
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?I did actually changed that to the one you recommended, but the weird part was that it’s returning error 400. It’s calling for ‘admin-ajax.php’ but error 400.
Forum: Plugins
In reply to: [Simple Custom CSS and JS] Plugin Accepting Ajax?Hello,
There’s a plugin called Code Snippets and I’m using this to enqueue ajax script
add_action('wp_ajax_my_action_hook', 'my_function'); add_action('wp_ajax_nopriv_my_ajax_hook', 'my_function'); add_action( 'wp_enqueue_scripts', 'my_enqueue' ); function my_enqueue() { $upload_dir = wp_upload_dir(); wp_enqueue_script( 'ajax-script', $upload_dir['baseurl'] . '/custom-css-js/152152.js', array('jquery') ); wp_localize_script( 'ajax-script', 'my_ajax_object', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); } function my_function() { $_degree = $_POST['degreetype']; $_areainterest = $_POST['areainterest']; $_programlocation = $_POST['programlocation']; $_data = json_encode(array("degree" => $_degree, "areainterest" => $_areainterest)); wp_send_json_success( $_data ); exit(); }
On the other hand I’m using this plugin to run the script as well
File: /custom-css-js/152152.js
jQuery(document).ready(function($){ $('.filter-option').change(function() { $.ajax({ type: 'POST', dataType: "JSON", url: cu_ajax_object.ajax_url, data: { action: 'my_ajax_hook', degreetype: $('#DegreeType').val(), areainterest: $('#AreaInterest').val(), programlocation: $('#ProgramLocations').val() }, success: function(response) { console.log(response.title); } }); }); });
- This reply was modified 2 years, 11 months ago by Kline Lozada.
- This reply was modified 2 years, 11 months ago by Kline Lozada.
- This reply was modified 2 years, 11 months ago by Kline Lozada.
- This reply was modified 2 years, 11 months ago by Kline Lozada.
- This reply was modified 2 years, 11 months ago by Kline Lozada.
Forum: Plugins
In reply to: [OAuth Single Sign On - SSO (OAuth Client)] Clever OAuth ProblemThank you for the swift reply, already sent a configuration and the query in the plugin.
I have already got the generic details, just to clarify, in order to get those data that we need like emails and such we need additional api which is available only on premium right?
- This reply was modified 3 years, 1 month ago by Kline Lozada.
Forum: Plugins
In reply to: [Ajax add to cart for WooCommerce] Working on DIVI?Awesome. Thanks