crslz
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] does not remove the Cart Icon from HeaderHello,
because your question is theme related you should not ask your question here, this is specifically aimed at the woocommerce plugin.
However, if you can provide a URL to your website, I can take a closer look at your question
Forum: Plugins
In reply to: [WooCommerce] Bypassing login page with redirect URLHi,
The following code (with some adjustments) can solve this problem for you
https://developer.www.ads-software.com/reference/hooks/login_redirect/
/** * Redirect user after successful login. * * @param string $redirect_to URL to redirect to. * @param string $request URL the user is coming from. * @param object $user Logged user's data. * @return string */ function my_login_redirect( $redirect_to, $request, $user ) { //is there a user to check? if ( isset( $user->roles ) && is_array( $user->roles ) ) { //check for admins if ( in_array( 'administrator', $user->roles ) ) { // redirect them to the default place return $redirect_to; } else { return home_url(); } } else { return $redirect_to; } } add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );
Forum: Plugins
In reply to: [WooCommerce] Adding a reference number to all ordersHi,
You could add an extra (required) field during the checkout so it is certainly possible.
This is possible with a plugin as well as with custom code. But the customer can enter any number, right? and should this number be visible in the order overview? or also in the order e-mails?
Forum: Plugins
In reply to: [WooCommerce] Restrict Access with Post CodeCan you try the following steps?
Step 1) Copy/paste this code, execute and view the page
function my_restrict_access() { echo 'step 1 works!'; } add_action( 'template_redirect', 'my_restrict_access');
Step 2) If step 1 works, replace the code with the one from step 2
function my_restrict_access() { $category = get_queried_object(); if ( $category ) { echo 'step 2 works!'; } else { echo 'step 2 NOT works!'; } } add_action( 'template_redirect', 'my_restrict_access');
Step 3) If step 2 works, perform step 3… replace code with the one from step 3
function my_restrict_access() { $category = get_queried_object(); if ( $category ) { $category_id = isset( $category->term_id ); if( $category_id == 3078 ) { echo 'step 3 works!'; } else { echo 'step 3 NOT works!'; } } } add_action( 'template_redirect', 'my_restrict_access');
Up to which step does the code work without problems?
The code appears to come from the following file
https://github.com/weDevsOfficial/dokan-theme/blob/develop/assets/js/script.js#L58
https://github.com/weDevsOfficial/dokan-theme/blob/develop/assets/js/script.js#L62
Note: for additional questions please create a new topic and mark this as solved.
Forum: Plugins
In reply to: [WooCommerce] woocommerce.php is not overriding page.phI also can’t override template files by copying WooCommerce Template files into my Themes folder. I also know that the correct way to that would be by copying the necessary files into the following folder wp-content/themes/MYTHEME/woocommerce/templates
The templates folder is not necessary in your own theme
How to override a template? A example.
To override the shop page,
copy: wp-content/plugins/woocommerce/templates/archive-product.php
to: wp-content/themes/your_theme_name/woocommerce/archive-product.phpForum: Plugins
In reply to: [WooCommerce] Restrict Access with Post Codeokay, and what’s the category id of that page? I don’t see the output printed on that page anywhere?
Forum: Plugins
In reply to: [WooCommerce] Restrict Access with Post Code1) copy/paste my code to functions.php
2) uncomment the following rules//echo $category_id;
&
// echo $customer_postcode;
3) post the result of the output here (sreenshot) or link to one of your category pages
Forum: Plugins
In reply to: [WooCommerce] Change product tabs order if no reviewsHi,
can you change the code to the next and try?
/** * Woocommerce tabs default reviews----------------------------------- */ add_filter( 'woocommerce_product_tabs', 'reordered_tabs', 98 ); function reordered_tabs( $tabs ) { // Get $product object global $product; global $post; // Get total product Reviews $product_reviews = $product->get_review_count(); // No reviews found if ( $product_reviews == 0 ) { $tabs['description']['priority'] = 10; // Description first $tabs['reviews']['priority'] = 20; // Reviews second } else { $tabs['reviews']['priority'] = 10; $tabs['description']['priority'] = 20; } if( get_post_meta( $post->ID, 'field_one', true ) || get_post_meta( $post->ID, 'comparison_product', true ) ) { // Adds the new tab $tabs['features'] = array( 'title' => __( 'Comparison', 'stackoverflow' ), 'priority' => 30, 'callback' => 'woo_new_product_tab_content_comparision' ); } return $tabs; } function woo_new_product_tab_content_comparision() { global $product; echo '<div class="div_center">'; echo do_shortcode(get_post_meta($product->id, 'comparison_product', true)); echo '</div>'; // print_r($product); }
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pageYou can also try to install the following plugin and search for the following string ‘products-page-cats‘
https://www.ads-software.com/plugins/string-locator/
in this way you can determine from which file the code for the categories is added
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pageThen it will most likely be overwritten via a hook, this can be done from functions.php but also from another file.
You will have to look for a developer who can sort this out for you, to be able to say this with certainty, access is needed to the backend of woocommerce and the admin login is required for that.
Regards
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pagethat is again the wrong file, you posted the code from loop-start.php and it must be from add-to-cart.php
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pageCan you post a print screen as I just did?
like this -> https://pasteboard.co/IS6uyZ0t.jpg <-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pagehttps://brightonangling.com/wp-admin/theme-editor.php?file=woocommerce%2Floop%2Fadd-to-cart.php&theme=YOUR_THEME_NAME
OR
wordpress installation folder / wp-content / themes / YOUR THEME / woocommerce / loop / add-to-cart.php
Forum: Plugins
In reply to: [WooCommerce] WooCommerce remove categories from shop pageHey,
Either I do not understand your answer or have you not understood my question?
So I asked you to look for the next file in your woocommerce theme
yourtheme/woocommerce/loop/add-to-cart.php.
The code that you can find in this file should look something like this
If you can find that file in your theme, can you take a print screen of the content of that file or post the content here?
Regards