Jeff Alvarez
Forum Replies Created
-
Hi @kalora123
Could you please check if disabling the Caching plugin fixes the issue? If not then it may be due to something else.
If yes, then you’ll likely have to exclude caching for our plugin. You mentioned that you tried to disable caching through the WP-Config file.
Could you please try disabling caching on a page basis or plugin level settings and see if that helps?
As this directly involves a 3rd party plugin our support is quite limited, I suggest you reach out to the W3 Total Cache support forum on how to exclude cache for users or stop caching our plugins.
Let me know if you have other questions.
Hi @jderosa ,
Please give this snippet a shot, to use it simply change or add more $product_types[] or update the custom_product_type1 to the product type your store is using.
add_filter( 'acfw_product_search_allowed_types' , 'acfw_search_add_support_for_custom_products' ); function acfw_search_add_support_for_custom_products( $product_types ) { $product_types[] = 'custom_product_type1'; $product_types[] = 'variable-custom_product_type1'; return $product_types; }
Once your happy with the code, please add the snippet to your child theme’s functions.php or through the WPCode plugin
You can reach out to the other plugin’s support or author to help complete the snippet.
- This reply was modified 1 year, 5 months ago by Jeff Alvarez.
Hi @solutioinc ,
Apologies for the delay in our response.
There’s currently no feature to force the PO field be required or available filters to change that so I’m unable to provide custom snippets.
Having said that, I’ll raise a feature request for this with our development team but please keep in mind that we aren’t able to provide any ETAs when it’ll be developed or made.
In the meantime, let us know if you have other questions.
Cheers,
hi @welaunchio ,
Please give this code a try, it’ll only return the wholesale price of the product.
global $wc_wholesale_prices; $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); $wholesale_price = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop($product->get_id(), $user_wholesale_role);
If that doesn’t work, then I’m afraid we’ll need to raise an integration request with our developers. We also are not able to assist from here as this is outside our support scope.
Let us know if you have other questions.
Regards,
Hi there,
Apologies for the delay in our response.
As previously mentioned, the likely reason why it’s not working as intended is that our plugin will use the Wholesale price by default when it’s available, it’ll only use retail if there’s no wholesale price.
If you’d like to have the customer have a wholesale role but use retail price as the default, I’m afraid you’ll have to create a snippet to modify how our plugin behaves. For this, we aren’t able to provide support.
You mentioned that the snippet was working for admin/regular/guest customers. Would it be fine to simply have their user roles as regular customers so the price by default is retail and have the function update to wholesale instead of having it default to the wholesale customer?
Alternatively, you could create another role and name it custom-wholesale, which is outside wholesale prices so by default it’ll use retail and have your function update accordingly. Since this is a custom role it’ll be separated from regular customers so the function you have should work.
Let me know if you have other questions.
Regards,
Hi @zewa ,
Good news, we made a custom snippet that achieves just that. Please add the following to your child theme’s functions.php or through the WP Code plugin
add_filter( 'woocommerce_cart_totals_coupon_html', 'woocommerce_cart_totals_coupon_html_filter', 10, 3 ); /** * Function for
woocommerce_cart_totals_coupon_html
filter-hook. * * @param $coupon_html * @param $coupon * @param $discount_amount_html * * @return */ function woocommerce_cart_totals_coupon_html_filter( $coupon_html, $coupon, $discount_amount_html ){ if($coupon->discount_type === "percent"){ return $coupon->amount ."% "."or " . $coupon_html; } return $coupon_html; }Result: Screenshot by Lightshot (prnt.sc)
Please note that we aren’t able to provide further support for custom codes when/if used.
Sorry about that, I’ve accidentally included our premium plugin’s function which resulted to errors.
Please use this
add_action('woocommerce_after_shop_loop_item','test'); function test(){ global $wc_wholesale_prices; $currentUserRole = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); global $product; $productID = $product->get_id(); $wholesaleProduct = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop_v3( $productID, $currentUserRole ); $wholesalePrice = $wholesaleProduct['wholesale_price']; echo $wholesalePrice." Coded price goes here"; }
Output: Screenshot by Lightshot (prnt.sc)
Please note that if you are not seeing the same result as my screenshot, I suggest running some basic debugging to check for conflicts: How To Conduct A Basic Debug For Wholesale Suite – Wholesale Suite (wholesalesuiteplugin.com)
hi @welaunchio ,
You can use the following parts of the to get the wholesale price of the product
global $wc_wholesale_prices; global $product; $productID = $product->get_id(); $wholesale_roles = $wc_wholesale_prices->wwp_wholesale_roles->getAllRegisteredWholesaleRoles(); // loop through wholesale roles foreach( $wholesale_roles as $wholesale_role => $data ) { // get wholesale price of product per wholesale role $wholesale_price_data = WWP_Wholesale_Prices::get_product_wholesale_price_on_shop_v3($productID, array( $wholesale_role ) ); $wholesale_sale_price_data = WWPP_Wholesale_Prices::get_product_wholesale_sale_price($productID, array( $wholesale_role ) ); // category level wil output 'product_category_level', per product is 'per_product_level'. general is 'wholesale_role_level' $wholesale_price_source = $wholesale_price_data[ 'source' ]; // wholesale price $wholesale_price = $wholesale_price_data[ 'wholesale_price' ]; }
Here’s an example output: Screenshot by Lightshot (prnt.sc)
Let us know if you need anything else.
Hi @tanlaci ,
We have a price caching feature but it’s only available for the Premium version of our plugin, see: https://prnt.sc/WIZ2EUSuvx8M
So, if you are a premium user, please disable it and check if the issue is fixed. If you are a free user then it’s likely a partially compatible plugin or caching from somewhere else, like:
- Plugin caching
- Server caching (reach out to your host provider to check and disable)
Let me know if you have other questions.
Cheers,
Hi @prokops,
Yes, you can do that with a snippet. Please add the following to your child theme’s functions.php or through the WPCode plugin
add_action('wp_head','remove_add_to_cart'); function remove_add_to_cart(){ if(!is_user_logged_in()){ add_filter( 'woocommerce_is_purchasable', '__return_false'); } } add_filter('woocommerce_short_description','ask_login'); function ask_login($description){ if(!is_user_logged_in()){ echo "<p><a >Login to add to cart</a> </p>"; } return $description; }
This will allow the users to see the price but be unable to purchase until they log in, it’ll also show a login to view the price on the short description area on the product page.
Please note to update the https://google.com link to the link of your website’s login page.
I’ll include some useful articles if you’d like to further learn the code:
- is_user_logged_in() | Function | WordPress Developer Resources
- The RIGHT Way to Hide ‘Add to Cart’ Button in WooCommerce (wisdmlabs.com)
- WooCommerce Code Reference
Hope this helps. Let us know if you have other questions.
Cheers,
Hi there,
Thanks for the explanation. To recap you want the wholesale customer’s default to using the regular price but upon clicking the button they’ll get the wholesale price? Please correct me if I’m wrong here.
If that were the case I’m afraid that’s not possible as our plugin will always use the wholesale price when it’s available, so it’s likely the reason why the price is not changing for the wholesale customers but works with other roles IE regular and guest users.
What you could try is to use CSS to hide the wholesale price by default only showing the retail and removing the add to cart button as well. Once the button is clicked it’ll then add the CSS to bring the wholesale price back.
Let us know if you have other questions or need further clarification.
Cheers,
Hi there,
I’m unable to accurately figure the feature you had in mind, so we aren’t able to provide much support. Is the second price you are referring to the wholesale price for the retail customers?
Reading through your post, you made a button that pulls the wholesale price on the frontend? As a wholesale customer, it’s not working as intended but is attached, I’m unsure here if you are still pulling the wholesale price as it’s already displaying the wholesale price due to their role.
Having said that we have a feature for this in Woocommerce > Settings > Wholesale Prices > Price, scroll down and you’ll find a feature where it says “Show wholesale price to non-wholesale customers”
If you are one of our premium users, please reach out to our support form here: Support Request Form – Wholesale Suite (wholesalesuiteplugin.com)
Hi @titocalabrese ,
We currently do not have this feature in our plugins but it is achievable via a 3rd party plugin, an example would be: Nav Menu Roles – WordPress plugin | www.remarpro.com
If you’d like to learn more, read here: How To Make Wholesale Only Menu Items – Wholesale Suite (wholesalesuiteplugin.com)
Let us know if you have other questions.
Hi there,
Seems that you are our premium users and have reached out to us via our contact form. We’ll continue from there.
For now, I’ll mark this ticket as resolved, you’ll receive a reply from us shortly.
Hi @kenarp45 ,
Sorry to hear that you are experiencing issues with your site.
Please remove the login credentials that you’ve provided as it’s not in accordance with the WordPress guidelines
I also suggest doing some basic debugging like turning off 3rd party plugins and switching themes to check for conflicts. If you are unfamiliar, please read here: How To Conduct A Basic Debug For Advanced Coupons – Advanced Coupons (advancedcouponsplugin.com)
If you still face issues please reach out to us through our support form here: Submit Support Ticket – Advanced Coupons (advancedcouponsplugin.com)
Regards,