Personalized URL for non-logged in WordPress

If I understand your problem, this procedure should work for you: create a custom post type nameofplugin_offer use a form to get the offers from customers, save them as the above CPT (see wp_insert_post()) in your CPT archive template ( that would be archive-nameofplugin_offer.php, see Template Hierarchy), within the loop, list all the public details … Read more

Return custom product in ajax call loop

Yes, you can query products by their ids and display them as ajax response. You code just needs a little revision. Perhaps you could try something along these lines, public function display_search_result(){ $skus = urldecode($_POST[‘sku_universel’]); $skus = explode(‘,’,$sku); $product_ids = array(); // you can use native woocommerce function to get the product ids foreach($skus as … Read more

Build a dynamic block using the default attributes

I also had this problem, and what I did is to define the attribute inside PHP and use wp_localize_script to pass down the array. Then you can pass in the variable in render_callback using use ($var) For example: $js = get_stylesheet_directory_uri() . ‘/assets/js’; $css= get_stylesheet_directory_uri() . ‘/assets/css’; $default_attributes = [ ‘alignment’ => [ ‘type’ => … Read more

Trigger a JavaScript function based on the data fetched from Woo commerce hook

After going through a lot of articles and solutions I finally figured it out: Directory Structure for the plugin (Boilerplate directory structure used from here) First step: Register a js script which would track the event/ user activity and pass it the ajax URL through which it would fetch the product details via ajax. // … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)