Retrieve Woocommerce Cart Url with javascript/jquery [closed]

You can pass it to the script via the functions.php file or a plugin using the wp_localize_script function. <?php function my_load_scripts() { wp_enqueue_script(‘my-script’, plugin_dir_url( __FILE__ ) . ‘js/my-script.js’); wp_localize_script(‘my-script’, ‘my_script_vars’, array( ‘woo_cart_url’ => get_permalink( wc_get_page_id( ‘cart’ ) ) ) ); } add_action(‘wp_enqueue_scripts’, ‘my_load_scripts’); Then it will be available in your script ( in the example: … Read more

Woocommerce section name? [closed]

WOO custmizer settings are under ‘woocommerce’ customizer panel ( panel has been added since WP 4.0) add_action(‘customize_register’,”SE_add_options_t_woo_customizer”); function SE_add_options_t_woo_customizer($wp_customize ){ $wp_customize->add_section( “my_new_section” , array( ‘title’ => “My new section”, ‘priority’ => 20, ‘panel’ => ‘woocommerce’, // here is where you grab the woocommerce panel to add settings and controls to ) ); $wp_customize->add_setting(‘my_new_setting’, array( ‘default’ … Read more

Using category and its sub-categories products attributes as filter in products pages

It’s possible to do it with Advanced AJAX Product Filters plugin. It allows you to use attributes in the filter. Follow these steps: Install and activate the plugin. In the right sidebar, click on Widgets. Under Filter By option, select Attribute. Under Atrribute option, which is located beside Filter By, choose the attribute of your … Read more

How to set subcategory in Woocommerce?

You will have to first insert the term as required using wp_insert_term. wp_set_object_terms( $post_id, ‘Lense’, ‘product_cat’, false); This function checks if ‘Lense’ term exist in product_cat or not. If does not exist, then create and assign. Check whether term already exists or not $id = term_exists( ‘canon’,’product_cat’,$parent_id ) //$parent_id is parent term id, in your … Read more

Woocommerce Shop Manager Capabilities

Issue is related to Order Delivery Date for WooCommerce. function orddd_lite_capabilities() { $role = get_role( ‘shop_manager’ ); if( ” != $role ) { $role->add_cap( ‘manage_options’ ); } } Comment out the line //add_action( ‘admin_init’, array( &$this, ‘orddd_lite_capabilities’ ));

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