Thomas Endersen
Forum Replies Created
-
Thank you!
+1 Thanks
Awesome, thank you!
Awesome, thank you!
By the way the immediate solution is to give shop_manager access to manage_options:
add_action('init', 'add_manage_options_to_shop_manager');
function add_manage_options_to_shop_manager() {
$role = get_role('shop_manager');
if ($role) {
$role->add_cap('manage_options');
}
}Scratch that, it gives too much access. Instead, adding current_user_can(‘edit_users’) to the rest api callback will fix this with little impact:
public function profile_restapi_callback() {
register_rest_route('wholesalex/v1','/profile_action/',array(
array(
'methods' => 'POST',
'callback' => array($this, 'profile_action_callback'),
'permission_callback' => function () {
return current_user_can('manage_options') || current_user_can('edit_users');
}, 'args' => array(),),));
}This is file class-wholesalex-profile.php in /public_html/wp-content/plugins/wholesalex/includes/menu/ line 68 or so
- This reply was modified 1 month, 4 weeks ago by Thomas Endersen.
- This reply was modified 1 month, 4 weeks ago by Thomas Endersen.
- This reply was modified 1 month, 4 weeks ago by Thomas Endersen.
Thank you Owadud, I have tested and confirmed resolved.
Awesome! Thanks!
Thank you
Hello, this is the issue:
$price_html = $this->format_sale_price($rp, $sp, $is_wholesale_price_applied) . $product->get_price_suffix();
In class-wholesalex-dynamic-rules.php line 6742
It returns:
string(312) “<del aria-hidden=”true”><span class=”woocommerce-Price-amount amount”><bdi><span class=”woocommerce-Price-currencySymbol”>$</span>0.00</bdi></span></del> <ins>Wholesale Price:<span class=”woocommerce-Price-amount amount”><bdi><span class=”woocommerce-Price-currencySymbol”>$</span>0.00</bdi></span></ins>”
And the bug is at:
if ( ! empty( $sale_price ) && ! empty( $regular_price ) ) {
return ” . wc_price( floatval( $regular_price ) ) . ‘ ‘ . $sale_text . wc_price( floatval( $sale_price ) ) . ”;
}line 2414
…Because $regular_price and $sale_price are in the form of a range as a string:
(sale) “$222.15 – $539.80” (low to high of variation)
(regular) “$233.84 – $568.21” (low to high of variation)I’m applying a temp fix on my side since the bug looks ugly on our site.
- This reply was modified 2 months, 2 weeks ago by Thomas Endersen.
WholesaleX issue.
Forum: Plugins
In reply to: [YITH WooCommerce Quick View] WordPress 6.6Thank you
Understood.
Ok
Hello,
That is correct, I am using the builtin shortcode for email collection purposes and don’t use (and don’t need to use) any other 3rd party tooling. On the article linked, it states:
The Popup Maker ‘Subscription Form’ shortcode can substitute for other form plugins for users who manually transfer subscriber data to their email marketing list or application.
Which is how I intend to use the feature, but having duplicate entries is not ideal and it seems to me that handling duplicates was intended feature considering settings page holds an error message that says “you are already a subscriber.”